Source code of Windows XP (NT5)
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.

115 lines
2.5 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. dhcpmib.h
  5. Abstract:
  6. Sample SNMP Extension Agent for Windows NT.
  7. These files (dhcpmibm.c, dhcpmib.c, and dhcpmib.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. 12-jan-1994
  14. Revision History:
  15. --*/
  16. #ifndef dhcpmib_h
  17. #define dhcpmib_h
  18. // Necessary includes.
  19. #include <snmp.h>
  20. // MIB Specifics.
  21. #define MIB_PREFIX_LEN MIB_OidPrefix.idLength
  22. #define MAX_STRING_LEN 255
  23. // Ranges and limits for specific MIB variables.
  24. #define NON_ASN_USED_RANGE_START 0xe0 //high 3 bits not used by
  25. //ASN
  26. //
  27. // MIB function actions.
  28. //
  29. #define MIB_GET ASN_RFC1157_GETREQUEST
  30. #define MIB_SET ASN_RFC1157_SETREQUEST
  31. #define MIB_GETNEXT ASN_RFC1157_GETNEXTREQUEST
  32. #define MIB_GETFIRST (ASN_PRIVATE | ASN_CONSTRUCTOR | 0x0)
  33. // MIB Variable access privileges.
  34. #define MIB_ACCESS_READ 0
  35. #define MIB_ACCESS_WRITE 1
  36. #define MIB_ACCESS_READWRITE 2
  37. #define MIB_NOACCESS 3
  38. // Macro to determine number of sub-oid's in array.
  39. #define OID_SIZEOF( Oid ) ( sizeof Oid / sizeof(UINT) )
  40. // MIB variable ENTRY definition. This structure defines the format for
  41. // each entry in the MIB.
  42. typedef struct mib_entry
  43. {
  44. AsnObjectIdentifier Oid;
  45. void * Storage;
  46. BYTE Type;
  47. UINT Access;
  48. UINT (*MibFunc)( UINT, struct mib_entry *,
  49. RFC1157VarBind * );
  50. struct mib_entry * MibNext;
  51. } MIB_ENTRY, *PMIB_ENTRY;
  52. typedef struct table_entry
  53. {
  54. UINT (*MibFunc)( UINT, struct mib_entry *,
  55. RFC1157VarBind * );
  56. struct mib_entry * Mibptr;
  57. } TABLE_ENTRY, *PTABLE_ENTRY;
  58. // Internal MIB structure.
  59. extern UINT MIB_num_variables;
  60. // Prefix to every variable in the MIB.
  61. extern AsnObjectIdentifier MIB_OidPrefix;
  62. extern BOOL fDhcpMibVarsAccessed;
  63. //extern MIB_ENTRY Mib[];
  64. extern MIB_ENTRY *pWinsMib;
  65. // Function Prototypes.
  66. extern
  67. UINT ResolveVarBind(
  68. IN OUT RFC1157VarBind *VarBind, // Variable Binding to resolve
  69. IN UINT PduAction // Action specified in PDU
  70. );
  71. #endif /* dhcpmib_h */