Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SNMP PDU (snmp_pdu)

Reached from

Lower layerSelectorValue
snmpversion(any other value)

Fields

FieldTypeDefaultAutoDescription
pdu_typeenum(8)160 (get_request)PDU tag (0xa0 GetRequest, 0xa2 Response, 0xa4 v1 Trap, 0xa7 SNMPv2-Trap, …).
pdu_lengthuint(8)Length of the header and payload in octets (-2)BER length of the PDU contents (Auto; short form, below 128).
bodytlv — rest of the PDU4 itemsPDU contents as BER TLVs: request-id, error-status, error-index and the variable-bindings SEQUENCE.

pdu_type

ValueName
160 (0xa0)get_request
161 (0xa1)get_next_request
162 (0xa2)response
163 (0xa3)set_request
165 (0xa5)get_bulk_request
166 (0xa6)inform_request
167 (0xa7)snmpv2_trap
168 (0xa8)report

body

  • Type 8 bits, length 8 bits.
  • The length counts the value only.
  • Unknown types are kept as raw value octets.
TypeNameValue fieldsDescription
2 (0x02)integer
4 (0x04)octet_string
5 (0x05)null
6 (0x06)object_identifier
64 (0x40)ip_addressaddress
65 (0x41)counter32
66 (0x42)gauge32
67 (0x43)timeticks
68 (0x44)opaque
70 (0x46)counter64
128 (0x80)no_such_object
129 (0x81)no_such_instance
130 (0x82)end_of_mib_view
48 (0x30)sequenceitems

body › ip_address

FieldTypeDefaultAutoDescription
addressipv4

body › sequence

FieldTypeDefaultAutoDescription
itemstlv — rest of the PDU
body › sequence › items
  • Type 8 bits, length 8 bits.
  • The length counts the value only.
  • Unknown types are kept as raw value octets.
TypeNameValue fieldsDescription
2 (0x02)integer
4 (0x04)octet_string
5 (0x05)null
6 (0x06)object_identifier
64 (0x40)ip_addressaddress
65 (0x41)counter32
66 (0x42)gauge32
67 (0x43)timeticks
68 (0x44)opaque
70 (0x46)counter64
128 (0x80)no_such_object
129 (0x81)no_such_instance
130 (0x82)end_of_mib_view
48 (0x30)sequenceitems
body › sequence › items › ip_address
FieldTypeDefaultAutoDescription
addressipv4
body › sequence › items › sequence
FieldTypeDefaultAutoDescription
itemstlv — rest of the PDU

body › sequence › items › sequence › items

  • Type 8 bits, length 8 bits.
  • The length counts the value only.
  • Unknown types are kept as raw value octets.
TypeNameValue fieldsDescription
2 (0x02)integer
4 (0x04)octet_string
5 (0x05)null
6 (0x06)object_identifier
64 (0x40)ip_addressaddress
65 (0x41)counter32
66 (0x42)gauge32
67 (0x43)timeticks
68 (0x44)opaque
70 (0x46)counter64
128 (0x80)no_such_object
129 (0x81)no_such_instance
130 (0x82)end_of_mib_view

body › sequence › items › sequence › items › ip_address

FieldTypeDefaultAutoDescription
addressipv4

Next layer

The next layer is selected by pdu_type; when the field is Auto the builder writes the value of the protocol stacked above.

ValueProtocolNote
164 (0xa4)snmp_trapre-decodes this layer

Constraints

LevelRule
warningheader and payload at most 129 octets

Sample templates