Appendix D. Visual C++ Sample Program Source Code

This appendix provides a listing of the Visual C++ sample program source code.

snmpdefs.h

This is the header file that provides symbolic constants and function declarations for the main C file.

 /****************** SECTION 1 ******************/ #define TIMEOUT 6000 /* milliseconds */ #define RETRIES 3 #define MAX_OID_NAME_LENGTH 50 #define FUNCTION_SUCCESS 0 #define FUNCTION_FAILED -1 enum Operations { GET, GETNEXT, SET, WALK, TRAP }; char * operationsArray[5] = { "GET", "GETNEXT", "SET", "WALK", "TRAP" }; /****************** SECTION 2 ******************/ INT programMode, operation; LPSTR SNMPAgentName, SNMPCommunity, OIDstring; RFC1157VarBindList variableBindings; LPSNMP_MGR_SESSION SNMPsession; ...

Get Network Management, MIBs and MPLS: Principles, Design and Implementation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.