nmevent.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:5k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //=============================================================================
  2. //  Microsoft (R) Network Monitor (tm). 
  3. //  Copyright (C) 1997-1999. All rights reserved.
  4. //
  5. //  MODULE: NMEvent.h
  6. //
  7. //  The basis of all Network Monitor Events
  8. //=============================================================================
  9. #ifndef _NMEVENT_H_
  10. #define _NMEVENT_H_
  11. // we only need this include to get MAC_ADDRESS_SIZE and IPX_ADDRESS
  12. #include <npptypes.h>
  13. // we say zero length arrays are just fine...
  14. #pragma warning(disable:4200)
  15. // NMCOLUMNTYPE
  16. typedef enum 
  17. {
  18.     NMCOLUMNTYPE_UINT8 = 0,
  19.     NMCOLUMNTYPE_SINT8,
  20.     NMCOLUMNTYPE_UINT16,
  21.     NMCOLUMNTYPE_SINT16,
  22.     NMCOLUMNTYPE_UINT32,
  23.     NMCOLUMNTYPE_SINT32,
  24.     NMCOLUMNTYPE_FLOAT64,
  25.     NMCOLUMNTYPE_FRAME,
  26.     NMCOLUMNTYPE_YESNO,
  27.     NMCOLUMNTYPE_ONOFF,
  28.     NMCOLUMNTYPE_TRUEFALSE,
  29.     NMCOLUMNTYPE_MACADDR,
  30.     NMCOLUMNTYPE_IPXADDR,
  31.     NMCOLUMNTYPE_IPADDR,
  32.     NMCOLUMNTYPE_VARTIME,
  33.     NMCOLUMNTYPE_STRING
  34. } NMCOLUMNTYPE;
  35. // NMCOLUMNVARIANT
  36. typedef struct _NMCOLUMNVARIANT
  37. {
  38.     NMCOLUMNTYPE Type;
  39.     union
  40.     {
  41.        BYTE     Uint8Val;    // 8 bit unsigned value
  42.        char     Sint8Val;    // 8 bit signed value
  43.        WORD     Uint16Val;   // 16 bit unsigned value
  44.        short    Sint16Val;   // 16 bit signed value
  45.        DWORD    Uint32Val;   // 32 bit unsigned value
  46.        long     Sint32Val;   // 32 bit signed value
  47.        DOUBLE   Float64Val;  // 64 bit floating point value
  48.        DWORD    FrameVal;    // 32 bit unsigned frame value
  49.        BOOL     YesNoVal;    // 32 bit boolean: zero maps to 'NO', nonzero maps to 'YES'
  50.        BOOL     OnOffVal;    // 32 bit boolean: zero maps to 'OFF', nonzero maps to 'ON'
  51.        BOOL     TrueFalseVal;// 32 bit boolean: zero maps to 'False', nonzero maps to 'True'
  52.        BYTE     MACAddrVal[MAC_ADDRESS_SIZE];// 48 bit MAC address (6 bytes)
  53.        IPX_ADDRESS IPXAddrVal;// 10 byte ipx address (4 byte subnet. 6 byte address)
  54.        DWORD    IPAddrVal;   // 32 bit IP Address: ddd.ddd.ddd.ddd
  55.        DOUBLE   VarTimeVal;  // Double representation of time value (use VariantTimeToSystemTime to convert)
  56.        LPCSTR  pStringVal;   // pointer to a string value
  57.     } Value;
  58. } NMCOLUMNVARIANT;
  59. // COLUMNINFO
  60. typedef struct _NMCOLUMNINFO
  61. {
  62.     LPSTR           szColumnName;// Name of column
  63.     NMCOLUMNVARIANT VariantData; // Value for column
  64. } NMCOLUMNINFO;                                                  
  65. typedef NMCOLUMNINFO* PNMCOLUMNINFO;                                         
  66.              
  67. // JTYPE
  68. typedef LPSTR JTYPE; // (structure placeholder)
  69. // EVENTDATA
  70. typedef struct _NMEVENTDATA
  71. {                                                                   
  72.     LPSTR      pszReserved;  // Reserved
  73.     BYTE       Version;      // Version for this structure (must be 0)
  74.     DWORD      EventIdent;   // ID for this event
  75.     DWORD      Flags;        // Flags for Expert generated or Monitor generated and others
  76.     DWORD      Severity;     // Severity level
  77.     BYTE       NumColumns;   // Number of optional columns for this event
  78.     LPSTR      szSourceName; // Name of Monitor or Expert
  79.     LPSTR      szEventName;  // Name of event
  80.     LPSTR      szDescription;// Description of event
  81.     LPSTR      szMachine;    // Name (or IPADDRESS?) of the machine supplying the event (NULL for Experts usually)
  82.     JTYPE      Justification;// Justification pane info (currently a string, but possible structure)
  83.     LPSTR      szUrl;        // URL to Book of Knowledge  (NULL for default for ID?)
  84.     SYSTEMTIME SysTime;      // Systemtime of the event
  85.     NMCOLUMNINFO Column[0];    // Array of optional columns with their names and data
  86. } NMEVENTDATA;
  87. typedef NMEVENTDATA* PNMEVENTDATA;
  88. // EVENT FLAGS
  89. #define NMEVENTFLAG_MONITOR                      0x00000000   // Event was generated by a monitor
  90. #define NMEVENTFLAG_EXPERT                       0x00000001   // Event was generated by an expert
  91. #define NMEVENTFLAG_DO_NOT_DISPLAY_SEVERITY      0x80000000
  92. #define NMEVENTFLAG_DO_NOT_DISPLAY_SOURCE        0x40000000
  93. #define NMEVENTFLAG_DO_NOT_DISPLAY_EVENT_NAME    0x20000000
  94. #define NMEVENTFLAG_DO_NOT_DISPLAY_DESCRIPTION   0x10000000
  95. #define NMEVENTFLAG_DO_NOT_DISPLAY_MACHINE       0x08000000
  96. #define NMEVENTFLAG_DO_NOT_DISPLAY_TIME          0x04000000
  97. #define NMEVENTFLAG_DO_NOT_DISPLAY_DATE          0x02000000
  98. //#define NMEVENTFLAG_DO_NOT_DISPLAY_FIXED_COLUMNS (NMEVENTFLAG_DO_NOT_DISPLAY_SEVERITY   | 
  99. //                                                  NMEVENTFLAG_DO_NOT_DISPLAY_SOURCE     | 
  100. //                                                  NMEVENTFLAG_DO_NOT_DISPLAY_EVENT_NAME | 
  101. //                                                  NMEVENTFLAG_DO_NOT_DISPLAY_DESCRIPTION| 
  102. //                                                  NMEVENTFLAG_DO_NOT_DISPLAY_MACHINE    | 
  103. //                                                  NMEVENTFLAG_DO_NOT_DISPLAY_TIME       | 
  104. //                                                  NMEVENTFLAG_DO_NOT_DISPLAY_DATE )
  105. #define NMEVENTFLAG_DO_NOT_DISPLAY_FIXED_COLUMNS 0xFE000000
  106. enum  _NMEVENT_SEVERITIES
  107. {
  108.     NMEVENT_SEVERITY_INFORMATIONAL = 0,
  109.     NMEVENT_SEVERITY_WARNING,
  110.     NMEVENT_SEVERITY_STRONG_WARNING,
  111.     NMEVENT_SEVERITY_ERROR,
  112.     NMEVENT_SEVERITY_SEVERE_ERROR,
  113.     NMEVENT_SEVERITY_CRITICAL_ERROR 
  114. };
  115. // turn this warning back on
  116. #pragma warning(default:4200)
  117. #endif // _EVENT_H_