The command responder: community-framed messages, PDU processing, and a fixed MIB. More...
#include "protocore_config.h"Go to the source code of this file.
The command responder: community-framed messages, PDU processing, and a fixed MIB.
The agent answers management requests against a fixed table of managed objects. Two framings reach the same table:
PDU processing is RFC 3416 sec 4.2: the GetRequest-PDU (sec 4.2.1), the GetNextRequest-PDU (sec 4.2.2), the GetBulkRequest-PDU (sec 4.2.3) and the SetRequest-PDU (sec 4.2.5), each answered by a Response-PDU (sec 4.2.4). The GetBulkRequest-PDU and the per-binding exceptions noSuchObject, noSuchInstance and endOfMibView belong to v2c and v3; v1 reports through error-status and error-index instead (RFC 1157 sec 4.1.1).
The MIB is a fixed table of SNMP_MAX_MIB_ENTRIES object instances, in BSS. A value is either held in the entry or fetched through a getter, as sysUpTime.0 is. String and OBJECT IDENTIFIER values are referenced by pointer and must outlive the agent.
Message processing is pure: request octets in, response octets out, no socket and no heap, so it is unit-tested with no network stack under it. RFC 3417 sec 3.2 suggests command responders listen on UDP port 161, which SnmpAgentNs::listen binds through the transport UDP service. SNMPv3 is the separate USM layer, reached through ::SnmpV3.
Definition in file snmp_agent.h.