home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / WIN_NT / SNMPKT.ZIP / MSTOOLS / H / MGMTAPI.H next >
Encoding:
C/C++ Source or Header  |  1992-11-13  |  3.1 KB  |  99 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.  
  26.  
  27. // Necessary includes.
  28.  
  29. #include <winsock.h>
  30.  
  31.  
  32. // Errors... (unique from those in snmp.h)
  33.  
  34. #define SNMP_MGMTAPI_TIMEOUT         40
  35. #define SNMP_MGMTAPI_SELECT_FDERRORS 41
  36. #define SNMP_MGMTAPI_TRAP_ERRORS     42
  37. #define SNMP_MGMTAPI_TRAP_DUPINIT    43
  38. #define SNMP_MGMTAPI_NOTRAPS         44
  39. #define SNMP_MGMTAPI_AGAIN           45
  40.  
  41.  
  42. // Types...
  43.  
  44. typedef SOCKET SockDesc;
  45.  
  46. #define RECVBUFSIZE 4096
  47.  
  48. typedef struct _SNMP_MGR_SESSION {
  49.     SockDesc        fd;                   // socket
  50.     struct sockaddr destAddr;             // destination agent address
  51.     LPSTR           community;            // community name
  52.     INT             timeout;              // comm time-out (milliseconds)
  53.     INT             retries;              // comm retry count
  54.     AsnInteger      requestId;            // RFC1157 requestId
  55.     char            recvBuf[RECVBUFSIZE]; // receive buffer
  56. } SNMP_MGR_SESSION, *LPSNMP_MGR_SESSION;
  57.  
  58.  
  59. // Prototypes...
  60.  
  61. LPSNMP_MGR_SESSION _stdcall SnmpMgrOpen(
  62.     IN LPSTR lpAgentAddress,    // Name/address of target SNMP agent
  63.     IN LPSTR lpAgentCommunity,  // Community for target SNMP agent
  64.     IN INT   nTimeOut,          // Communication time-out in milliseconds
  65.     IN INT   nRetries);         // Communication time-out/retry count
  66.  
  67. BOOL _stdcall SnmpMgrClose(
  68.     IN LPSNMP_MGR_SESSION session);   // SNMP session pointer
  69.  
  70. SNMPAPI _stdcall SnmpMgrRequest(
  71.     IN     LPSNMP_MGR_SESSION session,           // SNMP session pointer
  72.     IN     BYTE               requestType,       // Get, GetNext, or Set
  73.     IN OUT RFC1157VarBindList *variableBindings, // Varible bindings
  74.     OUT    AsnInteger         *errorStatus,      // Result error status
  75.     OUT    AsnInteger         *errorIndex);      // Result error index
  76.  
  77.  
  78. BOOL _stdcall SnmpMgrStrToOid(
  79.     IN  LPSTR               string,   // OID string to be converted
  80.     OUT AsnObjectIdentifier *oid);    // OID internal representation
  81.  
  82. BOOL _stdcall SnmpMgrOidToStr(
  83.     IN  AsnObjectIdentifier *oid,     // OID internal rep to be converted
  84.     OUT LPSTR               *string); // OID string representation
  85.  
  86.  
  87. BOOL _stdcall SnmpMgrTrapListen(
  88.     OUT HANDLE *phTrapAvailable); // Event handle indicating trap(s) available
  89.  
  90. BOOL _stdcall SnmpMgrGetTrap(
  91.     OUT AsnObjectIdentifier *enterprise,       // Generating enterprise
  92.     OUT AsnInteger          *genericTrap,      // Generic trap type
  93.     OUT AsnInteger          *specificTrap,     // Enterprise specific type
  94.     OUT AsnTimeticks        *timeStamp,        // Time stamp
  95.     OUT RFC1157VarBindList  *variableBindings);// Variable bindings
  96.  
  97.  
  98. #endif /* mgmtapi_h */
  99.