home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Internet Business Development Kit / PRODUCT_CD.iso / sqlsvr / ppc / sqltraps.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-06  |  2.0 KB  |  53 lines

  1.  
  2. // Header file for SQL SNMP trap processing
  3. //
  4.  
  5. #include <windows.h>
  6.  
  7. #define SQLSNMP_SUCCESSFUL          0
  8. #define SQLSNMP_UNSUPPORTED_TRAP    1
  9. #define SQLSNMP_MEMORY_ERROR        2
  10. #define SQLSNMP_NETWORK_NOT_STARTED 3
  11. #define SQLSNMP_TIMEOUT_ON_EVENT    4
  12. #define SQLSNMP_AGENT_NOT_STARTED   5
  13.  
  14. #define DATE_TIME_SIZE    11  // Number of characters representing Date and Time
  15.  
  16. // Trap 1 struction definition
  17. //
  18. typedef struct trap1_info
  19. {
  20.     DWORD  dwError;        // SQL error value
  21.     DWORD  dwSeverity;        // SQL severity
  22.     char * szDBname;        // SQL database name (null terminated, max of 1024 characters)
  23.     char * szServerName;    // SQL server name (null terminated, max of 1024 characters)
  24.     char * szErrorMessage;  // SQL error message (null terminated, max of 1024 characters)
  25.     char * szUserName;        // SQL user name (null terminated, max of 1024 characters)
  26.     char * szSuggestion;    // Suggested action    (null terminated, max of 1024 characters)
  27.     BYTE   DateAndTime[DATE_TIME_SIZE]; // DateAndTime in ASN 11 byte format
  28. } TRAP1_INFO;
  29.  
  30.  
  31. // SQLsnmpTraps( DWORD dwTrapRequest, void * pTrapStructure )
  32. //
  33. //  where dwTrapRequest = 0 -- Determine state of SQL SNMP Extension Agent,
  34. //                             (pTrapStructure should be NULL)
  35. //                      = 1 -- Process Trap1 structure.
  36. //
  37. //        pTrapStructure = pointer to trap structure
  38. //
  39. // If the SQLsnmpTraps() succeeds, a value of zero will be returned.
  40. // Otherwise an error occurred.
  41. //    Error values:
  42. //       1 = Unsupported dwTrapRequest value
  43. //       2 = Memory Error.
  44. //       3 = Network not started
  45. //       4 = TCP/IP not available
  46. //       5 = Agent service not started
  47. //
  48. //    SQLsnmpTraps() will reside in the DLL named "SQLsnmp.dll" which will be
  49. //    located in the ...\SQL60\DLL directory.
  50. //
  51. DWORD SQLsnmpTraps( DWORD  dwTrapRequest,       // Trap request value
  52.                     void * pTrapStructure );    // Structure as defined above
  53.