Platform SDK: Network Management |
The following table summarizes the basic programming procedures that you must perform to code a WinSNMP application, and the topics that provide information about these tasks.
Programming task | Task-related function and topics |
---|---|
Open the WinSNMP application. | Use SnmpStartup. |
Open one or more WinSNMP sessions. | Use SnmpCreateSession. |
Register to receive traps or notifications. | Use SnmpRegister. |
Create one or more variable binding lists for incorporation in a PDU. | Use SnmpCreateVbl, SnmpDuplicateVbl, SnmpSetVb.
See Working with Variable Binding Lists. Note: The application may need to call other variable binding functions to create the variable binding list. |
Create one or more PDUs for transmission and processing. | Use SnmpCreatePDU, SnmpSetPduData, SnmpDuplicatePDU.
See Working with Protocol Data Units. Note: The application may need to call other PDU functions and WinSNMP utility functions to create the PDU. |
Submit one or more SNMP operation requests. | Use SnmpSendMsg. |
Retrieve the response to the SNMP operation request. | Use SnmpRecvMsg. |
Process the request response. | Use application-specific logic. |
Close each WinSNMP session. | Use SnmpClose. |
Close the WinSNMP application. | Use SnmpCleanup. |
The following topics contain additional information about other general programming concepts specific to the WinSNMP environment.
General programming tasks | Managing Object Identifiers
Setting the Entity and Context Translation Mode Managing the Retransmission Policy |
In addition, the WinSNMP application may need to incorporate calls to the following WinSNMP functions: SnmpFreeVbl, SnmpFreeEntity, SnmpFreeDescriptor, SnmpFreeContext, and SnmpFreePdu. This enables the Microsoft WinSNMP implementation to free WinSNMP memory objects. As a general rule, the WinSNMP application should free all resources allocated as the result of a call to a WinSNMP function. For additional information about deallocating resources, see Allocating WinSNMP Memory Objects.