SnmpKit.SnmpLib.PDU.Constants (snmpkit v0.6.4)
Constants and type definitions for SNMP PDU operations.
This module contains all ASN.1 tags, error codes, type definitions, and utility functions used throughout the SNMP PDU system.
Summary
Functions
Decodes SNMPv3 message flags from binary format.
Creates default SNMPv3 message flags for a security level.
Encodes SNMPv3 message flags to binary format.
Converts an error status code to its atom representation.
Converts an error status atom to its numeric code.
Normalizes an SNMP type atom.
Types
@type base_pdu() :: %{ type: pdu_type(), request_id: non_neg_integer(), error_status: error_status(), error_index: non_neg_integer(), varbinds: [varbind()] }
@type bulk_pdu() :: %{ type: :get_bulk_request, request_id: non_neg_integer(), error_status: error_status(), error_index: non_neg_integer(), varbinds: [varbind()], non_repeaters: non_neg_integer(), max_repetitions: non_neg_integer() }
@type error_status() :: 0..5
@type message() :: v1v2c_message() | v3_message()
@type oid() :: [non_neg_integer()] | binary()
@type pdu_type() ::
:get_request
| :get_next_request
| :get_response
| :set_request
| :get_bulk_request
@type snmp_type() ::
:integer
| :octet_string
| :null
| :object_identifier
| :counter32
| :gauge32
| :timeticks
| :counter64
| :ip_address
| :opaque_type
| :no_such_object
| :no_such_instance
| :end_of_mib_view
@type snmp_value() :: any()
@type snmp_version() :: :v1 | :v2c | :v2 | :v3 | 0 | 1 | 3
@type v1v2c_message() :: %{ version: snmp_version() | non_neg_integer(), community: binary(), pdu: pdu() }
@type v3_message() :: %{ version: 3, msg_id: non_neg_integer(), msg_max_size: non_neg_integer(), msg_flags: binary(), msg_security_model: non_neg_integer(), msg_security_parameters: binary(), msg_data: scoped_pdu() }
@type varbind() :: {oid(), atom(), snmp_value()}
Functions
Decodes SNMPv3 message flags from binary format.
Creates default SNMPv3 message flags for a security level.
Encodes SNMPv3 message flags to binary format.
@spec error_status_to_atom(non_neg_integer()) :: atom()
Converts an error status code to its atom representation.
@spec error_status_to_code(atom()) :: non_neg_integer()
Converts an error status atom to its numeric code.
Normalizes an SNMP type atom.