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