Download Simple Network Management Protocol (SNMP)
Transcript
SNMP Reference Manual
snmp pdus
snmp pdus
Erlang Module
RFC1157, RFC1905 and/or RFC2272 should be studied carefully before using this
module, snmp pdus.
The module snmp pdus contains functions for encoding and decoding of SNMP
protocol data units (PDUs). In short, this module converts a list of bytes to Erlang
record representations and vice versa. The record definitions can be found in the file
snmp/include/snmp types.hrl. If snmpv3 is used, the module that includes
snmp types.hrl must define the constant SNMP USE V3 before the header file is
included. Example:
-define(SNMP USE V3, true).
-include lib("snmp/include/snmp types.hrl").
Encoding and decoding must be done explicitly when writing your own Net if process.
Exports
dec message([byte()]) -> Message
Types:
Message = #message
Decodes a list of bytes into an SNMP Message. Note, if there is a v3 message, the
msgSecurityParameters are not decoded. They must be explicitly decoded by a call to
a security model specific decoding function, e.g. dec usm security parameters/1.
Also note, if the scopedPDU is encrypted, the OCTET STRING encoded encryptedPDU
will be present in the data field.
dec message only([byte()]) -> Message
Types:
Message = #message
Decodes a list of bytes into an SNMP Message, but does not decode the data part of the
Message. That means, data is still a list of bytes, normally an encoded PDU (v1 and V2)
or an encoded and possibly encrypted scopedPDU (v3).
dec pdu([byte()]) -> Pdu
Types:
Pdu = #pdu
Decodes a list of bytes into an SNMP Pdu.
Simple Network Management Protocol (SNMP)
137