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.

394 lines
16 KiB

  1. //***************************************************************************
  2. //
  3. // File:
  4. //
  5. // Module: MS SNMP Provider
  6. //
  7. // Purpose:
  8. //
  9. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  10. //
  11. //***************************************************************************
  12. #ifndef _TEXTDEF_H_
  13. #define _TEXTDEF_H_
  14. /********************* HMOM strings **************************/
  15. #define HMOM_CLASS_PREFIX L"__"
  16. #define HMOM_CONNECT_USER L""
  17. #define HMOM_CONNECT_PASSWORD L""
  18. #define HMOM_EMPTY_STRING L""
  19. #define HMOM_SNMPMACRO_STRING L"SnmpMacro"
  20. #define HMOM_SNMPOBJECTTYPE_STRING L"SnmpObjectType"
  21. #define HMOM_CLASS_EXTENDEDSTATUS L"__ExtendedStatus"
  22. #define HMOM_CLASS_SNMPNOTIFYSTATUS L"SnmpNotifyStatus"
  23. #define HMOM_PROPERTY_SNMPSTATUSCODE L"SnmpStatusCode"
  24. #define HMOM_PROPERTY_SNMPSTATUSMESSAGE L"Description"
  25. #define HMOM_SNMPNOTIFICATIONTYPE_STRING L"SnmpNotification"
  26. #define HMOM_SNMPEXTNOTIFICATIONTYPE_STRING L"SnmpExtendedNotification"
  27. //Strings used during self registeration
  28. #define CLSID_STR L"Software\\Classes\\CLSID\\"
  29. #define REG_FORMAT_STR L"%s\\%s"
  30. #define NOT_INTERT_STR L"NotInsertable"
  31. #define INPROC32_STR L"InprocServer32"
  32. #define SMIR_NAME_STR L"Microsoft WBEM SNMP Module Information Repository"
  33. #define THREADING_MODULE_STR L"ThreadingModel"
  34. #define APARTMENT_STR L"Both"
  35. //name space strings
  36. #define OLEMS_NAMESPACE_CLASS L"__namespace"
  37. #define SMIR_NAMESPACE_NAME L"SMIR"
  38. #define OLEMS_ROOT_NAMESPACE L"root\\snmp"
  39. #define OLEMS_ROOT_NAMESPACE_FROM_ROOT L"\\\\.\\root\\snmp"
  40. #define SMIR_NAMESPACE_FROM_ROOT L"\\\\.\\root\\snmp\\SMIR"
  41. #define SMIR_CLASS_ASSOCIATION_ENDPOINT L"\\\\.\\root\\snmp\\SMIR:SMIR=\"@\""
  42. #define SMIR_NAMESPACE L"root\\snmp\\SMIR"
  43. #define MODULE_NAMESPACE_NAME L"SNMP_MODULE"
  44. #define GROUP_NAMESPACE_NAME L"SNMP_GROUP"
  45. #define SMIR_INSTANCE_NAME L"SMIR"
  46. #define CLASS_CLASS_NAME L"CLASS"
  47. #define OLEMS_CLASS_PROP L"__CLASS"
  48. #define OLEMS_PATH_PROP L"__PATH"
  49. #define OLEMS_GENUS_PROP L"__GENUS"
  50. #define OLEMS_SUPERCLASS_PROP L"__SUPERCLASS"
  51. #define OLEMS_NAME_PROP L"Name"
  52. #define DOT_STR L"."
  53. #define BACKSLASH_STR L"\\"
  54. #define EQUALS_STR L"="
  55. #define KEY_STR L"Key"
  56. #define QUOTE_STR L"\""
  57. #define COLON_STR L":"
  58. #define SEMICOLON_STR L";"
  59. #define REF_STR L"ref"
  60. #define SYNTAX_STR L"syntax"
  61. #define ASSOC_STR L"assoc"
  62. #define ABSTRACT_STR L"abstract"
  63. #define OPEN_BRACE_STR L"{"
  64. #define CLOSE_BRACE_STR L"}"
  65. #define SPACE_STR L" "
  66. #define NEWLINE_STR L"\n"
  67. //name space property strings
  68. /********************* module namespace **************************/
  69. #define MODULE_NAME_PROPERTY L"Name"
  70. #define MODULE_OID_PROPERTY L"Module_Oid"
  71. #define MODULE_ID_PROPERTY L"Module_Identity"
  72. #define MODULE_ORG_PROPERTY L"Organization"
  73. #define MODULE_CONTACT_PROPERTY L"Contact_Inf"
  74. #define MODULE_DESCRIPTION_PROPERTY L"Description"
  75. #define MODULE_REVISION_PROPERTY L"Revision"
  76. #define MODULE_SNMP_VERSION_PROPERTY L"Snmp_Version"
  77. #define MODULE_LAST_UPDATE_PROPERTY L"Last_Updated"
  78. #define MODULE_IMPORTS_PROPERTY L"Module_Imports"
  79. /********************* group namespace **************************/
  80. #define GROUP_NAME_PROPERTY L"Name"
  81. #define GROUP_ID_PROPERTY L"Group_Id"
  82. #define GROUP_STATUS_PROPERTY L"Status"
  83. #define GROUP_DESCRIPTION_PROPERTY L"Description"
  84. #define MODULE_REFERENCE_PROPERTY L"Reference"
  85. /********************* class namespace **************************/
  86. //#define CLASS_NAME_PROPERTY L"Name"
  87. /********************* Mutex strings **************************/
  88. #define SMIR_INTERFACE_GARBAGE_MAP_MUTEX L"SMIR_InterfaceGarbageMap"
  89. #define SMIR_CSMIR_MUTEX L"SMIR_CSmir"
  90. #define SMIR_CSMIR_INTERROGATOR_MUTEX L"SMIR_CSmirInterogator"
  91. #define SMIR_CSMIR_ADMINISTRATOR_MUTEX L"SMIR_CSmirAdministrator"
  92. #define SMIR_ENUMOBJECT_MUTEX L"SMIR_EnumObjectArray"
  93. /********************* Association strings **************************/
  94. #define SMIR_ASSOC_QUERY1_TYPE L"WQL"
  95. #define SMIR_ASSOC_QUERY2_TYPE L"WQL"
  96. #define SMIR_ASSOC_CLASS_NAME L"SmirToClassAssociator"
  97. #define SMIR_ASSOC_CLASS_NAME_POSTFIX L"SMIRAssociation"
  98. #define SMIR_ASSOC_SMIR_PROP L"SmirName"
  99. #define SMIR_NOTIFICATION_MAPPER L"NotificationMapper"
  100. #define SMIR_EXT_NOTIFICATION_MAPPER L"ExtendedNotificationMapper"
  101. #define SMIR_NOTIFICATION_TRAP_PROP L"SnmpTrapOID"
  102. #define SMIR_NOTIFICATION_CLASS_PROP L"EventClassName"
  103. #define SMIR_MODULE_ASSOC_NCLASS_NAME L"ModToNotificationClassAssociator"
  104. #define SMIR_MODULE_ASSOC_EXTNCLASS_NAME L"ModToExtNotificationClassAssociator"
  105. #define SMIR_MODULE_ASSOC_CLASS_NAME L"ModuleToClassAssociator"
  106. #define SMIR_MODULE_ASSOC_CLASS_NAME_POSTFIX L"SMIRModuleAssociation"
  107. #define SMIR_MODULE_ASSOC_MODULE_PROP L"SmirModule"
  108. #define SMIR_GROUP_ASSOC_CLASS_NAME L"GroupToClassAssociator"
  109. #define SMIR_GROUP_ASSOC_CLASS_NAME_POSTFIX L"SMIRGroupAssociation"
  110. #define SMIR_GROUP_ASSOC_GROUP_PROP L"SmirGroup"
  111. #define SMIR_X_ASSOC_NAME_PROP L"AssocName"
  112. #define SMIR_X_ASSOC_CLASS_PROP L"SmirClass"
  113. //Strings for Notification and Extended Notification Base classes
  114. #define EXTRINSIC_EVENT_CLASS_NAME L"__ExtrinsicEvent"
  115. #define NOTIFICATION_CLASS_NAME L"SnmpNotification"
  116. #define EXT_NOTIFICATION_CLASS_NAME L"SnmpExtendedNotification"
  117. #define TIMESTAMP_PROP L"TimeStamp"
  118. #define SENDER_ADDR_PROP L"AgentAddress"
  119. #define SENDER_TADDR_PROP L"AgentTransportAddress"
  120. #define TRANSPORT_PROP L"AgentTransportProtocol"
  121. #define TRAPOID_PROP L"Identification"
  122. #define COMMUNITY_PROP L"Community"
  123. //strings for Event registration
  124. #define FILTER_QUERYTYPE_VAL L"WQL"
  125. #define FILTER_QUERY_VAL L"SELECT * FROM __ClassOperationEvent"
  126. /*query strings for getting the classes associated with a group are of the form
  127. *L"associators of {\\\\.\\root\\default\\SMIR\\<module>:Group=\"<group>\"}",
  128. */
  129. #define SMIR_ASSOC_QUERY_STR1 L"associators of "
  130. #define SMIR_ASSOC_QUERY_STR2 L"references of "
  131. #define SMIR_ASSOC_QUERY_STR3 L" where AssocClass"
  132. #define SMIR_ASSOC_QUERY_STR4 L" where ResultClass"
  133. #define SQL_QUERY_STR1 L"select * from "
  134. #define SQL_QUERY_STR2 L" where "
  135. /***************************Serialise strings ************************************/
  136. #define ROOT_DEFAULT_NAMESPACE_PRAGMA L"#pragma namespace(\"\\\\\\\\.\\\\root\\\\snmp\")\n"
  137. #define SMIR_NAMESPACE_PRAGMA L"#pragma namespace(\"\\\\\\\\.\\\\root\\\\snmp\\\\SMIR\")\n"
  138. #define START_OF_SMIR_NAMESPACE_PRAGMA L"#pragma namespace(\"\\\\\\\\.\\\\root\\\\snmp\\\\SMIR\\\\"
  139. #define END_OF_NAMESPACE_PRAGMA L"\")\n"
  140. #define OLEMS_ROOT_NAMESPACE_STR L"\\\\\\\\.\\\\root\\\\snmp"
  141. #define SMIR_NAMESPACE_STR L"\\\\\\\\.\\\\root\\\\snmp\\\\SMIR"
  142. #define READONLY_STRING (CString(L"[read] string "))
  143. #define WRITE_STRING (CString(L"[write] string "))
  144. #define WRITE_LONG (CString(L"[write] sint32 "))
  145. #define READ_ONLY_KEY_STRING (CString(L"[read, key] string "))
  146. #define READ_ONLY_REF_STRING (CString(L"[read] object ref "))
  147. #define READONLY_LONG (CString(L"[read] sint32 "))
  148. #define QUAL_FLAVOUR (CString(L":ToInstance ToSubClass DisableOverride"))
  149. #define TIMESTAMP_QUALS_TYPE (CString(L"[textual_convention(\"TimeTicks\")")\
  150. +QUAL_FLAVOUR\
  151. +CString(L",encoding(\"TimeTicks\")")\
  152. +QUAL_FLAVOUR\
  153. +CString(L",object_syntax(\"TimeTicks\")")\
  154. +QUAL_FLAVOUR\
  155. +CString(L",read,object_identifier(\"1.3.6.1.2.1.1.3\")")\
  156. +QUAL_FLAVOUR\
  157. +CString(L",description(\"The time (in hundredths of a second) since the network management portion of the agent was last re-initialized.\")")\
  158. +QUAL_FLAVOUR\
  159. +CString(L"] uint32 "))
  160. #define TRAPOID_QUALS_TYPE (CString(L"[textual_convention(\"OBJECTIDENTIFIER\")")\
  161. +QUAL_FLAVOUR\
  162. +CString(L", encoding(\"OBJECTIDENTIFIER\")")\
  163. +QUAL_FLAVOUR\
  164. +CString(L", object_syntax(\"OBJECTIDENTIFIER\")")\
  165. +QUAL_FLAVOUR\
  166. +CString(L", read, object_identifier(\"1.3.6.1.6.3.1.1.4.1\")")\
  167. +QUAL_FLAVOUR\
  168. +CString(L",description(\"The authoratative identification of this notification.\")")\
  169. +QUAL_FLAVOUR\
  170. +CString(L"] string "))
  171. #define SENDER_ADDR_QUALS_TYPE (CString(L"[read, ")\
  172. +CString(L"description(\"The network address of the entity that created this notification.\")")\
  173. +QUAL_FLAVOUR\
  174. +CString(L"] string "))
  175. #define SENDER_TADDR_QUALS_TYPE (CString(L"[read, ")\
  176. +CString(L"description(\"The network address of the entity that sent this notification. This may be a proxy for the original entity.\")")\
  177. +QUAL_FLAVOUR\
  178. +CString(L"] string "))
  179. #define TRANSPORT_QUALS_TYPE (CString(L"[read, ")\
  180. +CString(L"description(\"The transport protocol used by the sending entity.\")")\
  181. +QUAL_FLAVOUR\
  182. +CString(L"] string "))
  183. #define COMMUNITY_QUALS_TYPE (CString(L"[read, ")\
  184. +CString(L"description(\"The security context used to send this notification.\")")\
  185. +QUAL_FLAVOUR\
  186. +CString(L"] string "))
  187. #define ASSOC_QUALIFIER (CString(L"[Association]")+CString(NEWLINE_STR))
  188. #define QUALIFIER_PROPAGATION (CString(L"\
  189. qualifier write:ToInstance ToSubClass;\n\
  190. qualifier read:ToInstance ToSubClass;\n\
  191. qualifier provider:ToInstance ToSubClass;\n\
  192. qualifier singleton:ToInstance ToSubClass;\n\
  193. qualifier dynamic:ToInstance ToSubClass;\n\
  194. qualifier textual_convention:ToInstance ToSubClass;\n\
  195. qualifier object_identifier:ToInstance ToSubClass;\n\
  196. qualifier varbindindex:ToInstance ToSubClass;\n\
  197. qualifier encoding:ToInstance ToSubClass;\n\
  198. qualifier object_syntax:ToInstance ToSubClass;\n\
  199. qualifier status:ToInstance ToSubClass;\n\
  200. qualifier fixed_length:ToInstance ToSubClass;\n\
  201. qualifier variable_length:ToInstance ToSubClass;\n\
  202. qualifier variable_value:ToInstance ToSubClass;\n\
  203. qualifier bits:ToInstance ToSubClass;\n\
  204. qualifier key_order:ToInstance ToSubClass;\n\
  205. qualifier enumeration:ToInstance ToSubClass;\n\
  206. qualifier bits:ToInstance ToSubClass;\n") + \
  207. CString(L"\
  208. qualifier description:ToInstance ToSubClass;\n\
  209. qualifier display_hint:ToInstance ToSubClass;\n\
  210. qualifier defval:ToInstance ToSubClass;\n\
  211. qualifier units:ToInstance ToSubClass;\n\
  212. qualifier reference:ToInstance ToSubClass;\n\
  213. qualifier virtual_key:ToInstance ToSubClass;\n\
  214. qualifier rowstatus:ToInstance ToSubClass;\n\
  215. qualifier module_name:ToInstance ToSubClass;\n\
  216. qualifier module_imports:ToInstance ToSubClass;\n\
  217. qualifier group_objectid:ToInstance ToSubClass;\n\n"))
  218. #define INSTANCE_END (CString(ESCAPED_QUOTE_STR)\
  219. +CString(SEMICOLON_STR)\
  220. +CString(NEWLINE_STR)\
  221. +CString(CLOSE_BRACE_STR)\
  222. +CString(SEMICOLON_STR)\
  223. +CString(NEWLINE_STR))
  224. #define INSTANCE_START (CString(L"instance of "))
  225. #define END_OF_PROPERTY (CString(SEMICOLON_STR)\
  226. +CString(NEWLINE_STR))
  227. #define NL_BRACE_NL_STR (CString(NEWLINE_STR)\
  228. +CString(OPEN_BRACE_STR)\
  229. +CString(NEWLINE_STR))
  230. #define END_OF_CLASS (CString(CLOSE_BRACE_STR)\
  231. +CString(SEMICOLON_STR)\
  232. +CString(NEWLINE_STR)\
  233. +CString(NEWLINE_STR))
  234. #define END_OF_INSTANCE END_OF_CLASS
  235. #define START_OF_PROPERTY_VALUE (CString(EQUALS_STR)\
  236. +CString(QUOTE_STR))
  237. #define END_OF_PROPERTY_VALUE (CString(QUOTE_STR)\
  238. +CString(SEMICOLON_STR)\
  239. +CString(NEWLINE_STR))
  240. #define ESCAPED_QUOTE_STR L"\\\""
  241. #define ABSTRACT_CLASS_STRING L"[abstract]\nclass "
  242. #define CLASS_STRING L"class "
  243. #define SMIR_CLASS_DEFINITION (CString(CLASS_STRING)\
  244. +CString(SMIR_INSTANCE_NAME)\
  245. +CString(COLON_STR)\
  246. +CString(OLEMS_NAMESPACE_CLASS)\
  247. +CString(NEWLINE_STR)\
  248. +CString(OPEN_BRACE_STR)\
  249. +CString(NEWLINE_STR)\
  250. +CString(READONLY_STRING)\
  251. +CString(OLEMS_NAME_PROP)\
  252. +CString(EQUALS_STR)\
  253. +CString(QUOTE_STR)\
  254. +CString(SMIR_INSTANCE_NAME)\
  255. +CString(END_OF_PROPERTY_VALUE)\
  256. +CString(END_OF_CLASS))
  257. #define SMIR_INSTANCE_DEFINITION (CString(INSTANCE_START)\
  258. +CString(SMIR_INSTANCE_NAME)\
  259. +CString(NEWLINE_STR)\
  260. +CString(OPEN_BRACE_STR)\
  261. +CString(NEWLINE_STR)\
  262. +CString(END_OF_INSTANCE))
  263. #define SNMPMACRO_CLASS_START (CString(ABSTRACT_CLASS_STRING)\
  264. +CString(HMOM_SNMPMACRO_STRING)\
  265. +CString(NEWLINE_STR)\
  266. +CString(OPEN_BRACE_STR)\
  267. +CString(NEWLINE_STR))
  268. #define SNMPOBJECTTYPE_CLASS_START (CString(ABSTRACT_CLASS_STRING)\
  269. +CString(HMOM_SNMPOBJECTTYPE_STRING)\
  270. +CString(COLON_STR)\
  271. +CString(HMOM_SNMPMACRO_STRING)\
  272. +CString(NEWLINE_STR)\
  273. +CString(OPEN_BRACE_STR)\
  274. +CString(NEWLINE_STR))
  275. #define SNMPNOTIFYSTATUS_CLASS_START (CString(CLASS_STRING)\
  276. +CString(HMOM_CLASS_SNMPNOTIFYSTATUS)\
  277. +CString(COLON_STR)\
  278. +CString(HMOM_CLASS_EXTENDEDSTATUS)\
  279. +CString(NEWLINE_STR)\
  280. +CString(OPEN_BRACE_STR)\
  281. +CString(NEWLINE_STR)\
  282. +CString(WRITE_LONG)\
  283. +CString(HMOM_PROPERTY_SNMPSTATUSCODE)\
  284. +CString(SEMICOLON_STR)\
  285. +CString(NEWLINE_STR)\
  286. +CString(WRITE_STRING)\
  287. +CString(HMOM_PROPERTY_SNMPSTATUSMESSAGE)\
  288. +CString(SEMICOLON_STR)\
  289. +CString(NEWLINE_STR))
  290. #define SNMPNOTIFICATION_CLASS_START (CString(CLASS_STRING)\
  291. +CString(NOTIFICATION_CLASS_NAME)\
  292. +CString(COLON_STR)\
  293. +CString(EXTRINSIC_EVENT_CLASS_NAME)\
  294. +CString(NEWLINE_STR)\
  295. +CString(OPEN_BRACE_STR)\
  296. +CString(NEWLINE_STR))
  297. #define SNMPEXTNOTIFICATION_CLASS_START (CString(CLASS_STRING)\
  298. +CString(EXT_NOTIFICATION_CLASS_NAME)\
  299. +CString(COLON_STR)\
  300. +CString(EXTRINSIC_EVENT_CLASS_NAME)\
  301. +CString(NEWLINE_STR)\
  302. +CString(OPEN_BRACE_STR)\
  303. +CString(NEWLINE_STR))
  304. #define NOTIFICATIONMAPPER_CLASS_START (CString(CLASS_STRING)\
  305. +CString(SMIR_NOTIFICATION_MAPPER)\
  306. +CString(NEWLINE_STR)\
  307. +CString(OPEN_BRACE_STR)\
  308. +CString(NEWLINE_STR))
  309. #define EXTNOTIFICATIONMAPPER_CLASS_START (CString(CLASS_STRING)\
  310. +CString(SMIR_EXT_NOTIFICATION_MAPPER)\
  311. +CString(NEWLINE_STR)\
  312. +CString(OPEN_BRACE_STR)\
  313. +CString(NEWLINE_STR))
  314. #define MODULE_CLASS_START (CString(CLASS_STRING)\
  315. +CString(MODULE_NAMESPACE_NAME)\
  316. +CString(COLON_STR)\
  317. +CString(OLEMS_NAMESPACE_CLASS)\
  318. +CString(NEWLINE_STR)\
  319. +CString(OPEN_BRACE_STR)\
  320. +CString(NEWLINE_STR))
  321. #define MODULE_INSTANCE_START (CString(INSTANCE_START)\
  322. +CString(MODULE_NAMESPACE_NAME)\
  323. +CString(NEWLINE_STR)\
  324. +CString(OPEN_BRACE_STR)\
  325. +CString(NEWLINE_STR))
  326. #define GROUP_CLASS_START (CString(CLASS_STRING)\
  327. +CString(GROUP_NAMESPACE_NAME)\
  328. +CString(COLON_STR)\
  329. +CString(OLEMS_NAMESPACE_CLASS)\
  330. +CString(NEWLINE_STR)\
  331. +CString(OPEN_BRACE_STR)\
  332. +CString(NEWLINE_STR))
  333. #define GROUP_INSTANCE_START (CString(INSTANCE_START)\
  334. +CString(GROUP_NAMESPACE_NAME)\
  335. +CString(NEWLINE_STR)\
  336. +CString(OPEN_BRACE_STR)\
  337. +CString(NEWLINE_STR))
  338. #endif