|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
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:
Message ::= SEQUENCE { version version-1(0), community OCTET STRING, data ANY }. RFC 1157 sec 3.2.5 makes the community the whole of authentication: a message is authentic when it belongs to the community it names. RFC 1157 sec 4.1 says an entity that fails authentication notes the failure and discards the datagram, so an unknown community is answered with nothing at all.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.