version 1.36, 2021/08/11 17:54:19 |
version 1.37, 2021/08/11 18:53:45 |
|
|
}; |
}; |
struct snmp_app *snmp_app = NULL; |
struct snmp_app *snmp_app = NULL; |
|
|
char *community = "public"; |
char *community = NULL; |
struct snmp_v3 *v3; |
struct snmp_v3 *v3; |
char *mib = "mib_2"; |
char *mib = "mib_2"; |
int retries = 5; |
int retries = 5; |
int timeout = 1; |
int timeout = 1; |
enum snmp_version version = SNMP_V2C; |
enum snmp_version version = SNMP_V3; |
int print_equals = 1; |
int print_equals = 1; |
int print_varbind_only = 0; |
int print_varbind_only = 0; |
int print_summary = 0; |
int print_summary = 0; |
|
|
argc -= optind; |
argc -= optind; |
argv += optind; |
argv += optind; |
|
|
if (version == SNMP_V3) { |
if (version == SNMP_V1 || version == SNMP_V2C) { |
|
if (community == NULL || community[0] == '\0') |
|
errx(1, "No community name specified."); |
|
} else if (version == SNMP_V3) { |
/* Setup USM */ |
/* Setup USM */ |
if (user == NULL || user[0] == '\0') |
if (user == NULL || user[0] == '\0') |
errx(1, "No securityName specified"); |
errx(1, "No securityName specified"); |