home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 19.ddi / GENINC32.PAK / MGMTAPI.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  3.5 KB  |  116 lines

  1. /*++ BUILD Version: 0001    // Increment this if a change has global effects
  2.  
  3. Copyright (c) 1992, Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     mgmtapi.h
  8.  
  9. Abstract:
  10.  
  11.     Definitions for SNMP Management API Development.
  12.  
  13.  
  14.     This PRE-RELEASE header file contains definitions that may change
  15.     prior to the official release of Windows NT.   Microsoft makes no
  16.     warranty of any kind as to the suitability or correctness of this
  17.     code.
  18.  
  19.  
  20. --*/
  21.  
  22. #ifndef __MGMTAPI_H
  23. #define __MGMTAPI_H
  24.  
  25. static char *mgmtapi__h = "@(#) $Logfile:   Y:/ADMIN/BC4RTL/RTLAPI/MGMTAPI.H_V  $ $Revision:   1.0  $";
  26.  
  27.  
  28. // Necessary includes.
  29.  
  30. #ifndef __WINSOCK_H
  31. #include <winsock.h>
  32. #endif
  33. #ifndef __SNMP_H
  34. #include <snmp.h>
  35. #endif
  36.  
  37.  
  38. // Errors... (unique from those in snmp.h)
  39.  
  40. #define SNMP_MGMTAPI_TIMEOUT         40
  41. #define SNMP_MGMTAPI_SELECT_FDERRORS 41
  42. #define SNMP_MGMTAPI_TRAP_ERRORS     42
  43. #define SNMP_MGMTAPI_TRAP_DUPINIT    43
  44. #define SNMP_MGMTAPI_NOTRAPS         44
  45. #define SNMP_MGMTAPI_AGAIN           45
  46.  
  47. #define SNMP_MAX_OID_LEN     0x7f00 // Max number of elements in obj id
  48.  
  49. // Types...
  50.  
  51.  
  52. typedef SOCKET SockDesc;
  53.  
  54. #define RECVBUFSIZE 4096
  55.  
  56. typedef struct _SNMP_MGR_SESSION {
  57.     SockDesc        fd;                   // socket
  58.     struct sockaddr destAddr;             // destination agent address
  59.     LPSTR           community;            // community name
  60.     INT             timeout;              // comm time-out (milliseconds)
  61.     INT             retries;              // comm retry count
  62.     AsnInteger      requestId;            // RFC1157 requestId
  63.     char            recvBuf[RECVBUFSIZE]; // receive buffer
  64. } SNMP_MGR_SESSION, *LPSNMP_MGR_SESSION;
  65.  
  66.  
  67. // Prototypes...
  68.  
  69. LPSNMP_MGR_SESSION
  70. SNMP_FUNC_TYPE SnmpMgrOpen(
  71.     IN LPSTR lpAgentAddress,    // Name/address of target SNMP agent
  72.     IN LPSTR lpAgentCommunity,  // Community for target SNMP agent
  73.     IN INT   nTimeOut,          // Communication time-out in milliseconds
  74.     IN INT   nRetries);         // Communication time-out/retry count
  75.  
  76. BOOL
  77. SNMP_FUNC_TYPE SnmpMgrClose(
  78.     IN LPSNMP_MGR_SESSION session);   // SNMP session pointer
  79.  
  80. SNMPAPI
  81. SNMP_FUNC_TYPE SnmpMgrRequest(
  82.     IN     LPSNMP_MGR_SESSION session,           // SNMP session pointer
  83.     IN     BYTE               requestType,       // Get, GetNext, or Set
  84.     IN OUT RFC1157VarBindList *variableBindings, // Varible bindings
  85.     OUT    AsnInteger         *errorStatus,      // Result error status
  86.     OUT    AsnInteger         *errorIndex);      // Result error index
  87.  
  88.  
  89. BOOL
  90. SNMP_FUNC_TYPE SnmpMgrStrToOid(
  91.     IN  LPSTR               string,   // OID string to be converted
  92.     OUT AsnObjectIdentifier *oid);    // OID internal representation
  93.  
  94. BOOL
  95. SNMP_FUNC_TYPE SnmpMgrOidToStr(
  96.     IN  AsnObjectIdentifier *oid,     // OID internal rep to be converted
  97.     OUT LPSTR               *string); // OID string representation
  98.  
  99.  
  100. BOOL
  101. SNMP_FUNC_TYPE SnmpMgrTrapListen(
  102.     OUT HANDLE *phTrapAvailable); // Event handle indicating trap(s) available
  103.  
  104. BOOL
  105. SNMP_FUNC_TYPE 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. #endif /* mgmtapi_h */
  115.  
  116.