D.1 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; AsnAny retrievedInstanceValue; INT timeout = TIMEOUT; INT retries = RETRIES; BYTE requestType; AsnInteger errorStatus, errorIndex; /****************** SECTION 3 ******************/ int allocateResources(LPSTR agentName, LPSTR community,                 char *objectIdentifier); int deallocateResources(); int prepareDataForOperation(enum Operations reqOperation,                  unsigned char *newObjectValue); int prepareSetOperation(unsigned char *newObjectValue); int prepareGetOperation(); int prepareGetNextOperation(); int dispatchOperation(int programMode, char * argumentVector[]); int createSNMPSession(); int executeRequest(); int displayMIBInstanceValue(); int doSnmpOperation(enum Operations reqOperation, LPSTR agentName,                 LPSTR community, char *objectIdentifier, char *objectValue); int executeMibWalk(); int waitForTraps(); int startupRoutine(int argc, char *argv []); 


Network Management, MIBs and MPLS
Network Management, MIBs and MPLS: Principles, Design and Implementation
ISBN: 0131011138
EAN: 2147483647
Year: 2003
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net