⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc3412.txt

📁 开发snmp的开发包有两个开放的SNMP开发库
💻 TXT
📖 第 1 页 / 共 5 页
字号:
   applications.  The Dispatcher does not use the value of pduVersion   directly.Case, et al.                Standards Track                     [Page 6]RFC 3412      Message Processing and Dispatching for SNMP  December 2002   An application specifies the pduVersion when it requests the PDU   Dispatcher to send a PDU to another SNMP engine.  The Dispatcher   passes the pduVersion to a Message Processing Model, so it knows how   to handle the PDU properly.   For incoming messages, the pduVersion is provided to the Dispatcher   by a version-specific Message Processing module.  The PDU Dispatcher   passes the pduVersion to the application so it knows how to handle   the PDU properly.  For example, a command responder application needs   to know whether to use [RFC3416] elements of procedure and syntax   instead of those specified for SNMPv1.3.3.  pduType   A value of the pduType represents a specific type of protocol   operation.  The values of the pduType are specific to the version of   the PDU contained in a message.   Applications register to support particular pduTypes for particular   contextEngineIDs.   For incoming messages, pduType is provided to the Dispatcher by a   version-specific Message Processing module.  It is subsequently used   to dispatch the PDU to the application which registered for the   pduType for the contextEngineID of the associated scopedPDU.3.4.  sendPduHandle   This handle is generated for coordinating the processing of requests   and responses between the SNMP engine and an application.  The handle   must be unique across all version-specific Message Processing Models,   and is of local significance only.4.  Dispatcher Elements of Procedure   This section describes the procedures followed by the Dispatcher when   generating and processing SNMP messages.4.1.  Sending an SNMP Message to the Network   This section describes the procedure followed by an SNMP engine   whenever it sends an SNMP message.Case, et al.                Standards Track                     [Page 7]RFC 3412      Message Processing and Dispatching for SNMP  December 20024.1.1.  Sending a Request or Notification   The following procedures are followed by the Dispatcher when an   application wants to send an SNMP PDU to another (remote)   application, i.e., to initiate a communication by originating a   message, such as one containing a request or a notification.   1) The application requests this using the abstract service      primitive:      statusInformation =              -- sendPduHandle if success                                       -- errorIndication if failure        sendPdu(        IN   transportDomain           -- transport domain to be used        IN   transportAddress          -- destination network address        IN   messageProcessingModel    -- typically, SNMP version        IN   securityModel             -- Security Model to use        IN   securityName              -- on behalf of this principal        IN   securityLevel             -- Level of Security requested        IN   contextEngineID           -- data from/at this entity        IN   contextName               -- data from/in this context        IN   pduVersion                -- the version of the PDU        IN   PDU                       -- SNMP Protocol Data Unit        IN   expectResponse            -- TRUE or FALSE             )   2) If the messageProcessingModel value does not represent a Message      Processing Model known to the Dispatcher, then an errorIndication      (implementation-dependent) is returned to the calling application.      No further processing is performed.   3) The Dispatcher generates a sendPduHandle to coordinate subsequent      processing.Case, et al.                Standards Track                     [Page 8]RFC 3412      Message Processing and Dispatching for SNMP  December 2002   4) The Message Dispatcher sends the request to the version-specific      Message Processing module identified by messageProcessingModel      using the abstract service primitive:      statusInformation =              -- success or error indication        prepareOutgoingMessage(        IN   transportDomain           -- as specified by application        IN   transportAddress          -- as specified by application        IN   messageProcessingModel    -- as specified by application        IN   securityModel             -- as specified by application        IN   securityName              -- as specified by application        IN   securityLevel             -- as specified by application        IN   contextEngineID           -- as specified by application        IN   contextName               -- as specified by application        IN   pduVersion                -- as specified by application        IN   PDU                       -- as specified by application        IN   expectResponse            -- as specified by application        IN   sendPduHandle             -- as determined in step 3.        OUT  destTransportDomain       -- destination transport domain        OUT  destTransportAddress      -- destination transport address        OUT  outgoingMessage           -- the message to send        OUT  outgoingMessageLength     -- the message length             )   5) If the statusInformation indicates an error, the errorIndication      is returned to the calling application.  No further processing is      performed.   6) If the statusInformation indicates success, the sendPduHandle is      returned to the application, and the outgoingMessage is sent.  The      transport used to send the outgoingMessage is returned via      destTransportDomain, and the address to which it was sent is      returned via destTransportAddress.   Outgoing Message Processing is complete.4.1.2.  Sending a Response to the Network   The following procedure is followed when an application wants to   return a response back to the originator of an SNMP Request.Case, et al.                Standards Track                     [Page 9]RFC 3412      Message Processing and Dispatching for SNMP  December 2002   1) An application can request this using the abstract service      primitive:      result =      returnResponsePdu(       IN   messageProcessingModel   -- typically, SNMP version       IN   securityModel            -- Security Model in use       IN   securityName             -- on behalf of this principal       IN   securityLevel            -- same as on incoming request       IN   contextEngineID          -- data from/at this SNMP entity       IN   contextName              -- data from/in this context       IN   pduVersion               -- the version of the PDU       IN   PDU                      -- SNMP Protocol Data Unit       IN   maxSizeResponseScopedPDU -- maximum size of Response PDU       IN   stateReference           -- reference to state information                                     -- as presented with the request       IN   statusInformation        -- success or errorIndication       )                             -- (error counter OID and value                                     -- when errorIndication)   2) The Message Dispatcher sends the request to the appropriate      Message Processing Model indicated by the received value of      messageProcessingModel using the abstract service primitive:      result =                       -- SUCCESS or errorIndication       prepareResponseMessage(       IN   messageProcessingModel   -- specified by application       IN   securityModel            -- specified by application       IN   securityName             -- specified by application       IN   securityLevel            -- specified by application       IN   contextEngineID          -- specified by application       IN   contextName              -- specified by application       IN   pduVersion               -- specified by application       IN   PDU                      -- specified by application       IN   maxSizeResponseScopedPDU -- specified by application       IN   stateReference           -- specified by application       IN   statusInformation        -- specified by application       OUT  destTransportDomain      -- destination transport domain       OUT  destTransportAddress     -- destination transport address       OUT  outgoingMessage          -- the message to send       OUT  outgoingMessageLength    -- the message length            )   3) If the result is an errorIndication, the errorIndication is      returned to the calling application.  No further processing is      performed.Case, et al.                Standards Track                    [Page 10]RFC 3412      Message Processing and Dispatching for SNMP  December 2002   4) If the result is success, the outgoingMessage is sent.  The      transport used to send the outgoingMessage is returned via      destTransportDomain, and the address to which it was sent is      returned via destTransportAddress.   Message Processing is complete.4.2.  Receiving an SNMP Message from the Network   This section describes the procedure followed by an SNMP engine   whenever it receives an SNMP message.   Please note, that for the sake of clarity and to prevent the text   from being even longer and more complicated, some details were   omitted from the steps below.  In particular, the elements of   procedure do not always explicitly indicate when state information   needs to be released.  The general rule is that if state information   is available when a message is to be "discarded without further   processing", then the state information must also be released at that   same time.4.2.1.  Message Dispatching of received SNMP Messages   1) The snmpInPkts counter [RFC3418] is incremented.   2) The version of the SNMP message is determined in an      implementation-dependent manner.  If the packet cannot be      sufficiently parsed to determine the version of the SNMP message,      then the snmpInASNParseErrs [RFC3418] counter is incremented, and      the message is discarded without further processing.  If the      version is not supported, then the snmpInBadVersions [RFC3418]      counter is incremented, and the message is discarded without      further processing.   3) The origin transportDomain and origin transportAddress are      determined.Case, et al.                Standards Track                    [Page 11]RFC 3412      Message Processing and Dispatching for SNMP  December 2002   4) The message is passed to the version-specific Message Processing      Model which returns the abstract data elements required by the      Dispatcher.  This is performed using the abstract service      primitive:      result =                        -- SUCCESS or errorIndication        prepareDataElements(        IN   transportDomain          -- origin as determined in step 3.        IN   transportAddress         -- origin as determined in step 3.        IN   wholeMsg                 -- as received from the network        IN   wholeMsgLength           -- as received from the network        OUT  messageProcessingModel   -- typically, SNMP version        OUT  securityModel            -- Security Model specified        OUT  securityName             -- on behalf of this principal        OUT  securityLevel            -- Level of Security specified        OUT  contextEngineID          -- data from/at this entity        OUT  contextName              -- data from/in this context        OUT  pduVersion               -- the version of the PDU        OUT  PDU                      -- SNMP Protocol Data Unit        OUT  pduType                  -- SNMP PDU type        OUT  sendPduHandle            -- handle for a matched request        OUT  maxSizeResponseScopedPDU -- maximum size of Response PDU        OUT  statusInformation        -- success or errorIndication                                      -- (error counter OID and value                                      -- when errorIndication)        OUT  stateReference           -- reference to state information                                      -- to be used for a possible             )                        -- Response   5) If the result is a FAILURE errorIndication, the message is      discarded without further processing.   6) At this point, the abstract data elements have been prepared and      processing continues as described in Section 4.2.2, PDU

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -