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.

194 lines
5.8 KiB

  1. /*++
  2. Copyright (c) 1992-1996 Microsoft Corporation
  3. Module Name:
  4. mib.h
  5. Abstract:
  6. LAN Manager MIB constants, types, and prototypes for implementing the LM
  7. MIB and its support functions.
  8. Environment:
  9. User Mode - Win32
  10. Revision History:
  11. 10-May-1996 DonRyan
  12. Removed banner from Technology Dynamics, Inc.
  13. --*/
  14. #ifndef mib_h
  15. #define mib_h
  16. //--------------------------- PUBLIC CONSTANTS ------------------------------
  17. #include <snmp.h>
  18. #include <snmputil.h>
  19. // MIB Specifics
  20. #define MIB_PREFIX_LEN MIB_OidPrefix.idLength
  21. #define MIB_TABLE 0xe0 // High 3 bits not used by ASN
  22. #define MIB_SRVC_NAME_LEN 15
  23. #define MIB_SESS_CLIENT_NAME_LEN 15
  24. #define MIB_SESS_USER_NAME_LEN 20
  25. #define MIB_USER_NAME_LEN 20
  26. #define MIB_SHARE_NAME_LEN 12
  27. #define MIB_PRINTQ_NAME_LEN 12
  28. #define MIB_USES_LOCAL_NAME_LEN 8
  29. #define MIB_USES_REMOTE_LEN 255
  30. #define MIB_DOM_OTHER_NAME_LEN 15
  31. #define MIB_DOM_SERVER_NAME_LEN 15
  32. #define MIB_DOM_LOGON_USER 20
  33. #define MIB_DOM_LOGON_MACHINE 15
  34. // Start positions in MIB of first leaf of each group
  35. #define MIB_COM_START 2
  36. #define MIB_SV_START 10
  37. #define MIB_WKSTA_START 45
  38. #define MIB_DOM_START 55
  39. // MIB Node types
  40. #define MIB_AGGREGATE (MIB_TABLE | 0x0f)
  41. // MIB function actions
  42. #define MIB_ACTION_GET ASN_RFC1157_GETREQUEST
  43. #define MIB_ACTION_SET ASN_RFC1157_SETREQUEST
  44. #define MIB_ACTION_GETNEXT ASN_RFC1157_GETNEXTREQUEST
  45. #define MIB_ACTION_GETFIRST (MIB_TABLE | 0x00)
  46. //#define MIB_ACTION_MATCH (MIB_TABLE | 0x01)
  47. // MIB Variable access privileges
  48. #define MIB_ACCESS_READ 0
  49. #define MIB_ACCESS_WRITE 1
  50. #define MIB_ACCESS_READWRITE 2
  51. #define MIB_ACCESS_NOT 3
  52. // MIB Variable status
  53. #define MIB_STATUS_MANDATORY 0
  54. // LM operations -- COMMON group
  55. #define MIB_LM_COMVERSIONMAJ 0
  56. #define MIB_LM_COMVERSIONMIN 1
  57. #define MIB_LM_COMTYPE 2
  58. #define MIB_LM_COMSTATSTART 3
  59. #define MIB_LM_COMSTATNUMNETIOS 4
  60. #define MIB_LM_COMSTATFINETIOS 5
  61. #define MIB_LM_COMSTATFCNETIOS 6
  62. // LM operations -- SERVER group
  63. #define MIB_LM_SVDESCRIPTION 7
  64. #define MIB_LM_SVSVCNUMBER 8
  65. #define MIB_LM_SVSVCTABLE 9
  66. #define MIB_LM_SVSVCENTRY 10
  67. #define MIB_LM_SVSTATOPENS 16
  68. #define MIB_LM_SVSTATDEVOPENS 17
  69. #define MIB_LM_SVSTATQUEUEDJOBS 18
  70. #define MIB_LM_SVSTATSOPENS 19
  71. #define MIB_LM_SVSTATERROROUTS 20
  72. #define MIB_LM_SVSTATPWERRORS 21
  73. #define MIB_LM_SVSTATPERMERRORS 22
  74. #define MIB_LM_SVSTATSYSERRORS 23
  75. #define MIB_LM_SVSTATSENTBYTES 24
  76. #define MIB_LM_SVSTATRCVDBYTES 25
  77. #define MIB_LM_SVSTATAVRESPONSE 26
  78. #define MIB_LM_SVSECURITYMODE 27
  79. #define MIB_LM_SVUSERS 28
  80. #define MIB_LM_SVSTATREQBUFSNEEDED 29
  81. #define MIB_LM_SVSTATBIGBUFSNEEDED 30
  82. #define MIB_LM_SVSESSIONNUMBER 31
  83. #define MIB_LM_SVSESSIONTABLE 32
  84. #define MIB_LM_SVSESSIONENTRY 33
  85. #define MIB_LM_SVAUTODISCONNECTS 42
  86. #define MIB_LM_SVDISCONTIME 43
  87. #define MIB_LM_SVAUDITLOGSIZE 44
  88. #define MIB_LM_SVUSERNUMBER 45
  89. #define MIB_LM_SVUSERTABLE 46
  90. #define MIB_LM_SVUSERENTRY 47
  91. #define MIB_LM_SVSHARENUMBER 49
  92. #define MIB_LM_SVSHARETABLE 50
  93. #define MIB_LM_SVSHAREENTRY 51
  94. #define MIB_LM_SVPRINTQNUMBER 55
  95. #define MIB_LM_SVPRINTQTABLE 56
  96. #define MIB_LM_SVPRINTQENTRY 57
  97. // LM operations -- WORKSTATION group
  98. #define MIB_LM_WKSTASTATSESSSTARTS 60
  99. #define MIB_LM_WKSTASTATSESSFAILS 61
  100. #define MIB_LM_WKSTASTATUSES 62
  101. #define MIB_LM_WKSTASTATUSEFAILS 63
  102. #define MIB_LM_WKSTASTATAUTORECS 64
  103. #define MIB_LM_WKSTAERRORLOGSIZE 65
  104. #define MIB_LM_WKSTAUSENUMBER 66
  105. #define MIB_LM_WKSTAUSETABLE 67
  106. #define MIB_LM_WKSTAUSEENTRY 68
  107. // LM operations -- DOMAIN group
  108. #define MIB_LM_DOMPRIMARYDOMAIN 72
  109. #define MIB_LM_DOMLOGONDOMAIN 73
  110. #define MIB_LM_DOMOTHERDOMAINNUMBER 74
  111. #define MIB_LM_DOMOTHERDOMAINTABLE 75
  112. #define MIB_LM_DOMOTHERDOMAINENTRY 76
  113. #define MIB_LM_DOMOTHERNAME 77
  114. #define MIB_LM_DOMSERVERNUMBER 78
  115. #define MIB_LM_DOMSERVERTABLE 79
  116. #define MIB_LM_DOMSERVERENTRY 80
  117. #define MIB_LM_DOMLOGONNUMBER 82
  118. #define MIB_LM_DOMLOGONTABLE 83
  119. #define MIB_LM_DOMLOGONENTRY 84
  120. // Table matching constants
  121. #define MIB_TBL_POS_FOUND 0
  122. #define MIB_TBL_POS_BEFORE -1
  123. #define MIB_TBL_POS_END -2
  124. //--------------------------- PUBLIC STRUCTS --------------------------------
  125. // MIB generic data type
  126. typedef ULONG LDATA;
  127. // MIB variable definition
  128. typedef struct mib_entry
  129. {
  130. AsnObjectIdentifier Oid;
  131. BYTE Type;
  132. UINT Access;
  133. UINT Status;
  134. int Leaf;
  135. void * (*LMFunc)( UINT, LDATA, void * );
  136. UINT (*MibFunc)( UINT, struct mib_entry *,
  137. RFC1157VarBind * );
  138. UINT LMData;
  139. struct mib_entry *MibNext;
  140. } MIB_ENTRY;
  141. //--------------------------- PUBLIC VARIABLES --(same as in module.c file)--
  142. // Internal MIB structure
  143. extern MIB_ENTRY Mib[];
  144. extern UINT MIB_num_variables;
  145. // Prefix to every variable in the LM MIB
  146. extern AsnObjectIdentifier MIB_OidPrefix;
  147. //--------------------------- PUBLIC PROTOTYPES -----------------------------
  148. MIB_ENTRY *MIB_get_entry(
  149. IN AsnObjectIdentifier *Oid
  150. );
  151. SNMPAPI MakeOidFromStr(
  152. IN AsnDisplayString *Str, // String to make OID
  153. OUT AsnObjectIdentifier *Oid // Resulting OID
  154. );
  155. //------------------------------- END ---------------------------------------
  156. #endif /* mib_h */