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.

1122 lines
32 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. // Module : parser.h
  3. //
  4. // Purpose : Parse the strings and gives concerned o/p to the
  5. // related context for IPSec Implementation.
  6. //
  7. // Developers Name : N.Surendra Sai / Vunnam Kondal Rao
  8. //
  9. // History :
  10. //
  11. // Date Author Comments
  12. //
  13. //////////////////////////////////////////////////////////////////////////////
  14. #ifndef _PARSER_H_
  15. #define _PARSER_H_
  16. #include "nshipsec.h"
  17. //
  18. // All Limits
  19. //
  20. const DWORD POTF_DEFAULT_P2REKEY_TIME = 0;
  21. const DWORD POTF_DEFAULT_P2REKEY_BYTES = 0;
  22. const DWORD POTF_DEF_P1SOFT_TIME = 480*60; // seconds
  23. const DWORD POTF_DEFAULT_P1REKEY_TIME = 480*60;
  24. const DWORD POTF_DEFAULT_P1REKEY_QMS = 0;
  25. const time_t P2STORE_DEFAULT_POLLINT = 60 * 180;
  26. #define MAX_MM_AUTH_INFO 40
  27. #define P1_Min_LIFE_MIN 1 // in minutes
  28. #define P1_Min_LIFE_MAX 71582788 // in minutes
  29. #define P1_Kb_LIFE_MIN 20480 // in KB
  30. #define P1_Kb_LIFE_MAX 2147438647 // in KB
  31. #define P2_Sec_LIFE_MIN 300 // 300 in seconds
  32. #define P2_Sec_LIFE_MAX 2147438647 // 172800 in seconds
  33. #define P2_Kb_LIFE_MIN 20480 // 20480 in KB
  34. #define P2_Kb_LIFE_MAX 2147438647 // in KB
  35. #define POLLING_Min_MIN 0 // in min
  36. #define POLLING_Min_MAX 43200 // in min
  37. #define QMPERMM_MIN 0 // no. of sessions
  38. #define QMPERMM_MAX 2147483647 // no. of sessions
  39. #define MAX_PORT 65536
  40. #define MAX_EXEMPTION_ENTRIES 1024
  41. #define RETURN_NO_ERROR 9999
  42. #define PARSE_ERROR 0xFFFFFFFF
  43. #define TYPE_STRING 0
  44. #define TYPE_BOOL 1
  45. #define TYPE_DWORD 2
  46. #define TYPE_ALL 3
  47. #define TYPE_IP 4
  48. #define TYPE_CONNTYPE 5
  49. #define TYPE_PROTOCOL 6
  50. #define TYPE_PFSGROUP 7
  51. #define TYPE_VERBOSE 8
  52. #define TYPE_BOUND 9
  53. #define TYPE_TUNNEL 10
  54. #define TYPE_ACTION 11
  55. #define TYPE_RELEASE 12
  56. #define TYPE_PROPERTY 13
  57. #define TYPE_MASK 14
  58. #define TYPE_QM_OFFER 15
  59. #define TYPE_MM_OFFER 16
  60. #define TYPE_FORMAT 17
  61. #define TYPE_MODE 18
  62. #define TYPE_DNSIP 19
  63. #define TYPE_EXPORT 20
  64. #define TYPE_PORT 21
  65. #define TYPE_FILTER 22
  66. #define TYPE_STATS 23
  67. #define TYPE_ENLOGGING 24
  68. #define TYPE_USERINPUT 25
  69. #define TYPE_LOCATION 26
  70. #define TYPE_KERBAUTH 27
  71. #define TYPE_PSKAUTH 28
  72. #define TYPE_ROOTCA 29
  73. #define ARG_YES 1
  74. #define ARG_NO 2
  75. #define GROUP_CMD 1
  76. #define PRI_CMD 2
  77. #define SEC_CMD 3
  78. #define PFSGROUP_TYPE_NOPFS 0
  79. #define PFSGROUP_TYPE_P1 1
  80. #define PFSGROUP_TYPE_P2 2
  81. #define PFSGROUP_TYPE_2048 3
  82. #define PFSGROUP_TYPE_MM 4
  83. #define STR_MAX 1024
  84. #define ADD_CMD 0
  85. #define SET_CMD 1
  86. #define MAX_ARGS 100
  87. #define MAX_ARGS_LIMIT (MAX_ARGS-2) // Used in dwUsed++ checking
  88. #define MAX_STR_LEN STR_MAX
  89. #define IF_TYPE_ANY _TEXT("ANY")
  90. #define IF_TYPE_ICMP _TEXT("ICMP")
  91. #define IF_TYPE_TCP _TEXT("TCP")
  92. #define IF_TYPE_UDP _TEXT("UDP")
  93. #define IF_TYPE_RAW _TEXT("RAW")
  94. #define PROPERTY_TYPE_ENABLEDIGNO _TEXT("ipsecdiagnostics")
  95. #define PROPERTY_TYPE_IKELOG _TEXT("ikelogging")
  96. #define PROPERTY_TYPE_CRLCHK _TEXT("strongcrlcheck")
  97. #define PROPERTY_TYPE_LOGINTER _TEXT("ipsecloginterval")
  98. #define PROPERTY_TYPE_EXEMPT _TEXT("ipsecexempt")
  99. #define PROPERTY_TYPE_BOOTMODE _TEXT("bootmode")
  100. #define PROPERTY_TYPE_BOOTEXEMP _TEXT("bootexemptions")
  101. #define VALUE_TYPE_STATEFUL _TEXT("stateful")
  102. #define VALUE_TYPE_BLOCK _TEXT("block")
  103. #define VALUE_TYPE_PERMIT _TEXT("permit")
  104. #define TOKEN_STR_INBOUND _TEXT("inbound")
  105. #define TOKEN_STR_OUTBOUND _TEXT("outbound")
  106. #define TOKEN_STR_NONE _TEXT("none")
  107. #define ARG_TOKEN_STR_VERBOSE _TEXT("VERBOSE")
  108. #define ARG_TOKEN_STR_NORMAL _TEXT("NORMAL")
  109. #define TYPE_STR_LIST _TEXT("LIST")
  110. #define TYPE_STR_TABLE _TEXT("TABLE")
  111. #define TYPE_STR_TUNNEL _TEXT("TUNNEL")
  112. #define TYPE_STR_TRANSPORT _TEXT("TRANSPORT")
  113. #define PFS_TYPE_NOPFS _TEXT("NOPFS")
  114. #define PFS_TYPE_P1 _TEXT("GRP1")
  115. #define PFS_TYPE_P2 _TEXT("GRP2")
  116. #define PFS_TYPE_P3 _TEXT("GRP3")
  117. #define PFS_TYPE_MM _TEXT("GRPMM")
  118. #define IF_TYPE_ALL _TEXT("ALL")
  119. #define IF_TYPE_LAN _TEXT("LAN")
  120. #define IF_TYPE_DIALUP _TEXT("DIALUP")
  121. #define IF_TYPE_MAX _TEXT("MAX")
  122. #define LOC_TYPE_PERSISTENT _TEXT("PERSISTENT")
  123. #define LOC_TYPE_LOCAL _TEXT("LOCAL")
  124. #define LOC_TYPE_DOMAIN _TEXT("DOMAIN")
  125. #define EXPORT_IPSEC _TEXT(".ipsec")
  126. #define TOKEN_LOCAL _TEXT("local")
  127. #define DEFAULT_STR _TEXT("default")
  128. //
  129. // Token names starts here
  130. //
  131. #define CMD_TOKEN_STR_NAME _TEXT("name")
  132. #define CMD_TOKEN_STR_DESCR _TEXT("description")
  133. #define CMD_TOKEN_STR_MMPFS _TEXT("mmpfs")
  134. #define CMD_TOKEN_STR_DEFAULTRULE _TEXT("defaultrule")
  135. #define CMD_TOKEN_STR_PI _TEXT("pollinginterval")
  136. #define CMD_TOKEN_STR_ASSIGN _TEXT("assign")
  137. #define CMD_TOKEN_STR_FILTERLIST _TEXT("filterlist")
  138. #define CMD_TOKEN_STR_NEWNAME _TEXT("newname")
  139. #define CMD_TOKEN_STR_MMSECMETHODS _TEXT("mmsecmethods")
  140. #define CMD_TOKEN_STR_SRCADDR _TEXT("srcaddr/srcdns")
  141. #define CMD_TOKEN_STR_DSTADDR _TEXT("dstaddr/dstdns")
  142. #define CMD_TOKEN_STR_PROTO _TEXT("protocol")
  143. #define CMD_TOKEN_STR_QMSECMETHODS _TEXT("qmsecmethods")
  144. #define CMD_TOKEN_STR_QMPFS _TEXT("qmpfs")
  145. #define CMD_TOKEN_STR_INPASS _TEXT("inpass")
  146. #define CMD_TOKEN_STR_SOFT _TEXT("soft")
  147. #define CMD_TOKEN_STR_POLICY _TEXT("policy")
  148. #define CMD_TOKEN_STR_TUNNEL _TEXT("tunnelIP/tunnelDNS")
  149. #define CMD_TOKEN_STR_CONNTYPE _TEXT("conntype")
  150. #define CMD_TOKEN_STR_ACTIVATE _TEXT("activate")
  151. #define CMD_TOKEN_STR_KERB _TEXT("kerberos")
  152. #define CMD_TOKEN_STR_PSK _TEXT("psk")
  153. #define CMD_TOKEN_STR_ROOTCA _TEXT("rootca")
  154. #define CMD_TOKEN_STR_MACHINE _TEXT("machine")
  155. #define CMD_TOKEN_STR_LOCATION _TEXT("location")
  156. #define CMD_TOKEN_STR_DS _TEXT("domain")
  157. #define CMD_TOKEN_STR_FILE _TEXT("file")
  158. #define CMD_TOKEN_STR_RULE _TEXT("rule")
  159. #define CMD_TOKEN_STR_VERBOSE _TEXT("level")
  160. #define CMD_TOKEN_STR_ID _TEXT("id")
  161. #define CMD_TOKEN_STR_FILTERACTION _TEXT("filteraction")
  162. #define CMD_TOKEN_STR_QMPERMM _TEXT("qmpermm")
  163. #define CMD_TOKEN_STR_ALL _TEXT("all")
  164. #define CMD_TOKEN_STR_SRCMASK _TEXT("srcmask")
  165. #define CMD_TOKEN_STR_DSTMASK _TEXT("dstmask")
  166. #define CMD_TOKEN_STR_MIRROR _TEXT("mirrored")
  167. #define CMD_TOKEN_STR_SRCPORT _TEXT("srcport")
  168. #define CMD_TOKEN_STR_DSTPORT _TEXT("dstport")
  169. #define CMD_TOKEN_STR_ACTIVATEDEFRULE _TEXT("activatedefaultrule")
  170. #define CMD_TOKEN_STR_GPONAME _TEXT("gponame")
  171. #define CMD_TOKEN_STR_DEFRESPONSE _TEXT("defaultresponse")
  172. #define CMD_TOKEN_STR_SOFTSAEXPTIME _TEXT("softsaexpirationtime")
  173. #define CMD_TOKEN_STR_OUTBOUND _TEXT("actionoutbound")
  174. #define CMD_TOKEN_STR_INBOUND _TEXT("actioninbound")
  175. #define CMD_TOKEN_STR_MMFILTER _TEXT("mmfilter")
  176. #define CMD_TOKEN_STR_LOGLEVEL _TEXT("loglevel")
  177. #define CMD_TOKEN_STR_EXEMPT _TEXT("exempt")
  178. #define CMD_TOKEN_STR_INTERVAL _TEXT("interval")
  179. #define CMD_TOKEN_STR_LOG _TEXT("log")
  180. #define CMD_TOKEN_STR_LOCAL _TEXT("local")
  181. #define CMD_TOKEN_STR_CRL _TEXT("crl")
  182. #define CMD_TOKEN_STR_MODE _TEXT("mode")
  183. #define CMD_TOKEN_STR_PFSGROUP _TEXT("pfsgroup")
  184. #define CMD_TOKEN_STR_TUNNELDST _TEXT("tunneldstaddress")
  185. #define CMD_TOKEN_STR_NEGOTIATION _TEXT("qmsecmethods")
  186. #define CMD_TOKEN_STR_VALUE _TEXT("value")
  187. #define CMD_TOKEN_STR_MMPOLICY _TEXT("mmpolicy")
  188. #define CMD_TOKEN_STR_QMPOLICY _TEXT("qmpolicy")
  189. #define CMD_TOKEN_STR_FORMAT _TEXT("format")
  190. #define CMD_TOKEN_STR_TYPE _TEXT("type")
  191. #define CMD_TOKEN_STR_MMLIFETIME _TEXT("mmlifetime")
  192. #define CMD_TOKEN_STR_GUID _TEXT("guid")
  193. #define CMD_TOKEN_STR_ACTION _TEXT("action")
  194. #define CMD_TOKEN_STR_RELEASE _TEXT("release")
  195. #define CMD_TOKEN_STR_PROPERTY _TEXT("property")
  196. #define CMD_TOKEN_STR_RESDNS _TEXT("resolvedns")
  197. #define CMD_TOKEN_STR_WIDE _TEXT("wide")
  198. #define CMD_TOKEN_STR_CERTTOMAP _TEXT("certmapping")
  199. #define CMD_TOKEN_STR_FAILMMIFEXISTS _TEXT("forcemmfilter")
  200. #define CMD_TOKEN_STR_ENABLE _TEXT("enable")
  201. #define CMD_TOKEN_STR_USERINPUT _TEXT("userinput")
  202. #define TOKEN_FIELD_DELIMITER _TEXT(":")
  203. #define TOKEN_TUPLE_DELIMITER _TEXT(" \t")
  204. #define CMD_TOKEN_NAME 1
  205. #define CMD_TOKEN_DESCR 2
  206. #define CMD_TOKEN_MMPFS 3
  207. #define CMD_TOKEN_RESDNS 4
  208. #define CMD_TOKEN_WIDE 5
  209. #define CMD_TOKEN_PI 6
  210. #define CMD_TOKEN_QMPERMM 7
  211. #define CMD_TOKEN_ASSIGN 8
  212. #define CMD_TOKEN_FILTERLIST 9
  213. #define CMD_TOKEN_MMSECMETHODS 10
  214. #define CMD_TOKEN_SRCADDR 11
  215. #define CMD_TOKEN_DSTADDR 12
  216. #define CMD_TOKEN_PROTO 13
  217. #define CMD_TOKEN_QMSECMETHODS 14
  218. #define CMD_TOKEN_QMPFS 15
  219. #define CMD_TOKEN_INPASS 16
  220. #define CMD_TOKEN_SOFT 17
  221. #define CMD_TOKEN_POLICY 18
  222. #define CMD_TOKEN_TUNNEL 19
  223. #define CMD_TOKEN_CONNTYPE 20
  224. #define CMD_TOKEN_ACTIVATE 21
  225. #define CMD_TOKEN_AUTHMETHODS 22
  226. #define CMD_TOKEN_LOCATION 23
  227. #define CMD_TOKEN_DS 24
  228. #define CMD_TOKEN_FILE 25
  229. #define CMD_TOKEN_RULE 26
  230. #define CMD_TOKEN_VERBOSE 27
  231. #define CMD_TOKEN_ID 28
  232. #define CMD_TOKEN_FILTERACTION 29
  233. #define CMD_TOKEN_NEWNAME 30
  234. #define CMD_TOKEN_ALL 31
  235. #define CMD_TOKEN_SRCMASK 32
  236. #define CMD_TOKEN_DSTMASK 33
  237. #define CMD_TOKEN_MIRROR 34
  238. #define CMD_TOKEN_SRCPORT 35
  239. #define CMD_TOKEN_DSTPORT 36
  240. #define CMD_TOKEN_KBLIFETIME 37
  241. #define CMD_TOKEN_ACTIVATEDEFRULE 38
  242. #define CMD_TOKEN_GPONAME 39
  243. #define CMD_TOKEN_DEFRESPONSE 40
  244. #define CMD_TOKEN_SOFTSAEXPTIME 41
  245. #define CMD_TOKEN_INBOUND 42
  246. #define CMD_TOKEN_OUTBOUND 43
  247. #define CMD_TOKEN_MMFILTER 44
  248. #define CMD_TOKEN_LOGLEVEL 45
  249. #define CMD_TOKEN_EXEMPT 46
  250. #define CMD_TOKEN_INTERVAL 47
  251. #define CMD_TOKEN_LOG 48
  252. #define CMD_TOKEN_LOCAL 49
  253. #define CMD_TOKEN_CRL 50
  254. #define CMD_TOKEN_MODE 51
  255. #define CMD_TOKEN_PFSGROUP 52
  256. #define CMD_TOKEN_TUNNELDST 54
  257. #define CMD_TOKEN_NEGOTIATION 55
  258. #define CMD_TOKEN_VALUE 56
  259. #define CMD_TOKEN_MMPOLICY 57
  260. #define CMD_TOKEN_QMPOLICY 58
  261. #define CMD_TOKEN_FORMAT 59
  262. #define CMD_TOKEN_TYPE 60
  263. #define CMD_TOKEN_MMLIFETIME 61
  264. #define CMD_TOKEN_GUID 62
  265. #define CMD_TOKEN_ACTION 63
  266. #define CMD_TOKEN_RELEASE 64
  267. #define CMD_TOKEN_PROPERTY 65
  268. #define CMD_TOKEN_CERTTOMAP 66
  269. #define CMD_TOKEN_FAILMMIFEXISTS 67
  270. #define CMD_TOKEN_ENABLE 68
  271. #define CMD_TOKEN_USERINPUT 69
  272. #define CMD_TOKEN_KERB 70
  273. #define CMD_TOKEN_PSK 71
  274. #define CMD_TOKEN_ROOTCA 72
  275. #define SIZEOF_TOKEN_VALUE(_x) ( sizeof(_x) / sizeof(TOKEN_VALUE) )
  276. #define SIZEOF_TAG_TYPE(_x) ( sizeof(_x) / sizeof(TAG_TYPE) )
  277. #define SIZEOF_TAG_NEEDED(_x) ( sizeof(_x) / sizeof(TAG_NEEDED) )
  278. #define CONTEXT_NULL 0
  279. #define CONTEXT_IPSEC 1
  280. #define VALID_TOKEN 0xFFFFFFFF
  281. #define INVALID_TOKEN 0
  282. #define GROUP_NULL 0
  283. #define GROUP_STATIC 1
  284. #define GROUP_DYNAMIC 2
  285. #define PRI_NULL 0
  286. #define PRI_ADD 1
  287. #define PRI_SET 2
  288. #define PRI_DELETE 3
  289. #define PRI_SHOW 4
  290. #define PRI_EXPORTPOLICY 5
  291. #define PRI_IMPORTPOLICY 6
  292. #define PRI_RESTOREDEFAULTS 7
  293. #define PRI_CHECKINTEGRITY 8
  294. #define SEC_NULL 0
  295. #define SEC_POLICY 1
  296. #define SEC_FILTER 2
  297. #define SEC_FILTERLIST 3
  298. #define SEC_FILTERACTION 4
  299. #define SEC_RULE 5
  300. #define SEC_ALL 6
  301. #define SEC_STORE 7
  302. #define SEC_DEFAULTRULE 8
  303. #define SEC_ASSIGNEDPOLICY 9
  304. #define SEC_INTERACTIVE 10
  305. #define SEC_MMPOLICY 11
  306. #define SEC_MMFILTER 12
  307. #define SEC_QMPOLICY 13
  308. #define SEC_QMFILTER 14
  309. #define SEC_STATS 15
  310. #define SEC_MMSAS 16
  311. #define SEC_QMSAS 17
  312. #define SEC_CONFIG 18
  313. #define SEC_BATCH 19
  314. #define SEC_EXTENDLOG 20
  315. #define CON_IPSEC_STR _TEXT("ipsec")
  316. #define GROUP_STATIC_STR _TEXT("static")
  317. #define GROUP_DYNAMIC_STR _TEXT("dynamic")
  318. #define PRI_ADD_STR _TEXT("add")
  319. #define PRI_SET_STR _TEXT("set")
  320. #define PRI_DELETE_STR _TEXT("delete")
  321. #define PRI_SHOW_STR _TEXT("show")
  322. #define PRI_EXPORTPOLICY_STR _TEXT("exportpolicy")
  323. #define PRI_IMPORTPOLICY_STR _TEXT("importpolicy")
  324. #define PRI_RESTOREDEFAULTS_STR _TEXT("restorepolicyexamples")
  325. #define SEC_POLICY_STR _TEXT("policy")
  326. #define SEC_ASSIGNEDPOLICY_STR _TEXT("gpoassignedpolicy")
  327. #define SEC_FILTERLIST_STR _TEXT("filterlist")
  328. #define SEC_FILTER_STR _TEXT("filter")
  329. #define SEC_FILTERACTION_STR _TEXT("filteraction")
  330. #define SEC_RULE_STR _TEXT("rule")
  331. #define SEC_ALL_STR _TEXT("all")
  332. #define SEC_STORE_STR _TEXT("store")
  333. #define SEC_DEFAULTRULE_STR _TEXT("defaultrule")
  334. #define SEC_INTERACTIVE_STR _TEXT("interactive")
  335. #define SEC_BATCH_STR _TEXT("batch")
  336. #define SEC_MMPOLICY_STR _TEXT("mmpolicy")
  337. #define SEC_MMFILTER_STR _TEXT("mmfilter")
  338. #define SEC_QMFILTER_STR _TEXT("qmfilter")
  339. #define SEC_QMPOLICY_STR _TEXT("qmpolicy")
  340. #define SEC_STATS_STR _TEXT("stats")
  341. #define SEC_MMSAS_STR _TEXT("mmsas")
  342. #define SEC_QMSAS_STR _TEXT("qmsas")
  343. #define SEC_CONFIG_STR _TEXT("config")
  344. #define DEFAULT_MMSECMETHODS _TEXT("3DES-SHA1-2 3DES-MD5-2 3DES-SHA1-3")
  345. #define DEFAULT_AUTHMETHODS _TEXT("")
  346. #define DEFAULT_QMSECMETHODS _TEXT("ESP[3DES,SHA1] ESP[3DES,MD5]")
  347. #define C_BASE 10000 // Context Base
  348. #define G_BASE 1000 // Group Base
  349. #define P_BASE 100 // Primary Command Base
  350. #define S_BASE 1 // Secondary Command Base
  351. #define INDEX(_g,_p,_s) (C_BASE+_g*G_BASE+_p*P_BASE+_s*S_BASE)
  352. #define STATIC_EXPORTPOLICY INDEX(GROUP_STATIC,PRI_EXPORTPOLICY,SEC_NULL)
  353. #define STATIC_IMPORTPOLICY INDEX(GROUP_STATIC,PRI_IMPORTPOLICY,SEC_NULL)
  354. #define STATIC_RESTOREDEFAULTS INDEX(GROUP_STATIC,PRI_RESTOREDEFAULTS,SEC_NULL)
  355. #define STATIC_ADD_POLICY INDEX(GROUP_STATIC,PRI_ADD,SEC_POLICY)
  356. #define STATIC_ADD_FILTER INDEX(GROUP_STATIC,PRI_ADD,SEC_FILTER)
  357. #define STATIC_ADD_FILTERLIST INDEX(GROUP_STATIC,PRI_ADD,SEC_FILTERLIST)
  358. #define STATIC_ADD_FILTERACTION INDEX(GROUP_STATIC,PRI_ADD,SEC_FILTERACTION)
  359. #define STATIC_ADD_RULE INDEX(GROUP_STATIC,PRI_ADD,SEC_RULE)
  360. #define STATIC_SET_POLICY INDEX(GROUP_STATIC,PRI_SET,SEC_POLICY)
  361. #define STATIC_SET_FILTERLIST INDEX(GROUP_STATIC,PRI_SET,SEC_FILTERLIST)
  362. #define STATIC_SET_FILTERACTION INDEX(GROUP_STATIC,PRI_SET,SEC_FILTERACTION)
  363. #define STATIC_SET_RULE INDEX(GROUP_STATIC,PRI_SET,SEC_RULE)
  364. #define STATIC_SET_DEFAULTRULE INDEX(GROUP_STATIC,PRI_SET,SEC_DEFAULTRULE)
  365. #define STATIC_SET_STORE INDEX(GROUP_STATIC,PRI_SET,SEC_STORE)
  366. #define STATIC_SET_INTERACTIVE INDEX(GROUP_STATIC,PRI_SET,SEC_INTERACTIVE)
  367. #define STATIC_SET_BATCH INDEX(GROUP_STATIC,PRI_SET,SEC_BATCH)
  368. #define STATIC_DELETE_POLICY INDEX(GROUP_STATIC,PRI_DELETE,SEC_POLICY)
  369. #define STATIC_DELETE_FILTER INDEX(GROUP_STATIC,PRI_DELETE,SEC_FILTER)
  370. #define STATIC_DELETE_FILTERLIST INDEX(GROUP_STATIC,PRI_DELETE,SEC_FILTERLIST)
  371. #define STATIC_DELETE_FILTERACTION INDEX(GROUP_STATIC,PRI_DELETE,SEC_FILTERACTION)
  372. #define STATIC_DELETE_RULE INDEX(GROUP_STATIC,PRI_DELETE,SEC_RULE)
  373. #define STATIC_DELETE_ALL INDEX(GROUP_STATIC,PRI_DELETE,SEC_ALL)
  374. #define STATIC_SHOW_POLICY INDEX(GROUP_STATIC,PRI_SHOW,SEC_POLICY)
  375. #define STATIC_SHOW_FILTERLIST INDEX(GROUP_STATIC,PRI_SHOW,SEC_FILTERLIST)
  376. #define STATIC_SHOW_FILTERACTION INDEX(GROUP_STATIC,PRI_SHOW,SEC_FILTERACTION)
  377. #define STATIC_SHOW_RULE INDEX(GROUP_STATIC,PRI_SHOW,SEC_RULE)
  378. #define STATIC_SHOW_DEFAULTRULE INDEX(GROUP_STATIC,PRI_SHOW,SEC_DEFAULTRULE)
  379. #define STATIC_SHOW_STORE INDEX(GROUP_STATIC,PRI_SHOW,SEC_STORE)
  380. #define STATIC_SHOW_ALL INDEX(GROUP_STATIC,PRI_SHOW,SEC_ALL)
  381. #define STATIC_SHOW_ASSIGNEDPOLICY INDEX(GROUP_STATIC,PRI_SHOW,SEC_ASSIGNEDPOLICY)
  382. #define DYNAMIC_ADD_MMPOLICY INDEX(GROUP_DYNAMIC,PRI_ADD,SEC_MMPOLICY)
  383. #define DYNAMIC_ADD_FILTERACTION INDEX(GROUP_DYNAMIC,PRI_ADD,SEC_QMPOLICY)
  384. #define DYNAMIC_ADD_RULE INDEX(GROUP_DYNAMIC,PRI_ADD,SEC_RULE)
  385. #define DYNAMIC_SET_MMPOLICY INDEX(GROUP_DYNAMIC,PRI_SET,SEC_MMPOLICY)
  386. #define DYNAMIC_SET_FILTERACTION INDEX(GROUP_DYNAMIC,PRI_SET,SEC_QMPOLICY)
  387. #define DYNAMIC_SET_RULE INDEX(GROUP_DYNAMIC,PRI_SET,SEC_RULE)
  388. #define DYNAMIC_SET_CONFIG INDEX(GROUP_DYNAMIC,PRI_SET,SEC_CONFIG)
  389. #define DYNAMIC_SHOW_MMPOLICY INDEX(GROUP_DYNAMIC,PRI_SHOW,SEC_MMPOLICY)
  390. #define DYNAMIC_SHOW_MMFILTER INDEX(GROUP_DYNAMIC,PRI_SHOW,SEC_MMFILTER)
  391. #define DYNAMIC_SHOW_FILTERACTION INDEX(GROUP_DYNAMIC,PRI_SHOW,SEC_QMPOLICY)
  392. #define DYNAMIC_SHOW_QMFILTER INDEX(GROUP_DYNAMIC,PRI_SHOW,SEC_QMFILTER)
  393. #define DYNAMIC_SHOW_STATS INDEX(GROUP_DYNAMIC,PRI_SHOW,SEC_STATS)
  394. #define DYNAMIC_SHOW_MMSAS INDEX(GROUP_DYNAMIC,PRI_SHOW,SEC_MMSAS)
  395. #define DYNAMIC_SHOW_QMSAS INDEX(GROUP_DYNAMIC,PRI_SHOW,SEC_QMSAS)
  396. #define DYNAMIC_SHOW_ALL INDEX(GROUP_DYNAMIC,PRI_SHOW,SEC_ALL)
  397. #define DYNAMIC_SHOW_AUTHMETHODS INDEX(GROUP_DYNAMIC,PRI_SHOW,SEC_AUTHMETHODS)
  398. #define DYNAMIC_SHOW_RULE INDEX(GROUP_DYNAMIC,PRI_SHOW,SEC_RULE)
  399. #define DYNAMIC_SHOW_CONFIG INDEX(GROUP_DYNAMIC,PRI_SHOW,SEC_CONFIG)
  400. #define DYNAMIC_DELETE_MMPOLICY INDEX(GROUP_DYNAMIC,PRI_DELETE,SEC_MMPOLICY)
  401. #define DYNAMIC_DELETE_FILTERACTION INDEX(GROUP_DYNAMIC,PRI_DELETE,SEC_QMPOLICY)
  402. #define DYNAMIC_DELETE_RULE INDEX(GROUP_DYNAMIC,PRI_DELETE,SEC_RULE)
  403. #define DYNAMIC_DELETE_ALL INDEX(GROUP_DYNAMIC,PRI_DELETE,SEC_ALL)
  404. #define IPAddr unsigned long
  405. #define DEFAULT_CERTMAP_OPTION FALSE
  406. #define CERTMAP_STR _TEXT("certmap")
  407. #define QMSEC_PERMIT_STR _TEXT("PERMIT")
  408. #define QMSEC_BLOCK_STR _TEXT("BLOCK")
  409. #define QMSEC_NEGOTIATE_STR _TEXT("NEGOTIATE")
  410. #define FILTER_TYPE_GENERIC_STR _TEXT("GENERIC")
  411. #define FILTER_TYPE_SPECIFIC_STR _TEXT("SPECIFIC")
  412. #define RELEASE_DOTNET_STR _TEXT("win2003")
  413. #define RELEASE_WIN2K_STR _TEXT("WIN2K")
  414. #define STATS_ALL_STR _TEXT("ALL")
  415. #define STATS_IKE_STR _TEXT("IKE")
  416. #define STATS_IPSEC_STR _TEXT("IPSEC")
  417. #define SERVER_WINS_STR _TEXT("WINS")
  418. #define SERVER_DHCP_STR _TEXT("DHCP")
  419. #define SERVER_DNS_STR _TEXT("DNS")
  420. #define SERVER_GATEWAY_STR _TEXT("GATEWAY")
  421. #define IP_ME_STR _TEXT("ME")
  422. #define IP_ANY_STR _TEXT("ANY")
  423. #define YES_STR _TEXT("yes")
  424. #define NO_STR _TEXT("no")
  425. #define Y_STR _TEXT("y")
  426. #define N_STR _TEXT("n")
  427. #define ALL_STR _TEXT("all")
  428. #define ERRMSG_NAMEALL _TEXT("Name or ALL")
  429. #define ERRMSG_NAMEGUID _TEXT("Name or Guid")
  430. #define ERRMSG_NAMERULEALL _TEXT("Name or Rule or ALL")
  431. #define ERRMSG_NAMEIDALL _TEXT("Name or Id or ALL")
  432. #define ERRMSG_NAMEID _TEXT("Name or ID")
  433. #define ERRMSG_NAME _TEXT("Name")
  434. #define ERRMSG_ALLSRCDSTADDR _TEXT("All or Srcaddr or Dstaddr")
  435. #define ERRMSG_GETLASTERROR _TEXT("Parser PreprocessCommand() error\n")
  436. #define TOKEN_QMSEC_PERMIT 1
  437. #define TOKEN_QMSEC_BLOCK 2
  438. #define TOKEN_QMSEC_NEGOTIATE 3
  439. #define TOKEN_RELEASE_DOTNET 1
  440. #define TOKEN_RELEASE_WIN2K 2
  441. #define FILTER_GENERIC 1
  442. #define FILTER_SPECIFIC 2
  443. #define TYPE_TRANSPORT_FILTER 1
  444. #define TYPE_TUNNEL_FILTER 2
  445. #define STATS_ALL 1
  446. #define STATS_IKE 2
  447. #define STATS_IPSEC 3
  448. #define USERINPUT_YES 1
  449. #define USERINPUT_NO 2
  450. #define USERINPUT_DEFAULT 3
  451. #define SERVER_WINS 1
  452. #define SERVER_DHCP 2
  453. #define SERVER_DNS 3
  454. #define SERVER_GATEWAY 4
  455. #define IP_ME 5
  456. #define IP_ANY 6
  457. #define NOT_SPLSERVER VALID_TOKEN
  458. #define POTF_P1_TOKEN _TEXT('-')
  459. #define POTF_NEGPOL_CLOSE _TEXT(']')
  460. #define POTF_REKEY_TOKEN _TEXT('/')
  461. #define POTF_NEGPOL_DES _TEXT("DES")
  462. #define POTF_NEGPOL_3DES _TEXT("3DES")
  463. #define POTF_NEGPOL_SHA1 _TEXT("SHA1")
  464. #define POTF_NEGPOL_MD5 _TEXT("MD5")
  465. #define POTF_NEGPOL_NONE _TEXT("NONE")
  466. #define POTF_NEGPOL_ESP _TEXT("ESP")
  467. #define POTF_NEGPOL_AH _TEXT("AH")
  468. #define POTF_P1_DES _TEXT("DES")
  469. #define POTF_P1_3DES _TEXT("3DES")
  470. #define POTF_P1_SHA1 _TEXT("SHA1")
  471. #define POTF_P1_MD5 _TEXT("MD5")
  472. #define POTF_ME_TUNNEL _TEXT("0")
  473. #define POTF_PT_TOKEN _TEXT(':')
  474. #define POTF_MASK_TOKEN _TEXT('/')
  475. #define POTF_OAKAUTH_PRESHARE _TEXT("psk=")
  476. #define POTF_OAKAUTH_CERT _TEXT("rootca=")
  477. #define POTF_OAKAUTH_KERBEROS _TEXT("kerberos")
  478. #define POTF_NEGPOL_OPEN _TEXT('[')
  479. #define POTF_NEGPOL_AND _TEXT('+')
  480. #define POTF_NEGPOL_PFS _TEXT('P')
  481. #define POTF_ESPTRANS_TOKEN _TEXT(',')
  482. #define POTF_OAKAUTH_TOKEN _TEXT('=')
  483. #define POTF_OAKLEY_GROUP1 DH_GROUP_1
  484. #define POTF_OAKLEY_GROUP2 DH_GROUP_2
  485. #define POTF_OAKLEY_GROUP2048 DH_GROUP_2048
  486. #define OFFER_SEPARATOR _TEXT(" \t") // ForQMSEC/MMSEC
  487. #define VALID_HEXIP _TEXT("0123456789.xXaAbBcCdDeEfF")
  488. //
  489. // Define the error codes
  490. //
  491. #define T2P_OK ((DWORD)0x0BBB0001L)
  492. #define T2P_PASSTHRU_NOT_CLOSED ((DWORD)0xCBBB0002L)
  493. #define T2P_DROP_NOT_CLOSED ((DWORD)0xCBBB0003L)
  494. #define T2P_AHESP_INVALID ((DWORD)0xCBBB0004L)
  495. #define T2P_ENCODE_FAILED ((DWORD)0xCBBB0005L)
  496. #define T2P_NULL_STRING ((DWORD)0xCBBB0006L)
  497. #define T2P_DNSLOOKUP_FAILED ((DWORD)0xCBBB0007L)
  498. #define T2P_INVALID_ADDR ((DWORD)0xCBBB0008L)
  499. #define T2P_GENERAL_PARSE_ERROR ((DWORD)0xCBBB0009L)
  500. #define T2P_INVALID_P2REKEY_UNIT ((DWORD)0xCBBB000AL)
  501. #define T2P_INVALID_HASH_ALG ((DWORD)0xCBBB000BL)
  502. #define T2P_DUP_ALGS ((DWORD)0xCBBB000CL)
  503. #define T2P_NONE_NONE ((DWORD)0xCBBB000EL)
  504. #define T2P_INCOMPLETE_ESPALGS ((DWORD)0xCBBB000FL)
  505. #define T2P_INVALID_IPSECPROT ((DWORD)0xCBBB0010L)
  506. #define T2P_NO_PRESHARED_KEY ((DWORD)0xCBBB0011L)
  507. #define T2P_INVALID_AUTH_METHOD ((DWORD)0xCBBB0012L)
  508. #define T2P_INVALID_P1GROUP ((DWORD)0xCBBB0013L)
  509. #define T2P_P1GROUP_MISSING ((DWORD)0xCBBB0014L)
  510. #define T2P_INVALID_P1REKEY_UNIT ((DWORD)0xCBBB0015L)
  511. #define T2P_P2REKEY_TOO_LOW ((DWORD)0xCBBB0016L)
  512. #define T2P_P2_SECLIFE_INVALID ((DWORD)0xCBBB0017L)
  513. #define T2P_P2_KBLIFE_INVALID ((DWORD)0xCBBB0018L)
  514. #define T2P_P2_KS_INVALID ((DWORD)0xCBBB0019L)
  515. #define T2P_INVALID_MASKADDR ((DWORD)0xCBBB001AL)
  516. #define IP_MASK_ERROR ((DWORD)0xCBBB0020L)
  517. #define IP_DECODE_ERROR ((DWORD)0xCBBB0021L)
  518. #define T2P_SUCCESS(Status) ((int)Status == T2P_OK)
  519. #define NOT_FOUND_TAG 0
  520. #define FOUND_NON_LIST_TAG 1
  521. #define FOUND_LIST_TAG 2
  522. //
  523. // ERROR #define from the Parser Context
  524. //
  525. #define WIN32_ERR 0 // Error Types
  526. #define IPSEC_ERR 1 // Error Types
  527. //
  528. // Protocol IDs
  529. //
  530. const DWORD PROT_ID_ANY = 0;
  531. const DWORD PROT_ID_ICMP = 1;
  532. const DWORD PROT_ID_TCP = 6;
  533. const DWORD PROT_ID_EGP = 8;
  534. const DWORD PROT_ID_UDP = 17;
  535. const DWORD PROT_ID_HMP = 20;
  536. const DWORD PROT_ID_XNS_IDP = 22;
  537. const DWORD PROT_ID_RDP = 27;
  538. const DWORD PROT_ID_RVD = 66;
  539. const DWORD PROT_ID_RAW = 255;
  540. const PROPERTY_ENABLEDIGNO = 1;
  541. const PROPERTY_IKELOG = 2;
  542. const PROPERTY_CRLCHK = 3;
  543. const PROPERTY_LOGINTER = 4;
  544. const PROPERTY_EXEMPT = 5;
  545. const PROPERTY_BOOTMODE = 6;
  546. const PROPERTY_BOOTEXEMP = 7;
  547. const VALUE_STATEFUL = 3;
  548. const VALUE_BLOCK = 1;
  549. const VALUE_PERMIT = 0;
  550. #define BOOTMODE_DEFAULT VALUE_PERMIT
  551. #define EXEMPT_ENTRY_TYPE_DEFAULT 0x00000001;
  552. #define EXEMPT_ENTRY_SIZE_DEFAULT 0x00000010;
  553. typedef struct _ERROR_TO_RC
  554. {
  555. DWORD dwErrCode; // Ipsec Error Code
  556. DWORD dwRcCode; // Corresponding Error String ID in .RC
  557. } ERROR_TO_RC;
  558. typedef struct _CMD_PKT
  559. {
  560. DWORD dwCmdToken; // ID of Info String
  561. VOID *pArg; // Arg Pointer
  562. DWORD dwStatus; // For Non-List Commands Status Return Code ( 0 == Ok , N = ERR Code)
  563. // For List Commands Status Return Code ( 0 == Err, N= Num of List Args)
  564. } CMD_PKT, *PCMD_PKT;
  565. typedef struct _DNSIPADDR
  566. {
  567. LPTSTR pszDomainName;
  568. DWORD dwNumIpAddresses;
  569. PULONG puIpAddr;
  570. }DNSIPADDR, *PDNSIPADDR;
  571. typedef struct _TAG_NEEDED
  572. {
  573. LPCWSTR lpwstrTagName; // Name of the needed TAG
  574. DWORD dwTagFlag; // TAG_NEEDED
  575. // TAG_GROUP1 ... TAG_GROUP#n
  576. } TAG_NEEDED, *PTAG_NEEDED;
  577. typedef struct _PARSER_PKT
  578. {
  579. const TAG_TYPE *ValidCmd;
  580. const TOKEN_VALUE *ValidTok;
  581. const TOKEN_VALUE *ValidList;
  582. TAG_NEEDED *TagNeeded;
  583. CMD_PKT Cmd[MAX_ARGS];
  584. DWORD MaxTok;
  585. DWORD MaxCmd;
  586. DWORD MaxList;
  587. DWORD MaxTag;
  588. }PARSER_PKT,*PPARSER_PKT;
  589. //
  590. // local structures defined to support cert mapping, since parser gives
  591. // the same (SPD) structure for both static and dynamic contexts
  592. //
  593. typedef struct _STA_MM_AUTH_METHODS
  594. {
  595. DWORD dwSequence;
  596. BOOL bCertMappingSpecified;
  597. BOOL bCertMapping;
  598. BOOL bCRPExclude;
  599. PINT_IPSEC_MM_AUTH_INFO pAuthenticationInfo; // SPD Auth structure
  600. } STA_MM_AUTH_METHODS, * PSTA_MM_AUTH_METHODS;
  601. typedef struct _STA_AUTH_METHODS
  602. {
  603. GUID gMMAuthID;
  604. DWORD dwFlags;
  605. DWORD dwNumAuthInfos; //count of auth methods
  606. PSTA_MM_AUTH_METHODS pAuthMethodInfo;
  607. } STA_AUTH_METHODS, * PSTA_AUTH_METHODS;
  608. DWORD
  609. Parser(
  610. IN LPCWSTR pwszMachine,
  611. IN LPTSTR *ppwcArguments,
  612. IN DWORD dwCurrentIndex,
  613. IN DWORD dwArgCount,
  614. IN OUT PARSER_PKT *pParser
  615. );
  616. DWORD
  617. LoadParserOutput(
  618. OUT PARSER_PKT *pParser,
  619. IN DWORD dwCount,
  620. OUT DWORD *dwUsed,
  621. IN LPTSTR str,
  622. IN DWORD dwTagType,
  623. IN DWORD dwConversionType
  624. );
  625. DWORD
  626. RemoveList(
  627. IN LPWSTR *ppwcArguments,
  628. IN DWORD dwArgCount,
  629. IN DWORD dwCurrentIndex,
  630. IN PARSER_PKT *pParser,
  631. IN LPTSTR pwcListCmd,
  632. IN LPTSTR szAnotherList, // Another ListCmd also present ...
  633. OUT LPTSTR pwcListArgs,
  634. OUT LPTSTR *pptok,
  635. IN DWORD dwInputAllocLen
  636. );
  637. DWORD
  638. RemoveRootcaAuthMethods(
  639. IN LPTSTR *ppwcArguments, // Input stream
  640. IN DWORD dwArgCount, // Input arg count
  641. IN DWORD dwCurrentIndex, // Input current arg index
  642. IN PARSER_PKT *pParser, // contains the MaxTok
  643. IN LPTSTR szAnotherList, // Another ListCmd also present ...
  644. OUT PSTA_MM_AUTH_METHODS *paRootcaAuthMethods, // o/p stream containing the list args
  645. OUT LPTSTR *ppwcTok, // i/p stream stripped of list cmds
  646. OUT DWORD *pdwNumRootcaAuthMethods,
  647. IN DWORD dwInputAllocLen,
  648. OUT PDWORD pdwCount
  649. );
  650. DWORD
  651. MatchEnumTagToTagIndex(
  652. IN LPTSTR szToken, // Input Token
  653. IN PARSER_PKT *pParser
  654. );
  655. DWORD
  656. CheckNeededTags(
  657. IN LPTSTR *ppwcArguments, // Input stream
  658. IN DWORD dwArgCount, // Input arg count
  659. IN DWORD dwCurrentIndex, // Input current arg index
  660. IN PARSER_PKT *pParser // contains the MaxTok
  661. );
  662. DWORD
  663. GetIpAddress(
  664. IN LPTSTR ppwcArg,
  665. OUT DNSIPADDR *pipAddress
  666. );
  667. BOOL
  668. SplitCmdTok(
  669. IN LPTSTR szStr,
  670. OUT LPTSTR szCmd,
  671. OUT LPTSTR szTok,
  672. IN DWORD dwCmdLen,
  673. IN DWORD dwTokLen
  674. );
  675. DWORD
  676. TokenToIPAddr(
  677. IN LPTSTR szText,
  678. IN OUT IPAddr *pAddress,
  679. IN BOOL bTunnel,
  680. IN BOOL bMask
  681. );
  682. DWORD
  683. CheckIFType(
  684. IN LPTSTR SzText
  685. );
  686. DWORD
  687. CheckLocationType(
  688. IN LPTSTR SzText
  689. );
  690. DWORD
  691. CheckProtoType(
  692. IN LPTSTR SzText,
  693. OUT PDWORD dwValue
  694. );
  695. DWORD
  696. isdnsname(
  697. IN LPTSTR szStr
  698. );
  699. DWORD
  700. ValidateBool(
  701. IN LPTSTR ppcTok
  702. );
  703. DWORD
  704. CheckPFSGroup(
  705. IN LPTSTR str
  706. );
  707. DWORD
  708. CheckBound(
  709. IN LPTSTR SzText
  710. );
  711. BOOL
  712. IsWithinLimit(
  713. IN DWORD data,
  714. IN DWORD Min,
  715. IN DWORD Max
  716. );
  717. DWORD
  718. TokenToDNSIPAddr(
  719. IN LPTSTR szText,
  720. IN DNSIPADDR *Address,
  721. IN OUT PDWORD *pdwUsed
  722. );
  723. VOID
  724. InitializeGlobalPointers(
  725. VOID
  726. );
  727. DWORD
  728. TokenToProperty(
  729. IN LPTSTR SzText
  730. );
  731. DWORD
  732. TokenToType(
  733. IN LPTSTR SzText
  734. );
  735. DWORD
  736. TokenToStats(
  737. IN LPTSTR SzText
  738. );
  739. VOID
  740. CleanUp(
  741. VOID
  742. );
  743. VOID
  744. DisplayAllocPtr(
  745. VOID
  746. );
  747. VOID
  748. PrintQMOfferError(
  749. IN DWORD dwStatus,
  750. IN PPARSER_PKT pParser,
  751. IN DWORD dwTagType
  752. );
  753. DWORD
  754. ValidateSplServer(
  755. IN LPTSTR szText
  756. );
  757. VOID
  758. PrintIPError(
  759. IN DWORD dwStatus,
  760. IN LPTSTR szText
  761. );
  762. DWORD
  763. LoadLevel(
  764. IN LPTSTR szInput,
  765. OUT PARSER_PKT *pParser,
  766. IN DWORD dwTagType,
  767. IN PDWORD pdwUsed,
  768. IN DWORD dwCount
  769. );
  770. DWORD
  771. LoadConnectionType(
  772. IN LPTSTR szInput,
  773. OUT PARSER_PKT *pParser,
  774. IN DWORD dwTagType,
  775. IN PDWORD pdwUsed,
  776. IN DWORD dwCount
  777. );
  778. DWORD
  779. LoadLocationType(
  780. IN LPTSTR pszInput,
  781. OUT PPARSER_PKT pParser,
  782. IN DWORD dwTagType,
  783. IN PDWORD pdwUsed,
  784. IN DWORD dwCount
  785. );
  786. DWORD
  787. LoadProtocol(
  788. IN LPTSTR szInput,
  789. OUT PARSER_PKT *pParser,
  790. IN DWORD dwTagType,
  791. IN PDWORD pdwUsed,
  792. IN DWORD dwCount
  793. );
  794. DWORD
  795. LoadPFSGroup(
  796. IN LPTSTR szInput,
  797. OUT PARSER_PKT *pParser,
  798. IN DWORD dwTagType,
  799. IN PDWORD pdwUsed,
  800. IN DWORD dwCount
  801. );
  802. DWORD
  803. LoadQMAction(
  804. IN LPTSTR szInput,
  805. OUT PARSER_PKT *pParser,
  806. IN DWORD dwTagType,
  807. IN PDWORD pdwUsed,
  808. IN DWORD dwCount
  809. );
  810. DWORD
  811. LoadFormat(
  812. IN LPTSTR szInput,
  813. OUT PARSER_PKT *pParser,
  814. IN DWORD dwTagType,
  815. IN PDWORD pdwUsed,
  816. IN DWORD dwCount
  817. );
  818. DWORD
  819. LoadFilterMode(
  820. IN LPTSTR szInput,
  821. OUT PARSER_PKT *pParser,
  822. IN DWORD dwTagType,
  823. IN PDWORD pdwUsed,
  824. IN DWORD dwCount
  825. );
  826. DWORD
  827. LoadOSType(
  828. IN LPTSTR szInput,
  829. OUT PPARSER_PKT pParser,
  830. IN DWORD dwTagType,
  831. IN PDWORD pdwUsed,
  832. IN DWORD dwCount
  833. );
  834. DWORD
  835. LoadProperty(
  836. IN LPTSTR szInput,
  837. OUT PPARSER_PKT pParser,
  838. IN DWORD dwTagType,
  839. IN PDWORD pdwUsed,
  840. IN DWORD dwCount
  841. );
  842. DWORD
  843. LoadPort(
  844. IN LPTSTR szInput,
  845. OUT PPARSER_PKT pParser,
  846. IN DWORD dwTagType,
  847. IN PDWORD pdwUsed,
  848. IN DWORD dwCount
  849. );
  850. DWORD
  851. LoadFilterType(
  852. IN LPTSTR szInput,
  853. OUT PPARSER_PKT pParser,
  854. IN DWORD dwTagType,
  855. IN PDWORD pdwUsed,
  856. IN DWORD dwCount
  857. );
  858. DWORD
  859. LoadStats(
  860. IN LPTSTR szInput,
  861. OUT PPARSER_PKT pParser,
  862. IN DWORD dwTagType,
  863. IN PDWORD pdwUsed,
  864. IN DWORD dwCount
  865. );
  866. DWORD
  867. LoadFilterType(
  868. IN LPTSTR szInput,
  869. OUT PPARSER_PKT pParser,
  870. IN DWORD dwTagType,
  871. IN PDWORD pdwUsed,
  872. IN DWORD dwCount
  873. );
  874. DWORD
  875. LoadUserInput(
  876. IN LPTSTR szInput,
  877. OUT PPARSER_PKT pParser,
  878. IN DWORD dwTagType,
  879. IN PDWORD pdwUsed,
  880. IN DWORD dwCount
  881. );
  882. DWORD
  883. LoadIPAddrTunnel(
  884. IN LPTSTR szInput,
  885. OUT PPARSER_PKT pParser,
  886. IN DWORD dwTagType,
  887. IN PDWORD pdwUsed,
  888. IN DWORD dwCount,
  889. IN BOOL bTunnel
  890. );
  891. DWORD
  892. LoadIPMask(
  893. IN LPTSTR szInput,
  894. OUT PPARSER_PKT pParser,
  895. IN DWORD dwTagType,
  896. IN PDWORD pdwUsed,
  897. IN DWORD dwCount
  898. );
  899. DWORD
  900. LoadQMOffers(
  901. IN LPTSTR szInput,
  902. OUT PPARSER_PKT pParser,
  903. IN DWORD dwTagType,
  904. IN PDWORD pdwUsed,
  905. IN DWORD dwCount
  906. );
  907. DWORD
  908. LoadMMOffers(
  909. IN LPTSTR szInput,
  910. OUT PPARSER_PKT pParser,
  911. IN DWORD dwTagType,
  912. IN PDWORD pdwUsed,
  913. IN DWORD dwCount
  914. );
  915. DWORD
  916. LoadDNSIPAddr(
  917. IN LPTSTR szInput,
  918. OUT PPARSER_PKT pParser,
  919. IN DWORD dwTagType,
  920. IN PDWORD pdwUsed,
  921. IN DWORD dwCount
  922. );
  923. DWORD
  924. LoadParserString(
  925. IN LPTSTR szInput,
  926. OUT PPARSER_PKT pParser,
  927. IN DWORD dwTagType,
  928. IN PDWORD pdwUsed,
  929. IN DWORD dwCount,
  930. IN BOOL bAppend,
  931. IN LPTSTR szAppend
  932. );
  933. DWORD
  934. LoadDword(
  935. IN LPTSTR szInput,
  936. OUT PPARSER_PKT pParser,
  937. IN DWORD dwTagType,
  938. IN PDWORD pdwUsed,
  939. IN DWORD dwCount
  940. );
  941. DWORD
  942. LoadBoolWithOption(
  943. IN LPTSTR szInput,
  944. OUT PPARSER_PKT pParser,
  945. IN DWORD dwTagType,
  946. IN PDWORD pdwUsed,
  947. IN DWORD dwCount,
  948. IN BOOL bOption,
  949. IN LPTSTR szCheckKeyWord
  950. );
  951. DWORD
  952. LoadKerbAuthInfo(
  953. IN LPTSTR pszInput,
  954. OUT PPARSER_PKT pParser,
  955. IN DWORD dwTagType,
  956. IN PDWORD pdwUsed,
  957. IN DWORD dwCount
  958. );
  959. DWORD
  960. LoadPskAuthInfo(
  961. IN LPTSTR pszInput,
  962. OUT PPARSER_PKT pParser,
  963. IN DWORD dwTagType,
  964. IN PDWORD pdwUsed,
  965. IN DWORD dwCount
  966. );
  967. DWORD
  968. CheckCharForOccurances(
  969. IN LPTSTR szInput,
  970. IN _TCHAR chData
  971. );
  972. DWORD
  973. ConvertStringToDword(
  974. IN LPTSTR szInput,
  975. OUT PDWORD dwValue
  976. );
  977. #endif //_PARSER_H_