rendered paste bodynew paste:
snmpgetnext -dDump -v 2c -c public localhost ipAdEntNetmask
Sending 44 bytes to UDP: [127.0.0.1]:161
0000: 30 2A 02 01 01 04 06 70 75 62 6C 69 63 A1 1D 02 0*.....public...
0016: 04 27 E5 CA 95 02 01 00 02 01 00 30 0F 30 0D 06 .'.........0.0..
0032: 09 2B 06 01 02 01 04 14 01 03 05 00 .+..........
Received 53 bytes from UDP: [127.0.0.1]:161
0000: 30 33 02 01 01 04 06 70 75 62 6C 69 63 A2 26 02 03.....public.&.
0016: 04 27 E5 CA 95 02 01 00 02 01 00 30 18 30 16 06 .'.........0.0..
0032: 0E 2B 06 01 02 01 04 14 01 03 0A 00 00 81 17 40 .+.............@
0048: 04 FF FF FF 00 .....
IP-MIB::ipAdEntNetMask.10.0.0.151 = IpAddress: 255.255.255.0
code i'm utilizing:
char *oids[OIDS];
/* For variable OID instances */
char var_buffer[MAX_MSG];
database *data;
int i;
/* SNMPv2-MIB */
oids[0]="sysDescr.0";
oids[1]="sysUpTime.0";
oids[2]="sysContact.0";
oids[3]="sysName.0";
oids[4]="sysLocation.0";
/* IP-MIB */
oids[5]="ipForwarding.0";
snprintf(var_buffer,sizeof(var_buffer),"ipAdEntNetmask.",ip_addr);
oids[6]=var_buffer;
/* IF-MIB */
oids[7]="ifNumber.0";
dump of ipForwarding:
snmpgetnext -Ddump localhost ipForwarding.0
dumph_send: SNMPv3 Message
dumph_send: PDU-GET
dumph_send: error index
dumpx_send: 02 01 00
dumpv_send: Integer: 0 (0x00)
dumph_send: error status
dumpx_send: 02 01 00
dumpv_send: Integer: 0 (0x00)
dumph_send: request_id
dumpx_send: 02 04 55 BC CE 79
dumpv_send: Integer: 1438436985 (0x55BCCE79)
dumph_send: ScopedPdu
dumph_send: contextName
dumpx_send: 04 00
dumpv_send: String: [NULL]
dumph_send: contextEngineID
dumpx_send: 04 00
dumpv_send: String: [NULL]
dumph_send: msgSecurityModel
dumpx_send: 02 01 03
dumpv_send: Integer: 3 (0x03)
dumph_send: msgFlags
dumpx_send: 04 01 04
dumpv_send: String: .
dumph_send: msgMaxSize
dumpx_send: 02 03 00 FF E3
dumpv_send: Integer: 65507 (0xFFE3)
dumph_send: msgID
dumpx_send: 02 04 73 F3 43 72
dumpv_send: Integer: 1945322354 (0x73F34372)
dumph_send: SNMP Version Number
dumpx_send: 02 01 03
dumpv_send: Integer: 3 (0x03)
dumph_send: SM msgSecurityParameters
dumph_send: msgPrivacyParameters
dumpx_send: 04 00
dumpv_send: String: [NULL]
dumph_send: msgAuthenticationParameters
dumpx_send: 04 00
dumpv_send: String: [NULL]
dumph_send: msgUserName
dumpx_send: 04 00
dumpv_send: String: [NULL]
dumph_send: msgAuthoritativeEngineTime
dumpx_send: 02 01 00
dumpv_send: Integer: 0 (0x00)
dumph_send: msgAuthoritativeEngineBoots
dumpx_send: 02 01 00
dumpv_send: Integer: 0 (0x00)
dumph_send: msgAuthoritativeEngineID
dumpx_send: 04 00
dumpv_send: String: [NULL]
dumph_recv: SNMPv3 Message
dumph_recv: SNMP Version Number
dumpx_recv: 02 01 03
dumpv_recv: Integer: 3 (0x03)
dumph_recv: msgGlobalData
dumph_recv: msgID
dumpx_recv: 02 04 73 F3 43 72
dumpv_recv: Integer: 1945322354 (0x73F34372)
dumph_recv: msgMaxSize
dumpx_recv: 02 03 00 FF E3
dumpv_recv: Integer: 65507 (0xFFE3)
dumph_recv: msgFlags
dumpx_recv: 04 01 00
dumpv_recv: String: .
dumph_recv: msgSecurityModel
dumpx_recv: 02 01 03
dumpv_recv: Integer: 3 (0x03)
dumph_recv: SM msgSecurityParameters
dumph_recv: msgAuthoritativeEngineID
dumpx_recv: 04 0D 80 00 1F 88 80 17 97 DF 67 45 58 A5 1D
dumpv_recv: String: ........gEX..
dumph_recv: msgAuthoritativeEngineBoots
dumpx_recv: 02 01 0B
dumpv_recv: Integer: 11 (0x0B)
dumph_recv: msgAuthoritativeEngineTime
dumpx_recv: 02 02 12 4F
dumpv_recv: Integer: 4687 (0x124F)
dumph_recv: msgUserName
dumpx_recv: 04 00
dumpv_recv: String:
dumph_recv: msgAuthenticationParameters
dumpx_recv: 04 00
dumpv_recv: String:
dumph_recv: msgPrivacyParameters
dumpx_recv: 04 00
dumpv_recv: String:
dumph_recv: ScopedPDU
dumph_recv: contextEngineID
dumpx_recv: 04 0D 80 00 1F 88 80 17 97 DF 67 45 58 A5 1D
dumpv_recv: String: ........gEX..
dumph_recv: contextName
dumpx_recv: 04 00
dumpv_recv: String:
dumph_recv: PDU-REPORT
dumph_recv: request_id
dumpx_recv: 02 04 55 BC CE 79
dumpv_recv: Integer: 1438436985 (0x55BCCE79)
dumph_recv: error status
dumpx_recv: 02 01 00
dumpv_recv: Integer: 0 (0x00)
dumph_recv: error index
dumpx_recv: 02 01 00
dumpv_recv: Integer: 0 (0x00)
dumph_recv: VarBindList
dumph_recv: VarBind
dumph_recv: Name
dumpx_recv: 06 0A 2B 06 01 06 03 0F 01 01 04 00
dumpv_recv: ObjID: SNMP-USER-BASED-SM-MIB::usmStatsUnknownEngineIDs.0
dumph_recv: Value
dumpx_recv: 41 01 03
dumpv_recv: UInteger: 3 (0x03)
snmpgetnext: No securityName specified
dump of ipAdEntNetmask:
snmpgetnext -Ddump localhost ipAdEntNetMask
dumph_send: SNMPv3 Message
dumph_send: PDU-GET
dumph_send: error index
dumpx_send: 02 01 00
dumpv_send: Integer: 0 (0x00)
dumph_send: error status
dumpx_send: 02 01 00
dumpv_send: Integer: 0 (0x00)
dumph_send: request_id
dumpx_send: 02 04 27 E0 0E 8A
dumpv_send: Integer: 668995210 (0x27E00E8A)
dumph_send: ScopedPdu
dumph_send: contextName
dumpx_send: 04 00
dumpv_send: String: [NULL]
dumph_send: contextEngineID
dumpx_send: 04 00
dumpv_send: String: [NULL]
dumph_send: msgSecurityModel
dumpx_send: 02 01 03
dumpv_send: Integer: 3 (0x03)
dumph_send: msgFlags
dumpx_send: 04 01 04
dumpv_send: String: .
dumph_send: msgMaxSize
dumpx_send: 02 03 00 FF E3
dumpv_send: Integer: 65507 (0xFFE3)
dumph_send: msgID
dumpx_send: 02 04 23 41 75 86
dumpv_send: Integer: 591492486 (0x23417586)
dumph_send: SNMP Version Number
dumpx_send: 02 01 03
dumpv_send: Integer: 3 (0x03)
dumph_send: SM msgSecurityParameters
dumph_send: msgPrivacyParameters
dumpx_send: 04 00
dumpv_send: String: [NULL]
dumph_send: msgAuthenticationParameters
dumpx_send: 04 00
dumpv_send: String: [NULL]
dumph_send: msgUserName
dumpx_send: 04 00
dumpv_send: String: [NULL]
dumph_send: msgAuthoritativeEngineTime
dumpx_send: 02 01 00
dumpv_send: Integer: 0 (0x00)
dumph_send: msgAuthoritativeEngineBoots
dumpx_send: 02 01 00
dumpv_send: Integer: 0 (0x00)
dumph_send: msgAuthoritativeEngineID
dumpx_send: 04 00
dumpv_send: String: [NULL]
dumph_recv: SNMPv3 Message
dumph_recv: SNMP Version Number
dumpx_recv: 02 01 03
dumpv_recv: Integer: 3 (0x03)
dumph_recv: msgGlobalData
dumph_recv: msgID
dumpx_recv: 02 04 23 41 75 86
dumpv_recv: Integer: 591492486 (0x23417586)
dumph_recv: msgMaxSize
dumpx_recv: 02 03 00 FF E3
dumpv_recv: Integer: 65507 (0xFFE3)
dumph_recv: msgFlags
dumpx_recv: 04 01 00
dumpv_recv: String: .
dumph_recv: msgSecurityModel
dumpx_recv: 02 01 03
dumpv_recv: Integer: 3 (0x03)
dumph_recv: SM msgSecurityParameters
dumph_recv: msgAuthoritativeEngineID
dumpx_recv: 04 0D 80 00 1F 88 80 17 97 DF 67 45 58 A5 1D
dumpv_recv: String: ........gEX..
dumph_recv: msgAuthoritativeEngineBoots
dumpx_recv: 02 01 0B
dumpv_recv: Integer: 11 (0x0B)
dumph_recv: msgAuthoritativeEngineTime
dumpx_recv: 02 02 13 03
dumpv_recv: Integer: 4867 (0x1303)
dumph_recv: msgUserName
dumpx_recv: 04 00
dumpv_recv: String:
dumph_recv: msgAuthenticationParameters
dumpx_recv: 04 00
dumpv_recv: String:
dumph_recv: msgPrivacyParameters
dumpx_recv: 04 00
dumpv_recv: String:
dumph_recv: ScopedPDU
dumph_recv: contextEngineID
dumpx_recv: 04 0D 80 00 1F 88 80 17 97 DF 67 45 58 A5 1D
dumpv_recv: String: ........gEX..
dumph_recv: contextName
dumpx_recv: 04 00
dumpv_recv: String:
dumph_recv: PDU-REPORT
dumph_recv: request_id
dumpx_recv: 02 04 27 E0 0E 8A
dumpv_recv: Integer: 668995210 (0x27E00E8A)
dumph_recv: error status
dumpx_recv: 02 01 00
dumpv_recv: Integer: 0 (0x00)
dumph_recv: error index
dumpx_recv: 02 01 00
dumpv_recv: Integer: 0 (0x00)
dumph_recv: VarBindList
dumph_recv: VarBind
dumph_recv: Name
dumpx_recv: 06 0A 2B 06 01 06 03 0F 01 01 04 00
dumpv_recv: ObjID: SNMP-USER-BASED-SM-MIB::usmStatsUnknownEngineIDs.0
dumph_recv: Value
dumpx_recv: 41 01 04
dumpv_recv: UInteger: 4 (0x04)
snmpgetnext: No securityName specified