O'Reilly logo

Network Management, MIBs and MPLS: Principles, Design and Implementation by Stephen B. Morris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required