SNMP

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
SNMP

Simple Network Management Protocol V2c (community) agent implementation of RFC 3416.

Topics
Name 
Description 
Functions and variables accessible by the stack application 
Functions and variables internal to the SNMP module 
Functions and variables intended to be accessed only by the stack 
The following table lists functions in this documentation. 
The following table lists structs, records, enums in this documentation. 
The following table lists types in this documentation. 
The following table lists variables in this documentation. 
The following table lists macros in this documentation. 
The following table lists files in this documentation. 
Files
Name 
Description 
  • Simple Network Management Protocol (SNMP) Version 3 Agent

*

  • Module for Microchip TCP/IP Stack
  • -Provides SNMPv3 API for doing stuff

*

  • -Reference: RFCs 3410, 3411, 3412, 3413, 3414

 

  • Simple Network Management Protocol (SNMP) Version 3 Agent

*

  • Module for Microchip TCP/IP Stack
  • -Provides SNMPv3 API for doing stuff

*

  • -Reference: RFCs 3410, 3411, 3412, 3413, 3414

 

  • Simple Network Management Protocol (SNMP) Version 3 Agent

*

  • Module for Microchip TCP/IP Stack
  • -Provides SNMPv3 API for doing stuff

*

  • -Reference: RFCs 3410, 3411, 3412, 3413, 3414

 

  • Simple Network Management Protocol (SNMP) Version 1 Agent
  • Simple Network Management Protocol (SNMP) Version 2 community based Agent
  • Module for Microchip TCP/IP Stack
  • -Provides SNMP API for doing stuff

*

  • -Reference: RFC 1157 (for SNMP V1)
  • RFC 3416 (for SNMPv2C)

 

  • SNMP Defs for Microchip TCP/IP Stack

Functions
 
Name 
Description 
 
Decode variable length structure. 
 
Decode variable length structure. 
 
Verifies variable datatype as INT and retrieves its value. 
 
Finds number of varbinds in the varbind list received in a SNMPv3 pdu. 
 
Resolves generic trap code to generic trap OID. 
 
Verifies the value type as ASN_NULL
 
Populates OID type, length and oid string from the received pdu. 
 
Decode variable length structure. 
 
This routine process the SNMPv2c Get Bulk Request. 
 
Retrieves next node from the MIB database. 
 
Processes snmp Get request pdu. 
 
This routine processes the snmpv3 request and parallely creates the response pdu. 
 
To search for exact index node in case of a Sequence variable. 
 
Returns trap resolve get time. 
 
Used to Restrict the access dynamic and non dynamic OID string for A perticular SNMP Version. 
 
Validates the set variable data length to data type. 
 
Incoming SNMPv3 scoped PDU decryption using AES decryption protocol. 
 
outGoing SNMPv3 scoped PDU Encryption using AES encryption protocol. 
 
Authenticate an incoming SNMPV3 USM PDU using MD5 or SHA 
 
Authenticate to an outgoing SNMPV3 USM PDU using MD5 or SHA 
 
Pad zero to the authentication key localized buffer. 
 
Copies BYTE data to dynamically allocated memory buffer. 
 
Routine to find the index of the user name in the user data base table. 
 
Compute HMAC inner and outer pad for authorization localized key. 
 
Compute HMAC - MD5 authentication code 
 
Compute HMAC - SHA authentication code 
 
Compute HMAC - MD5 authentication code 
 
Compute HMAC - SHA authentication code 
 
Formulates the snmpEngineID for the SNMPV3 engine. 
 
Allocated dynamic memory freeing is done by this routine. 
 
Updates the snmp engine time variable 'snmpEngineTime' for the SNMPV3 engine. 
 
Reads BYTE data from dynamically allocated memory buffer. 
 
Get Security level from authentication and Privacy type. 
 
Routine to find the report, auth and privacy flags settings in the TRAP. 
 
SNMPv3 initialization. 
 
Intialize default SNMPv3 global user database. 
 
Decode variable length structure. 
 
Verifies variable datatype as INT and retrieves its value. 
 
This routine collects or populates the message processing model infomation from the received SNMPv3 request PDU or to the response PDU respectively. 
 
Creates and Sends SNMPv3 TRAP pdu. 
 
Convert MD5 Auth password to the localized Key using SNMPEngineID. 
 
Convert SHA Auth password to the localized Key using SNMPEngineID. 
 
Constructs the report pdu infomration for the Report Pdu. 
 
This routine collects the scoped pdu header information from the received SNMPv3 request PDU or populates to the response PDU respectively. 
 
Set snmpv3 error status in the response pdu. 
 
TRAP PDU scoped pdu header construction. 
 
This routine collects or populates the security model parametrs infomation from the received SNMPv3 request PDU or to the response PDU respectively. 
 
AES Encryption and decryption init vector.(RFC 3826 ) 
 
Both MD5 and SHA1 is used for the outgoing message authentication. 
 
SNMP USM out message uses Privacy protocol (RFC 3826 ) 
 
Convert Auth and Priv password to the localized Key using SNMPEngineID. 
 
Validate engine ID. 
 
Vaidate security name with Security level. 
 
Validate SNMPV3 user name or security name. 
Macros
 
Name 
Description 
 
SNMPv3 Authentication Localized passwed key lenegth size 
 
This is macro INVALID_INDEX. 
 
This is macro IS_SNMPV3_AUTH_STRUCTURE. 
 
Length of SNMPv3 authoratative msg header length = Header length ( 2 + 2 bytes) + engineID ( snmpEngnIDLength bytes)
  • engine boot( 4 bytes)+ engine time(4 bytes)

+security name (securityPrimitivesOfIncomingPdu value) +authentication parameters (snmpOutMsgAuthParamLen value) +privacy parameters (snmpOutMsgAuthParamLen value) 

 
Length of the SNMPv3 msg header(x) = Header length (2 bytes)
  • MSGID size (type(1 byte) + length of value(1 byte)+4 bytes value)
  • msgMAXSIZE(type + length of value +4 bytes value)
  • msg flag(type + length of value +1 byte value)
  • security model type(type + length of value +1 byte value)

 

 
#define PRIV_LOCALIZED_PASSWORD_KEY_LEN 16 SNMPv3 Privacy Pasword key length size 
 
This is macro REPORT_RESPONSE. 
 
SNMP_ENGINE_MAX_MSG_SIZE is determined as the minimum of the max msg size values supported among all of the transports available to and supported by the engine. 
 
SNMP MIN and MAX message 484 bytes in size As per RFC 3411 snmpEngineMaxMessageSize and RFC 1157 ( section 4- protocol specification ) and implementation supports more than 484 whenever feasible. 
 
This macro will be used to avoid SNMP OID memory buffer corruption 
 
This macro will be used to avoid SNMP OID memory buffer corruption 
 
This is macro SNMP_V3. 
 
SNMPv3 authentication localized Key length for memory validation 
 
This is macro SNMPV3_H. 
 
SNMPv3 privacy key length size for memory validation 
 
User security name length for memory validation 
 
User Security Model should have atleast 1 user. Default is 3. User should change as per the requirement. 
 
This is macro SNMPV3MSG_AUTHENTICATION_FAIL. 
 
This is macro SNMPV3MSG_AUTHENTICATION_SUCCESS. 
 
SNMPv3 User Security Name length 
Structs, Records, Enums
 
Name 
Description 
 
Applications are the typical clients of the service(s) of the Access Control Subsystem. The following primitive is provided by the Access Control Subsystem to check if access is allowed:
statusInformation = -- success or errorIndication 
 
Process Incoming Request or Notification PDU
Dispatcher provides the following primitive to pass an incoming snmp pdu to an application. 
 
Generate Outgoing Request or Notification
statusInformation = -- sendPduHandle if success -- errorIndication if failure 
 
Generate Outgoing Response
The PDU Dispatcher provides the following primitive for an application to return an SNMP Response PDU to the PDU Dispatcher:
result = SUCCESS or FAILURE 
 
Prepare Data Elements from an Incoming SNMP Message
The Message Processing Subsystem provides this service primitive for preparing the abstract data elements from an incoming SNMP message: result = -- SUCCESS or errorIndication 
 
Prepare Outgoing SNMP Request or Notification Message
The Message Processing Subsystem provides this service primitive for preparing an outgoing SNMP Request or Notification Message 
 
Prepare an Outgoing SNMP Response Message
The Message Processing Subsystem provides this service primitive for preparing an outgoing SNMP Response Message: result = -- SUCCESS or FAILURE 
 
Process Incoming Response PDU
The PDU Dispatcher provides the following primitive to pass an incoming SNMP Response PDU to an application: 
 
success or errorIndication 
 
This is record SecuritySysGenerateRequestMsg. 
 
Generate a Response Message
The Security Subsystem provides the following primitive to generate a Response message: 
 
Release State Reference Information
All Subsystems which pass stateReference information also provide a primitive to release the memory that holds the referenced state information 
 
This is record unregisterContextEngineID. 
Types
 
Name 
Description 
 
This is type INOUT_SNMP_PDU. 
 
This is type REPORT_FLAG_AND_SECURITY_LEVEL_FLAGS. 
 
This is type SecuritySysProcessIncomingMsg. 
 
The fifth octet indicates how the rest (6th and following octets) are formatted. Refer to RFC3411 section5 Page# 41 
 
This is type SNMPNONMIBRECDINFO. 
 
Type of hash being calculated 
 
This is type SNMPV3_MSG_AUTH_SEC_PARAM_RESULT. 
 
This is type SNMPV3_MSG_PRIV_SEC_PARAM_RESULT. 
 
This is type SNMPV3_PRIV_PROT_TYPE. 
 
This is type SNMPV3_REQUEST_WHOLEMSG. 
 
This is type SNMPV3_RESPONSE_WHOLEMSG. 
 
This is type snmpV3EngnUserDataBase. 
 
SNMPv3 
 
snmpv3 target configuration with respect to trap. 
 
success or errorIndication 
 
This is type STD_BASED_SNMP_MESSAGE_PROCESSING_MODEL. 
 
Snmp Message Processing Model 
 
This is type STD_BASED_SNMPV3_SECURITY_LEVEL. 
 
This is type USM_SECURITY_LEVEL. 
Variables
 
Name 
Description 
 
This is variable authKey_iPad. 
 
This is variable authKey_oPad. 
 
The number of times that the authoritative SNMP engine has (re-)initialized itself since its snmpEngineID was last configured. 
 
The number of seconds since the value of the authoritativeSnmpEngineBoots object last changed 
 
This is variable cipher_text. 
 
This is variable deciphered_text. 
 
This variable is used for gext next request for zero instance 
 
Dynamic memory stub and PDU details for Incoming stored PDU 
 
Dynamic memory stub details and constructed outgoing stored PDU details 
 
Response PDU construction offset details 
 
Offset to read scoped PDU data bytes for processing from dynamic memory stub 
 
Stored request scoped pdu details 
 
Processed response scoped pdu details 
 
SNMPv3 global configuration database to be used for trap notification 
 
TRAP message PDU header construction offset details 
 
Dynamic memory stub details and constructed trap PDU details 
 
TRAP scoped PDU construction offset details 
 
This is variable gSNMPV3TrapSecurityLevel. 
 
Index to the particular reference configured in User security model data base snmpV3UserDataBase
 
Global variable to find out how many times SNMPv3 engine id has been validated 
 
This is variable hmacAuthKeyBuf. 
 
This is variable HmacMd5Digest. 
 
This is variable HmacSHADigest. 
 
Incoming PDU details 
 
Retrived Incoming Msg ID value from PDU 
 
This is variable ivEncrptKeyOut. 
 
This is variable md5LocalizedAuthKey. 
 
This is variable msgSecrtyParamLenOffset. 
 
Incoming PDU Security primitive details. 
 
This is variable session_key. 
 
This is variable sha1LocalizedAuthKey. 
 
The number of times that the SNMP engine has (re-)initialized itself since snmpEngineID was last configured. 
 
Reserving 32 bytes for the snmpEngineID as the octet string length can vary form 5 to 32 
 
The maximum message size the SNMP engine can handle. 
 
Type of Message processing model used. Value Maximum range (2^31-1), RFC3411 
 
Type of security model used. Value Maximum range (2^31-1), RFC3411 
 
The number of seconds since the value of the snmpEngineBoots object last changed 
 
Stores the time value in seconds since SNMP Engine reset 
 
Engine ID length of the SNMP Engine 
 
Incoming SNMPv3 msg authentication parameters string is 12 bytes long. 
 
Reserving 12 bytes for the incoming SNMPv3 msg authentication parameters. 
 
Incoming SNMPv3 msg privacy parameters string is 8 bytes long. 
 
Reserving 8 bytes for the incoming SNMPv3 msg privacy parameters. 
 
Offset to read PDU data bytes for processing from dynamic memory stub 
 
Outgoing SNMPv3 msg authentication parameters string is 12 bytes long. 
 
Reserving 12 bytes for the outgoing SNMPv3 msg authentication parameters. 
 
Outgoing SNMPv3 msg privacy parameters string is 8 bytes long. 
 
Reserving 8 bytes for the outgoing SNMPv3 msg privacy parameters. 
 
Type of Security for outgoing message in response to the incoming message. 
 
Type of security. noAuthNoPriv(0),AuthNoPriv(1),AuthPriv(3) 
 
This is variable snmpTrapTimer. 
 
128 Bit 
 
128 Bit 
 
This is variable snmpV3UserDataBase. 
Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.