|
|
@@ -32,7 +32,7 @@ static char* snmp_get(char *community, char *ip, char *oid_array, int msgtype)
|
|
|
size_t name_length;
|
|
|
int status;
|
|
|
int exitval = 0;
|
|
|
- netsnmp_pdu *pdu;
|
|
|
+ netsnmp_pdu *pdu;
|
|
|
netsnmp_pdu *response;
|
|
|
netsnmp_variable_list *vars=NULL;
|
|
|
|
|
|
@@ -55,9 +55,9 @@ static char* snmp_get(char *community, char *ip, char *oid_array, int msgtype)
|
|
|
|
|
|
pdu = snmp_pdu_create(msgtype);
|
|
|
if(msgtype==SNMP_MSG_GETBULK) {
|
|
|
- pdu->non_repeaters = non_repeaters;
|
|
|
- pdu->max_repetitions = max_repetitions;
|
|
|
- snmp_add_null_var(pdu, names[0].name, names[0].name_len);
|
|
|
+ pdu->errstat = 10;//non_repeaters;
|
|
|
+ pdu->errindex = 10;//max_repetitions;
|
|
|
+ snmp_add_null_var(pdu, name, name_length);
|
|
|
}
|
|
|
else {
|
|
|
name_length = MAX_OID_LEN;
|
|
|
@@ -154,6 +154,24 @@ char* snmp_nms_getbulk(snmp_req_t *req)
|
|
|
}
|
|
|
|
|
|
|
|
|
+typedef struct {
|
|
|
+ char mac[20];
|
|
|
+ char ip4[24];
|
|
|
+ char ip6[48];
|
|
|
+}switch_port_t;
|
|
|
+
|
|
|
+typedef struct {
|
|
|
+ switch_port_t port[SW_PORT_MAX];
|
|
|
+}switch_data_t;
|
|
|
+
|
|
|
+
|
|
|
+int switch_port_scan(switch_data_t *sw)
|
|
|
+{
|
|
|
+ //snmp_get();
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int snmp_nms_deinit(void)
|
|
|
{
|
|
|
SOCK_CLEANUP;
|