Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
3.0 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. winsmib.h
  5. Abstract:
  6. Sample SNMP Extension Agent for Windows NT.
  7. These files (winsmibm.c, winsmib.c, and winsmib.h) provide an example of
  8. how to structure an Extension Agent DLL which works in conjunction with
  9. the SNMP Extendible Agent for Windows NT.
  10. Extensive comments have been included to describe its structure and
  11. operation. See also "Microsoft Windows/NT SNMP Programmer's Reference".
  12. Created:
  13. 13-Jun-1991
  14. Revision History:
  15. --*/
  16. #ifndef winsmib_h
  17. #define winsmib_h
  18. static char *winsmib__h = "@(#) $Logfile: N:/xtest/vcs/winsmib.h_v $ $Revision: 1.2 $";
  19. // Necessary includes.
  20. #include <snmp.h>
  21. // MIB Specifics.
  22. #define MIB_PREFIX_LEN MIB_OidPrefix.idLength
  23. #define MAX_STRING_LEN 255
  24. // Ranges and limits for specific MIB variables.
  25. #define NON_ASN_USED_RANGE_START 0xe0 //high 3 bits not used by
  26. //ASN
  27. //
  28. // MIB function actions.
  29. //
  30. #define MIB_GET ASN_RFC1157_GETREQUEST
  31. #define MIB_SET ASN_RFC1157_SETREQUEST
  32. #define MIB_GETNEXT ASN_RFC1157_GETNEXTREQUEST
  33. #define MIB_GETFIRST (ASN_PRIVATE | ASN_CONSTRUCTOR | 0x0)
  34. // MIB Variable access privileges.
  35. #define MIB_ACCESS_READ 0
  36. #define MIB_ACCESS_WRITE 1
  37. #define MIB_ACCESS_READWRITE 2
  38. #define MIB_NOACCESS 3
  39. // Macro to determine number of sub-oid's in array.
  40. #define OID_SIZEOF( Oid ) ( sizeof Oid / sizeof(UINT) )
  41. // MIB variable ENTRY definition. This structure defines the format for
  42. // each entry in the MIB.
  43. typedef struct mib_entry
  44. {
  45. AsnObjectIdentifier Oid;
  46. void * Storage;
  47. BYTE Type;
  48. UINT Access;
  49. UINT (*MibFunc)( UINT, struct mib_entry *,
  50. RFC1157VarBind * );
  51. struct mib_entry * MibNext;
  52. } MIB_ENTRY, *PMIB_ENTRY;
  53. typedef struct table_entry
  54. {
  55. UINT (*MibFunc)( UINT, struct mib_entry *,
  56. RFC1157VarBind * );
  57. struct mib_entry * Mibptr;
  58. } TABLE_ENTRY, *PTABLE_ENTRY;
  59. // Internal MIB structure.
  60. extern UINT MIB_num_variables;
  61. extern BOOL fWinsMibWinsStatusCnfCalled;
  62. extern BOOL fWinsMibWinsStatusStatCalled;
  63. // Prefix to every variable in the MIB.
  64. extern AsnObjectIdentifier MIB_OidPrefix;
  65. extern CRITICAL_SECTION WinsMibCrtSec;
  66. extern HKEY WinsMibWinsKey;
  67. extern BOOL fWinsMibWinsKeyOpen;
  68. //extern MIB_ENTRY Mib[];
  69. extern MIB_ENTRY *pWinsMib;
  70. // Function Prototypes.
  71. extern
  72. UINT ResolveVarBind(
  73. IN OUT RFC1157VarBind *VarBind, // Variable Binding to resolve
  74. IN UINT PduAction // Action specified in PDU
  75. );
  76. extern
  77. VOID WinsMibInit(
  78. VOID
  79. );
  80. #if 0
  81. extern
  82. VOID
  83. WinsMibInitTables();
  84. #endif
  85. #endif /* winsmib_h */