📄 rfc2257.txt
字号:
v.name in these cases.
Note that the VarBind itself does not contain the value size.
That information is implied for the fixed-length types, and
explicitly contained in the encodings of variable-length types
(Object Identifier and Octet String).
A VarBindList is a contiguous list of VarBinds. Within a
VarBindList, a particular VarBind is identified by an index value.
The first VarBind in a VarBindList has index value 1, the second
has index value 2, and so on.
6. Protocol Definitions
6.1. AgentX PDU Header
该agentx的PDU头是一个固定的格式, 20个八位组的结构体:
The AgentX PDU header is a fixed-format, 20-octet structure:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| h.version | h.type | h.flags | <reserved> |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| h.sessionID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| h.transactionID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| h.packetID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| h.payload_length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
An AgentX PDU header contains the following fields:
h.version
agentx协议的版本号。
The version of the AgentX protocol (1 for this memo).
Daniele, et. al. Standards Track [Page 16]
RFC 2257 AgentX January 1998
h.type
PDU类型下列值中其一。
The PDU type; one of the following values:
agentx-Open-PDU (1),
agentx-Close-PDU (2),
agentx-Register-PDU (3),
agentx-Unregister-PDU (4),
agentx-Get-PDU (5),
agentx-GetNext-PDU (6),
agentx-GetBulk-PDU (7),
agentx-TestSet-PDU (8),
agentx-CommitSet-PDU (9),
agentx-UndoSet-PDU (10),
agentx-CleanupSet-PDU (11),
agentx-Notify-PDU (12),
agentx-Ping-PDU (13),
agentx-IndexAllocate-PDU (14),
agentx-IndexDeallocate-PDU (15),
agentx-AddAgentCaps-PDU (16),
agentx-RemoveAgentCaps-PDU (17),
agentx-Response-PDU (18)
h.flags
A bitmask, with bit 0 the least significant bit. The bit
definitions are as follows:
Bit Definition
--- ----------
0 INSTANCE_REGISTRATION
1 NEW_INDEX
2 ANY_INDEX
3 NON_DEFAULT_CONTEXT
4 NETWORK_BYTE_ORDER
5-7 (reserved)
The NETWORK_BYTE_ORDER bit applies to all multi-byte integer
values in the entire AgentX packet, including the remaining
header fields. If set, then network byte order (most
significant byte first; "big endian") is used. If not set,
then least significant byte first ("little endian") is used.
The NETWORK_BYTE_ORDER bit applies to all AgentX PDUs.
The NON_DEFAULT_CONTEXT bit is used only in the AgentX PDUs
described in section 6.1.1.
Daniele, et. al. Standards Track [Page 17]
RFC 2257 AgentX January 1998
The NEW_INDEX and ANY_INDEX bits are used only within the
agentx-IndexAllocate-, and -IndexDeallocate-PDUs.
The INSTANCE_REGISTRATION bit is used only within the agentx-
Register-PDU.
h.sessionID
The session ID uniquely identifies a session over which AgentX
PDUs are exchanged between a subagent and the master agent.
The session ID has no significance and no defined value in the
agentx-Open-PDU sent by a subagent to open a session with the
master agent; in this case, the master agent will assign a
unique sessionID that it will pass back in the corresponding
agentx-Response-PDU. From that point on, that same sessionID
will appear in every AgentX PDU exchanged over that session
between the master and the subagent. A subagent may establish
multiple AgentX sessions by sending multiple agentx-Open-PDUs
to the master agent.
In master agents that support multiple transport protocols, the
sessionID should be globally unique rather than unique just to
a particular transport.
h.transactionID
事物ID对于一个给定的session是个一个唯一的标识,单纯的SNMP管理请求同AgentX PDU是相互联系的,如果一个单一的SNMP管理请求结果以多AgentX PDUs被主机发送通过相同的sessionID,那么这些AgentX PDUs必须包含相同的transaction ID,相反的AgentX PDUs在一个特别的session期间发送,那么来自不同SNMP管理请求的结果必须有不同的事物ID并且有32bit空间的大小限制。注意事物ID不能同SNMP PDU's request-id相同,也不能一个主机代理收到的来自不同的管理员的SNMP请求与request-ids相同。 事物ID在AgentX administrative PDUs中没有实际意义也没有定义的值,AgentX PDUs与一个SNMP管理请求没有关系。
The transaction ID uniquely identifies, for a given session,
the single SNMP management request (and single SNMP PDU) with
which an AgentX PDU is associated. If a single SNMP management
request results in multiple AgentX PDUs being sent by the
master agent with the same sessionID, each of these AgentX PDUs
must contain the same transaction ID; conversely, AgentX PDUs
sent during a particular session, that result from distinct
SNMP management requests, must have distinct transaction IDs
within the limits of the 32-bit field).
Note that the transaction ID is not the same as the SNMP PDU's
request-id (as described in section 4.1 of RFC 1905 [4]), nor
can it be, since a master agent might receive SNMP requests
with the same request-ids from different managers.
The transaction ID has no significance and no defined value in
AgentX administrative PDUs, i.e., AgentX PDUs that are not
associated with an SNMP management request.
Daniele, et. al. Standards Track [Page 18]
RFC 2257 AgentX January 1998
h.packetID
A packet ID generated by the sender for all AgentX PDUs except
the agentx-Response-PDU. In an agentx-Response-PDU, the packet
ID must be the same as that in the received AgentX PDU to which
it is a response. A master agent might use this field to
associate subagent response PDUs with their corresponding
request PDUs. A subagent might use this field to correlate
responses to multiple (batched) registrations.
h.payload_length
The size in octets of the PDU contents, excluding the 20-byte
header. As a result of the encoding schemes and PDU layouts,
this value will always be either 0, or a multiple of 4.
6.1.1. Context
In the SNMPv1 or v2c frameworks, the community string may be used as
an index into a local repository of configuration information that
may include community profiles or more complex context information.
Future versions of the SNMP will likely formalize this notion of
"context".
AgentX provides a mechanism for transmitting a context specification
within relevant PDUs, but does not place any constraints on the
content of that specification.
An optional context field may be present in the agentx-Register-,
UnRegister-, AddAgentCaps-, RemoveAgentCaps-, Get-, GetNext-,
GetBulk-, IndexAllocate-, IndexDeallocate-, Notify-, TestSet-, and
Ping- PDUs.
If the NON_DEFAULT_CONTEXT bit in the AgentX header field h.flags is
clear, then there is no context field in the PDU, and the operation
refers to the default context.
If the NON_DEFAULT_CONTEXT bit is set, then a context field
immediately follows the AgentX header, and the operation refers to
that specific context. The context is represented as an Octet
String. There are no constraints on its length or contents.
Thus, all of these AgentX PDUs (that is, those listed immediately
above) refer to, or "indicate" a context, which is either the default
context, or a non-default context explicitly named in the PDU.
Daniele, et. al. Standards Track [Page 19]
RFC 2257 AgentX January 1998
6.2. AgentX PDUs
6.2.1. The agentx-Open-PDU
An agentx-Open-PDU is generated by a subagent to request
establishment of an AgentX session with the master agent.
(AgentX header)
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| h.version (1) | h.type (1) | h.flags | <reserved> |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| h.sessionID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| h.transactionID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| h.packetID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| h.payload_length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| o.timeout | <reserved> |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
(o.id)
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| n_subid | prefix | 0 | <reserved> |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| subidentifier #1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| subidentifier #n_subid |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
(o.descr)
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Octet String Length (L) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Octet 1 | Octet 2 | Octet 3 | Octet 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Octet L - 1 | Octet L | Padding (as required) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
An agentx-Open-PDU contains the following fields:
Daniele, et. al. Standards Track [Page 20]
RFC 2257 AgentX January 1998
o.timeout
The length of time, in seconds, that a master agent should
allow to elapse after dispatching a message to a subagent
before it regards the subagent as not responding. This is a
subagent-wide default value that may be overridden by values
associated with specific registered MIB regions. The default
value of 0 indicates that no subagent-wide value is requested.
o.id
An Object Identifier that identifies the subagent. Subagents
that do not support such an notion may send a null Object
Identifier.
o.descr
An Octet String containing a DisplayString describing the
subagent.
6.2.2. The agentx-Close-PDU
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -