home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / mgmtapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  6.0 KB  |  160 lines

  1. /*++
  2.  
  3. Copyright (c) 1992-1999 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. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  17. #define _INC_MGMTAPI
  18.  
  19. #if _MSC_VER > 1000
  20. #pragma once
  21. #endif
  22.  
  23. ///////////////////////////////////////////////////////////////////////////////
  24. //                                                                           //
  25. // Additional header files                                                   //
  26. //                                                                           //
  27. ///////////////////////////////////////////////////////////////////////////////
  28.  
  29. #include <snmp.h>
  30. #include <winsock.h>
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. ///////////////////////////////////////////////////////////////////////////////
  37. //                                                                           //
  38. // MGMT API error code definitions                                           //
  39. //                                                                           //
  40. ///////////////////////////////////////////////////////////////////////////////
  41.  
  42. #define SNMP_MGMTAPI_TIMEOUT                40
  43. #define SNMP_MGMTAPI_SELECT_FDERRORS        41
  44. #define SNMP_MGMTAPI_TRAP_ERRORS            42
  45. #define SNMP_MGMTAPI_TRAP_DUPINIT           43
  46. #define SNMP_MGMTAPI_NOTRAPS                44
  47. #define SNMP_MGMTAPI_AGAIN                  45
  48. #define SNMP_MGMTAPI_INVALID_CTL            46
  49. #define SNMP_MGMTAPI_INVALID_SESSION        47
  50. #define SNMP_MGMTAPI_INVALID_BUFFER         48
  51.  
  52. ///////////////////////////////////////////////////////////////////////////////
  53. //                                                                           //
  54. // MGMT API control codes
  55. //                                                                           //
  56. ///////////////////////////////////////////////////////////////////////////////
  57. #define MGMCTL_SETAGENTPORT             0x01
  58.  
  59. ///////////////////////////////////////////////////////////////////////////////
  60. //                                                                           //
  61. // MGMT API type definitions                                                 //
  62. //                                                                           //
  63. ///////////////////////////////////////////////////////////////////////////////
  64.  
  65. typedef PVOID LPSNMP_MGR_SESSION;
  66.  
  67. ///////////////////////////////////////////////////////////////////////////////
  68. //                                                                           //
  69. // MGMT API prototypes                                                       //
  70. //                                                                           //
  71. ///////////////////////////////////////////////////////////////////////////////
  72.  
  73. LPSNMP_MGR_SESSION
  74. SNMP_FUNC_TYPE
  75. SnmpMgrOpen(
  76.     IN LPSTR lpAgentAddress,                // Name/address of target agent
  77.     IN LPSTR lpAgentCommunity,              // Community for target agent
  78.     IN INT   nTimeOut,                      // Comm time-out in milliseconds
  79.     IN INT   nRetries                       // Comm time-out/retry count
  80.     );
  81.  
  82. BOOL
  83. SNMP_FUNC_TYPE
  84. SnmpMgrCtl(
  85.     LPSNMP_MGR_SESSION session,             // pointer to the MGMTAPI session
  86.     DWORD              dwCtlCode,           // control code for the command requested
  87.     LPVOID             lpvInBuffer,         // buffer with the input parameters for the operation
  88.     DWORD              cbInBuffer,          // size of lpvInBuffer in bytes
  89.     LPVOID             lpvOUTBuffer,        // buffer for all the output parameters of the command
  90.     DWORD              cbOUTBuffer,         // size of lpvOUTBuffer
  91.     LPDWORD            lpcbBytesReturned    // space used from lpvOutBuffer
  92.     );
  93.  
  94. BOOL
  95. SNMP_FUNC_TYPE
  96. SnmpMgrClose(
  97.     IN LPSNMP_MGR_SESSION session           // SNMP session pointer
  98.     );
  99.  
  100. SNMPAPI
  101. SNMP_FUNC_TYPE
  102. SnmpMgrRequest(
  103.     IN     LPSNMP_MGR_SESSION session,           // SNMP session pointer
  104.     IN     BYTE               requestType,       // Get, GetNext, or Set
  105.     IN OUT RFC1157VarBindList *variableBindings, // Varible bindings
  106.        OUT AsnInteger         *errorStatus,      // Result error status
  107.        OUT AsnInteger         *errorIndex        // Result error index
  108.     );
  109.  
  110. BOOL
  111. SNMP_FUNC_TYPE
  112. SnmpMgrStrToOid(
  113.     IN  LPSTR               string,         // OID string to be converted
  114.     OUT AsnObjectIdentifier *oid            // OID internal representation
  115.     );
  116.  
  117. BOOL
  118. SNMP_FUNC_TYPE
  119. SnmpMgrOidToStr(
  120.     IN  AsnObjectIdentifier *oid,           // OID to be converted
  121.     OUT LPSTR               *string         // OID string representation
  122.     );
  123.  
  124. BOOL
  125. SNMP_FUNC_TYPE
  126. SnmpMgrTrapListen(
  127.     OUT HANDLE *phTrapAvailable             // Event indicating trap available
  128.     );
  129.  
  130. BOOL
  131. SNMP_FUNC_TYPE
  132. SnmpMgrGetTrap(
  133.     OUT AsnObjectIdentifier *enterprise,         // Generating enterprise
  134.     OUT AsnNetworkAddress   *IPAddress,          // Generating IP address
  135.     OUT AsnInteger          *genericTrap,        // Generic trap type
  136.     OUT AsnInteger          *specificTrap,       // Enterprise specific type
  137.     OUT AsnTimeticks        *timeStamp,          // Time stamp
  138.     OUT RFC1157VarBindList  *variableBindings    // Variable bindings
  139.     );
  140.  
  141. BOOL
  142. SNMP_FUNC_TYPE
  143. SnmpMgrGetTrapEx(
  144.     OUT AsnObjectIdentifier *enterprise,       // Generating enterprise
  145.     OUT AsnNetworkAddress   *agentAddress,     // Generating agent addr
  146.     OUT AsnNetworkAddress   *sourceAddress,    // Generating network addr
  147.     OUT AsnInteger          *genericTrap,      // Generic trap type
  148.     OUT AsnInteger          *specificTrap,     // Enterprise specific type
  149.     OUT AsnOctetString      *community,        // Generating community
  150.     OUT AsnTimeticks        *timeStamp,        // Time stamp
  151.     OUT RFC1157VarBindList  *variableBindings  // Variable bindings
  152.     );
  153.  
  154. #ifdef __cplusplus
  155. }
  156. #endif
  157.  
  158. #pragma option pop /*P_O_Pop*/
  159. #endif // _INC_MGMTAPI
  160.