All pastes #275418 Raw Edit

snmp-coder

public text v1 · immutable
·published 2006-12-11 15:07 UTC
rendered paste body
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