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.

145 lines
5.6 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. Revision history:
  6. --*/
  7. #include "snmpmgmt.h"
  8. #ifndef _MIBFUNCS_H_
  9. #define _MIBFUNCS_H_
  10. // SNMPMIB_MGMTVARS is a structure mapped onto the management
  11. // variables defined at the master agent layer. It is another
  12. // view on the memory space covered by the (PSNMP_MGMTVARS)pMibVariables
  13. // defined below.
  14. // !!!When modifying this structure, make sure to check the code in
  15. // snmpMibGetHandler!!! - this structure is scanned based on the assumption it
  16. // contains AsnAny objects only!!!
  17. typedef struct
  18. {
  19. AsnAny snmpInPkts;
  20. AsnAny snmpOutPkts;
  21. AsnAny snmpInBadVersions;
  22. AsnAny snmpInBadCommunityNames;
  23. AsnAny snmpInBadCommunityUses;
  24. AsnAny snmpInASNParseErrs;
  25. AsnAny snmpInTooBigs;
  26. AsnAny snmpInNoSuchNames;
  27. AsnAny snmpInBadValues;
  28. AsnAny snmpInReadOnlys;
  29. AsnAny snmpInGenErrs;
  30. AsnAny snmpInTotalReqVars;
  31. AsnAny snmpInTotalSetVars;
  32. AsnAny snmpInGetRequests;
  33. AsnAny snmpInGetNexts;
  34. AsnAny snmpInSetRequests;
  35. AsnAny snmpInGetResponses;
  36. AsnAny snmpInTraps;
  37. AsnAny snmpOutTooBigs;
  38. AsnAny snmpOutNoSuchNames;
  39. AsnAny snmpOutBadValues;
  40. AsnAny snmpOutGenErrs;
  41. AsnAny snmpOutGetRequests;
  42. AsnAny snmpOutGetNexts;
  43. AsnAny snmpOutSetRequests;
  44. AsnAny snmpOutGetResponses;
  45. AsnAny snmpOutTraps;
  46. AsnAny snmpEnableAuthenTraps;
  47. } SNMPMIB_MGMTVARS;
  48. // function handling all the GETs of this MIB
  49. UINT
  50. snmpMibGetHandler(
  51. UINT actionId,
  52. AsnAny *objectArray,
  53. UINT *errorIndex);
  54. // function handling all the SETs of this MIB
  55. UINT
  56. snmpMibSetHandler(
  57. UINT actionId,
  58. AsnAny *objectArray,
  59. UINT *errorIndex);
  60. //----------------------------------------------------------
  61. // definitions on which rely all the macros from mibentry.c
  62. //----------------------------------------------------------
  63. PSNMP_MGMTVARS pMibVariables; // obtained from the SNMP agent in SnmpExtensionMonitor()
  64. #define gf_snmpInPkts snmpMibGetHandler
  65. #define gf_snmpOutPkts snmpMibGetHandler
  66. #define gf_snmpInBadVersions snmpMibGetHandler
  67. #define gf_snmpInBadCommunityNames snmpMibGetHandler
  68. #define gf_snmpInBadCommunityUses snmpMibGetHandler
  69. #define gf_snmpInASNParseErrs snmpMibGetHandler
  70. #define gf_snmpInTooBigs snmpMibGetHandler
  71. #define gf_snmpInNoSuchNames snmpMibGetHandler
  72. #define gf_snmpInBadValues snmpMibGetHandler
  73. #define gf_snmpInReadOnlys snmpMibGetHandler
  74. #define gf_snmpInGenErrs snmpMibGetHandler
  75. #define gf_snmpInTotalReqVars snmpMibGetHandler
  76. #define gf_snmpInTotalSetVars snmpMibGetHandler
  77. #define gf_snmpInGetRequests snmpMibGetHandler
  78. #define gf_snmpInGetNexts snmpMibGetHandler
  79. #define gf_snmpInSetRequests snmpMibGetHandler
  80. #define gf_snmpInGetResponses snmpMibGetHandler
  81. #define gf_snmpInTraps snmpMibGetHandler
  82. #define gf_snmpOutTooBigs snmpMibGetHandler
  83. #define gf_snmpOutNoSuchNames snmpMibGetHandler
  84. #define gf_snmpOutBadValues snmpMibGetHandler
  85. #define gf_snmpOutGenErrs snmpMibGetHandler
  86. #define gf_snmpOutGetRequests snmpMibGetHandler
  87. #define gf_snmpOutGetNexts snmpMibGetHandler
  88. #define gf_snmpOutSetRequests snmpMibGetHandler
  89. #define gf_snmpOutGetResponses snmpMibGetHandler
  90. #define gf_snmpOutTraps snmpMibGetHandler
  91. #define gf_snmpEnableAuthenTraps snmpMibGetHandler
  92. #define sf_snmpEnableAuthenTraps snmpMibSetHandler
  93. #define gb_snmpInPkts SNMPMIB_MGMTVARS
  94. #define gb_snmpOutPkts SNMPMIB_MGMTVARS
  95. #define gb_snmpInBadVersions SNMPMIB_MGMTVARS
  96. #define gb_snmpInBadCommunityNames SNMPMIB_MGMTVARS
  97. #define gb_snmpInBadCommunityUses SNMPMIB_MGMTVARS
  98. #define gb_snmpInASNParseErrs SNMPMIB_MGMTVARS
  99. #define gb_snmpInTooBigs SNMPMIB_MGMTVARS
  100. #define gb_snmpInNoSuchNames SNMPMIB_MGMTVARS
  101. #define gb_snmpInBadValues SNMPMIB_MGMTVARS
  102. #define gb_snmpInReadOnlys SNMPMIB_MGMTVARS
  103. #define gb_snmpInGenErrs SNMPMIB_MGMTVARS
  104. #define gb_snmpInTotalReqVars SNMPMIB_MGMTVARS
  105. #define gb_snmpInTotalSetVars SNMPMIB_MGMTVARS
  106. #define gb_snmpInGetRequests SNMPMIB_MGMTVARS
  107. #define gb_snmpInGetNexts SNMPMIB_MGMTVARS
  108. #define gb_snmpInSetRequests SNMPMIB_MGMTVARS
  109. #define gb_snmpInGetResponses SNMPMIB_MGMTVARS
  110. #define gb_snmpInTraps SNMPMIB_MGMTVARS
  111. #define gb_snmpOutTooBigs SNMPMIB_MGMTVARS
  112. #define gb_snmpOutNoSuchNames SNMPMIB_MGMTVARS
  113. #define gb_snmpOutBadValues SNMPMIB_MGMTVARS
  114. #define gb_snmpOutGenErrs SNMPMIB_MGMTVARS
  115. #define gb_snmpOutGetRequests SNMPMIB_MGMTVARS
  116. #define gb_snmpOutGetNexts SNMPMIB_MGMTVARS
  117. #define gb_snmpOutSetRequests SNMPMIB_MGMTVARS
  118. #define gb_snmpOutGetResponses SNMPMIB_MGMTVARS
  119. #define gb_snmpOutTraps SNMPMIB_MGMTVARS
  120. #define gb_snmpEnableAuthenTraps SNMPMIB_MGMTVARS
  121. #define sb_snmpEnableAuthenTraps SNMPMIB_MGMTVARS
  122. #define REG_KEY_SNMP_PARAMETERS \
  123. TEXT("SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters")
  124. #define REG_VALUE_AUTH_TRAPS TEXT("EnableAuthenticationTraps")
  125. #define IsAsnTypeNull(asnObj) (!((asnObj)->asnType))
  126. #endif // _MIBFUNCS_H_