home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / winh / winnt / mgmtapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-11  |  3.1 KB  |  109 lines

  1. /*++
  2.  
  3. Copyright (c) 1992-1995 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     mgmtapi.h
  8.  
  9. Abstract:
  10.  
  11.     Definitions for SNMP Management API Development.
  12.  
  13. --*/
  14.  
  15. #ifndef mgmtapi_h
  16. #define mgmtapi_h
  17.  
  18. // Necessary includes.
  19.  
  20. #include <winsock.h>
  21. #include <snmp.h>
  22.  
  23.  
  24. // Errors... (unique from those in snmp.h)
  25.  
  26. #define SNMP_MGMTAPI_TIMEOUT         40
  27. #define SNMP_MGMTAPI_SELECT_FDERRORS 41
  28. #define SNMP_MGMTAPI_TRAP_ERRORS     42
  29. #define SNMP_MGMTAPI_TRAP_DUPINIT    43
  30. #define SNMP_MGMTAPI_NOTRAPS         44
  31. #define SNMP_MGMTAPI_AGAIN           45
  32.  
  33. #define SNMP_MAX_OID_LEN     0x7f00 // Max number of elements in obj id
  34.  
  35. // Types...
  36.  
  37.  
  38. typedef SOCKET SockDesc;
  39.  
  40. #define RECVBUFSIZE 4096
  41.  
  42. typedef struct _SNMP_MGR_SESSION {
  43.     SockDesc        fd;                   // socket
  44.     struct sockaddr destAddr;             // destination agent address
  45.     LPSTR           community;            // community name
  46.     INT             timeout;              // comm time-out (milliseconds)
  47.     INT             retries;              // comm retry count
  48.     AsnInteger      requestId;            // RFC1157 requestId
  49.     char            recvBuf[RECVBUFSIZE]; // receive buffer
  50. } SNMP_MGR_SESSION, *LPSNMP_MGR_SESSION;
  51.  
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55.  
  56.  
  57. // Prototypes...
  58.  
  59. extern LPSNMP_MGR_SESSION
  60. SNMP_FUNC_TYPE SnmpMgrOpen(
  61.     IN LPSTR lpAgentAddress,    // Name/address of target SNMP agent
  62.     IN LPSTR lpAgentCommunity,  // Community for target SNMP agent
  63.     IN INT   nTimeOut,          // Communication time-out in milliseconds
  64.     IN INT   nRetries);         // Communication time-out/retry count
  65.  
  66. extern BOOL
  67. SNMP_FUNC_TYPE SnmpMgrClose(
  68.     IN LPSNMP_MGR_SESSION session);   // SNMP session pointer
  69.  
  70. extern SNMPAPI
  71. SNMP_FUNC_TYPE SnmpMgrRequest(
  72.     IN     LPSNMP_MGR_SESSION session,           // SNMP session pointer
  73.     IN     BYTE               requestType,       // Get, GetNext, or Set
  74.     IN OUT RFC1157VarBindList *variableBindings, // Varible bindings
  75.     OUT    AsnInteger         *errorStatus,      // Result error status
  76.     OUT    AsnInteger         *errorIndex);      // Result error index
  77.  
  78.  
  79. extern BOOL
  80. SNMP_FUNC_TYPE SnmpMgrStrToOid(
  81.     IN  LPSTR               string,   // OID string to be converted
  82.     OUT AsnObjectIdentifier *oid);    // OID internal representation
  83.  
  84. extern BOOL
  85. SNMP_FUNC_TYPE SnmpMgrOidToStr(
  86.     IN  AsnObjectIdentifier *oid,     // OID internal rep to be converted
  87.     OUT LPSTR               *string); // OID string representation
  88.  
  89.  
  90. extern BOOL
  91. SNMP_FUNC_TYPE SnmpMgrTrapListen(
  92.     OUT HANDLE *phTrapAvailable); // Event handle indicating trap(s) available
  93.  
  94. extern BOOL
  95. SNMP_FUNC_TYPE SnmpMgrGetTrap(
  96.     OUT AsnObjectIdentifier *enterprise,       // Generating enterprise
  97.     OUT AsnNetworkAddress   *IPAddress,        // Generating IP address
  98.     OUT AsnInteger          *genericTrap,      // Generic trap type
  99.     OUT AsnInteger          *specificTrap,     // Enterprise specific type
  100.     OUT AsnTimeticks        *timeStamp,        // Time stamp
  101.     OUT RFC1157VarBindList  *variableBindings);// Variable bindings
  102.  
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106.  
  107. #endif /* mgmtapi_h */
  108.  
  109.