home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / RTLWIN32.PAK / MGMTAPI.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  5.2 KB  |  146 lines

  1. /*++
  2.  
  3. Copyright (c) 1992-1996 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. /* $Copyright: 1997$ */
  16.  
  17. #ifndef _INC_MGMTAPI
  18. #define _INC_MGMTAPI
  19. #pragma option -b
  20.  
  21. ///////////////////////////////////////////////////////////////////////////////
  22. //                                                                           //
  23. // Additional header files                                                   //
  24. //                                                                           //
  25. ///////////////////////////////////////////////////////////////////////////////
  26.  
  27. #pragma option -b.
  28. #include <snmp.h>
  29. #pragma option -b
  30. #pragma option -b.
  31. #include <winsock.h>
  32. #pragma option -b
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. ///////////////////////////////////////////////////////////////////////////////
  39. //                                                                           //
  40. // MGMT API error code definitions                                           //
  41. //                                                                           //
  42. ///////////////////////////////////////////////////////////////////////////////
  43.  
  44. #define SNMP_MGMTAPI_TIMEOUT                40
  45. #define SNMP_MGMTAPI_SELECT_FDERRORS        41
  46. #define SNMP_MGMTAPI_TRAP_ERRORS            42
  47. #define SNMP_MGMTAPI_TRAP_DUPINIT           43
  48. #define SNMP_MGMTAPI_NOTRAPS                44
  49. #define SNMP_MGMTAPI_AGAIN                  45
  50.  
  51. ///////////////////////////////////////////////////////////////////////////////
  52. //                                                                           //
  53. // MGMT API miscellaneous definitions                                        //
  54. //                                                                           //
  55. ///////////////////////////////////////////////////////////////////////////////
  56.  
  57. #define RECVBUFSIZE                         4096
  58.  
  59. ///////////////////////////////////////////////////////////////////////////////
  60. //                                                                           //
  61. // MGMT API type definitions                                                 //
  62. //                                                                           //
  63. ///////////////////////////////////////////////////////////////////////////////
  64.  
  65. typedef SOCKET SockDesc;
  66.  
  67. typedef struct _SNMP_MGR_SESSION {
  68.     SockDesc        fd;                     // socket
  69.     struct sockaddr destAddr;               // destination agent address
  70.     LPSTR           community;              // community name
  71.     INT             timeout;                // comm time-out (milliseconds)
  72.     INT             retries;                // comm retry count
  73.     AsnInteger      requestId;              // RFC1157 requestId
  74.     char            recvBuf[RECVBUFSIZE];   // receive buffer
  75. } SNMP_MGR_SESSION, *LPSNMP_MGR_SESSION;
  76.  
  77. ///////////////////////////////////////////////////////////////////////////////
  78. //                                                                           //
  79. // MGMT API prototypes                                                       //
  80. //                                                                           //
  81. ///////////////////////////////////////////////////////////////////////////////
  82.  
  83. LPSNMP_MGR_SESSION
  84. SNMP_FUNC_TYPE
  85. SnmpMgrOpen(
  86.     IN LPSTR lpAgentAddress,                // Name/address of target agent
  87.     IN LPSTR lpAgentCommunity,              // Community for target agent
  88.     IN INT   nTimeOut,                      // Comm time-out in milliseconds
  89.     IN INT   nRetries                       // Comm time-out/retry count
  90.     );
  91.  
  92. BOOL
  93. SNMP_FUNC_TYPE
  94. SnmpMgrClose(
  95.     IN LPSNMP_MGR_SESSION session           // SNMP session pointer
  96.     );
  97.  
  98. SNMPAPI
  99. SNMP_FUNC_TYPE
  100. SnmpMgrRequest(
  101.     IN     LPSNMP_MGR_SESSION session,           // SNMP session pointer
  102.     IN     BYTE               requestType,       // Get, GetNext, or Set
  103.     IN OUT RFC1157VarBindList *variableBindings, // Varible bindings
  104.        OUT AsnInteger         *errorStatus,      // Result error status
  105.        OUT AsnInteger         *errorIndex        // Result error index
  106.     );
  107.  
  108. BOOL
  109. SNMP_FUNC_TYPE
  110. SnmpMgrStrToOid(
  111.     IN  LPSTR               string,         // OID string to be converted
  112.     OUT AsnObjectIdentifier *oid            // OID internal representation
  113.     );
  114.  
  115. BOOL
  116. SNMP_FUNC_TYPE
  117. SnmpMgrOidToStr(
  118.     IN  AsnObjectIdentifier *oid,           // OID to be converted
  119.     OUT LPSTR               *string         // OID string representation
  120.     );
  121.  
  122. BOOL
  123. SNMP_FUNC_TYPE
  124. SnmpMgrTrapListen(
  125.     OUT HANDLE *phTrapAvailable             // Event indicating trap available
  126.     );
  127.  
  128. BOOL
  129. SNMP_FUNC_TYPE
  130. SnmpMgrGetTrap(
  131.     OUT AsnObjectIdentifier *enterprise,         // Generating enterprise
  132.     OUT AsnNetworkAddress   *IPAddress,          // Generating IP address
  133.     OUT AsnInteger          *genericTrap,        // Generic trap type
  134.     OUT AsnInteger          *specificTrap,       // Enterprise specific type
  135.     OUT AsnTimeticks        *timeStamp,          // Time stamp
  136.     OUT RFC1157VarBindList  *variableBindings    // Variable bindings
  137.     );
  138.  
  139. #ifdef __cplusplus
  140. }
  141. #endif
  142.  
  143. #pragma option -b.
  144. #endif // _INC_MGMTAPI
  145.  
  146.