|
|
1.1 ! root 1: /*++ BUILD Version: 0001 // Increment this if a change has global effects ! 2: ! 3: Copyright (c) 1992, Microsoft Corporation ! 4: ! 5: Module Name: ! 6: ! 7: mgmtapi.h ! 8: ! 9: Abstract: ! 10: ! 11: Definitions for SNMP Management API Development. ! 12: ! 13: ! 14: This PRE-RELEASE header file contains definitions that may change ! 15: prior to the official release of Windows NT. Microsoft makes no ! 16: warranty of any kind as to the suitability or correctness of this ! 17: code. ! 18: ! 19: ! 20: --*/ ! 21: ! 22: #ifndef mgmtapi_h ! 23: #define mgmtapi_h ! 24: ! 25: static char *mgmtapi__h = "@(#) $Logfile: N:/agent/mgmtapi/vcs/mgmtapi.h_v $ $Revision: 1.5 $"; ! 26: ! 27: ! 28: // Necessary includes. ! 29: ! 30: #include <winsock.h> ! 31: #include <snmp.h> ! 32: ! 33: ! 34: // Errors... (unique from those in snmp.h) ! 35: ! 36: #define SNMP_MGMTAPI_TIMEOUT 40 ! 37: #define SNMP_MGMTAPI_SELECT_FDERRORS 41 ! 38: #define SNMP_MGMTAPI_TRAP_ERRORS 42 ! 39: #define SNMP_MGMTAPI_TRAP_DUPINIT 43 ! 40: #define SNMP_MGMTAPI_NOTRAPS 44 ! 41: #define SNMP_MGMTAPI_AGAIN 45 ! 42: ! 43: #define SNMP_MAX_OID_LEN 0x7f00 // Max number of elements in obj id ! 44: ! 45: // Types... ! 46: ! 47: ! 48: typedef SOCKET SockDesc; ! 49: ! 50: #define RECVBUFSIZE 4096 ! 51: ! 52: typedef struct _SNMP_MGR_SESSION { ! 53: SockDesc fd; // socket ! 54: struct sockaddr destAddr; // destination agent address ! 55: LPSTR community; // community name ! 56: INT timeout; // comm time-out (milliseconds) ! 57: INT retries; // comm retry count ! 58: AsnInteger requestId; // RFC1157 requestId ! 59: char recvBuf[RECVBUFSIZE]; // receive buffer ! 60: } SNMP_MGR_SESSION, *LPSNMP_MGR_SESSION; ! 61: ! 62: ! 63: // Prototypes... ! 64: ! 65: LPSNMP_MGR_SESSION ! 66: SNMP_FUNC_TYPE SnmpMgrOpen( ! 67: IN LPSTR lpAgentAddress, // Name/address of target SNMP agent ! 68: IN LPSTR lpAgentCommunity, // Community for target SNMP agent ! 69: IN INT nTimeOut, // Communication time-out in milliseconds ! 70: IN INT nRetries); // Communication time-out/retry count ! 71: ! 72: BOOL ! 73: SNMP_FUNC_TYPE SnmpMgrClose( ! 74: IN LPSNMP_MGR_SESSION session); // SNMP session pointer ! 75: ! 76: SNMPAPI ! 77: SNMP_FUNC_TYPE SnmpMgrRequest( ! 78: IN LPSNMP_MGR_SESSION session, // SNMP session pointer ! 79: IN BYTE requestType, // Get, GetNext, or Set ! 80: IN OUT RFC1157VarBindList *variableBindings, // Varible bindings ! 81: OUT AsnInteger *errorStatus, // Result error status ! 82: OUT AsnInteger *errorIndex); // Result error index ! 83: ! 84: ! 85: BOOL ! 86: SNMP_FUNC_TYPE SnmpMgrStrToOid( ! 87: IN LPSTR string, // OID string to be converted ! 88: OUT AsnObjectIdentifier *oid); // OID internal representation ! 89: ! 90: BOOL ! 91: SNMP_FUNC_TYPE SnmpMgrOidToStr( ! 92: IN AsnObjectIdentifier *oid, // OID internal rep to be converted ! 93: OUT LPSTR *string); // OID string representation ! 94: ! 95: ! 96: BOOL ! 97: SNMP_FUNC_TYPE SnmpMgrTrapListen( ! 98: OUT HANDLE *phTrapAvailable); // Event handle indicating trap(s) available ! 99: ! 100: BOOL ! 101: SNMP_FUNC_TYPE SnmpMgrGetTrap( ! 102: OUT AsnObjectIdentifier *enterprise, // Generating enterprise ! 103: OUT AsnNetworkAddress *IPAddress, // Generating IP address ! 104: OUT AsnInteger *genericTrap, // Generic trap type ! 105: OUT AsnInteger *specificTrap, // Enterprise specific type ! 106: OUT AsnTimeticks *timeStamp, // Time stamp ! 107: OUT RFC1157VarBindList *variableBindings);// Variable bindings ! 108: ! 109: ! 110: #endif /* mgmtapi_h */ ! 111:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.