home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / mgmtapi.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  5KB  |  132 lines

  1. /*++
  2.  
  3. Copyright 1992 - 1998 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 type definitions                                                 //
  47. //                                                                           //
  48. ///////////////////////////////////////////////////////////////////////////////
  49.  
  50. typedef PVOID LPSNMP_MGR_SESSION;
  51.  
  52. ///////////////////////////////////////////////////////////////////////////////
  53. //                                                                           //
  54. // MGMT API prototypes                                                       //
  55. //                                                                           //
  56. ///////////////////////////////////////////////////////////////////////////////
  57.  
  58. LPSNMP_MGR_SESSION
  59. SNMP_FUNC_TYPE
  60. SnmpMgrOpen(
  61.     IN LPSTR lpAgentAddress,                // Name/address of target agent
  62.     IN LPSTR lpAgentCommunity,              // Community for target agent
  63.     IN INT   nTimeOut,                      // Comm time-out in milliseconds
  64.     IN INT   nRetries                       // Comm time-out/retry count
  65.     );
  66.  
  67. BOOL
  68. SNMP_FUNC_TYPE
  69. SnmpMgrClose(
  70.     IN LPSNMP_MGR_SESSION session           // SNMP session pointer
  71.     );
  72.  
  73. SNMPAPI
  74. SNMP_FUNC_TYPE
  75. SnmpMgrRequest(
  76.     IN     LPSNMP_MGR_SESSION session,           // SNMP session pointer
  77.     IN     BYTE               requestType,       // Get, GetNext, or Set
  78.     IN OUT RFC1157VarBindList *variableBindings, // Varible bindings
  79.        OUT AsnInteger         *errorStatus,      // Result error status
  80.        OUT AsnInteger         *errorIndex        // Result error index
  81.     );
  82.  
  83. BOOL
  84. SNMP_FUNC_TYPE
  85. SnmpMgrStrToOid(
  86.     IN  LPSTR               string,         // OID string to be converted
  87.     OUT AsnObjectIdentifier *oid            // OID internal representation
  88.     );
  89.  
  90. BOOL
  91. SNMP_FUNC_TYPE
  92. SnmpMgrOidToStr(
  93.     IN  AsnObjectIdentifier *oid,           // OID to be converted
  94.     OUT LPSTR               *string         // OID string representation
  95.     );
  96.  
  97. BOOL
  98. SNMP_FUNC_TYPE
  99. SnmpMgrTrapListen(
  100.     OUT HANDLE *phTrapAvailable             // Event indicating trap available
  101.     );
  102.  
  103. BOOL
  104. SNMP_FUNC_TYPE
  105. SnmpMgrGetTrap(
  106.     OUT AsnObjectIdentifier *enterprise,         // Generating enterprise
  107.     OUT AsnNetworkAddress   *IPAddress,          // Generating IP address
  108.     OUT AsnInteger          *genericTrap,        // Generic trap type
  109.     OUT AsnInteger          *specificTrap,       // Enterprise specific type
  110.     OUT AsnTimeticks        *timeStamp,          // Time stamp
  111.     OUT RFC1157VarBindList  *variableBindings    // Variable bindings
  112.     );
  113.  
  114. BOOL
  115. SNMP_FUNC_TYPE
  116. SnmpMgrGetTrapEx(
  117.     OUT AsnObjectIdentifier *enterprise,       // Generating enterprise
  118.     OUT AsnNetworkAddress   *agentAddress,     // Generating agent addr
  119.     OUT AsnNetworkAddress   *sourceAddress,    // Generating network addr
  120.     OUT AsnInteger          *genericTrap,      // Generic trap type
  121.     OUT AsnInteger          *specificTrap,     // Enterprise specific type
  122.     OUT AsnOctetString      *community,        // Generating community
  123.     OUT AsnTimeticks        *timeStamp,        // Time stamp
  124.     OUT RFC1157VarBindList  *variableBindings  // Variable bindings
  125.     );
  126.  
  127. #ifdef __cplusplus
  128. }
  129. #endif
  130.  
  131. #endif // _INC_MGMTAPI
  132.