4.6   Method Routines

Method routines are sections of code which perform the actions specified by SNMP directives, such as retrieving or setting the value of a certain variable (a GET or SET routine, respectively).

The design of method routines must be based on the variables which the routines view and alter. mibcomp, the provided MIB compiler, can produce a "stub", a set of code which a designer can use as a starting point for creating method routines. For more information, see 6.3 Compile-time MIB Extensions, and A. The MIB Compiler User's Guide. Also see the section on m2Lib in the VxWorks Reference Manual.

Method routines can be written to behave asynchronously from the SNMP agent. In this case, the method routine spawns a task to complete the requested activities, and the method routine returns before the task completes. For more information, see 6.5 Asynchronous Method Routines.


*   

NOTE: The processing of a single message from an SNMP master may require the execution of several method routines. As mentioned above, it is possible for the SNMP agent to run these method routines asynchronously. However, this does not make the SNMP agent asynchronous with respect to the SNMP manager. The SNMP agent processes messages from the SNMP manager synchronously. Thus, it does not accept a new message until it has completed processing for the last message.