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.

605 lines
20 KiB

  1. /////////////////////////////////////////////////////////////
  2. // Copyright(c) 1998-2000, Microsoft Corporation
  3. //
  4. // text2pol.h
  5. //
  6. // Created on 4/5/98 by Randyram
  7. // Revisions:
  8. // Moved the routines to this module 8/25/98
  9. //
  10. // SPD update 2/15/00 DKalin
  11. //
  12. // Includes all the necessary header files and definitions
  13. // for the text to policy conversion routines
  14. //
  15. // GUID generation update 2/29/00 DKalin
  16. //
  17. // GUID manipulation routines added.
  18. //
  19. // Polstore v2 update 5/12/00 DKalin
  20. //
  21. // Polstore v2 support added
  22. //
  23. // Added SPDUtil.cpp declarations 3/27/01 DKalin
  24. //
  25. /////////////////////////////////////////////////////////////
  26. /* HOW TO USE THE TEXT2POL ROUTINES
  27. The following are guidelines/things you need to know to use these:
  28. 1. The functions will not touch fields that it doesn't have to. YOU
  29. are responsible for cleaning out the structures before you call a
  30. Text2Pol routine.
  31. What this also achieves is that you can set the structures to your
  32. desired defaults-- the defaults are written over if the string to
  33. convert specifies so. If the Text2Pol routine doesn't have to touch
  34. it, then your default will be preserved.
  35. 2. Return values and Error codes:
  36. Text2Pol routines return DWORDs
  37. The return codes are defined in t2pmsgs.h.
  38. The text2pol.dll has a resource table of messages compiled it with it.
  39. So, when you want to obtain the descriptive string that maps to the
  40. code, you can use FormatMessage API like so:
  41. FormatMessage(FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_ALLOCATE_BUFFER,
  42. GetModuleHandle(TEXT("text2pol.dll")),
  43. ReturnCodeFromText2PolFunction, 0,
  44. (LPTSTR)&myTest, 0, NULL);
  45. See MSDN for more on FormatMessage.
  46. One gotcha is that you need to pass in a handle to text2pol.dll because
  47. that is where the string table resource is.
  48. 3. These are not UNICODE compliant yet.
  49. */
  50. #ifndef TEXT2POL_H
  51. #define TEXT2POL_H
  52. //#define T2P_TEST_VERSION
  53. // some macros
  54. #define T2P_SUCCESS(Status) ((DWORD)Status == T2P_OK)
  55. const UINT POTF_MAX_STRLEN = 256;
  56. const char POTF_FILTER_TOKEN = '=';
  57. const char POTF_FILTER_MIRTOKEN = '+'; // indicates filter is two way
  58. const char POTF_PT_TOKEN = ':';
  59. const char POTF_MASK_TOKEN = '/';
  60. const char POTF_ANYADDR_TOKEN = '*';
  61. const char POTF_ME_TOKEN = '0';
  62. const char POTF_GUID_TOKEN = '{';
  63. const char POTF_GUID_END_TOKEN = '}';
  64. const char POTF_OAKAUTH_TOKEN = ':';
  65. const char POTF_QM_TOKEN = '/';
  66. const char POTF_P1_TOKEN = '-';
  67. const char POTF_REKEY_TOKEN = '/';
  68. const char POTF_ESPTRANS_TOKEN = ',';
  69. const char POTF_STAR_TOKEN = '*';
  70. const char POTF_STORAGE_TOKEN = ':';
  71. const char POTF_PASSTHRU_OPEN_TOKEN = '(';
  72. const char POTF_PASSTHRU_CLOSE_TOKEN = ')';
  73. const char POTF_DROP_OPEN_TOKEN = '[';
  74. const char POTF_DROP_CLOSE_TOKEN = ']';
  75. const char POTF_ME_TUNNEL[] = "0";
  76. const char POTF_OAKAUTH_PRESHARE[] = "PRESHARE";
  77. const char POTF_OAKAUTH_KERBEROS[] = "KERBEROS";
  78. const char POTF_OAKAUTH_CERT[] = "CERT";
  79. const char POTF_STORAGE_REG[] = "REG";
  80. const char POTF_STORAGE_DS[] = "DS";
  81. const char POTF_STORAGE_CACHE[] = "CACHE";
  82. const char POTF_P1_DES40[] = "INVALID";
  83. const char POTF_P1_DES[] = "DES";
  84. const char POTF_P1_3DES[] = "3DES";
  85. const char POTF_P1_SHA[] = "SHA";
  86. const char POTF_P1_SHA1[] = "SHA1"; // same as SHA
  87. const char POTF_P1_MD5[] = "MD5";
  88. const char POTF_PASSTHRU[] = "PASS";
  89. const char POTF_INBOUND_PASSTHRU[] = "INPASS";
  90. const char POTF_BLOCK[] = "BLOCK";
  91. const UINT POTF_OAKLEY_GROUP1 = DH_GROUP_1;
  92. const UINT POTF_OAKLEY_GROUP2 = DH_GROUP_2;
  93. const ULONG POTF_OAKLEY_ALGOKEYLEN = 64;
  94. const ULONG POTF_OAKLEY_ALGOROUNDS = 8;
  95. const char POTF_TCP_STR[] = "TCP";
  96. const char POTF_UDP_STR[] = "UDP";
  97. const char POTF_RAW_STR[] = "RAW";
  98. const char POTF_ICMP_STR[] = "ICMP";
  99. const char POTF_FILTER_DEFAULT[] = "DEFAULT";
  100. const DWORD POTF_DEFAULT_RESPONSE_FLAG = 0x00001000;
  101. const DWORD POTF_TCP_PROTNUM = 6;
  102. const DWORD POTF_UDP_PROTNUM = 17;
  103. const DWORD POTF_ICMP_PROTNUM = 1;
  104. const DWORD POTF_RAW_PROTNUM = 255;
  105. const char POTF_NEGPOL_ESP[] = "ESP";
  106. const char POTF_NEGPOL_AH[] = "AH";
  107. const char POTF_NEGPOL_DES40[] = "INVALID";
  108. const char POTF_NEGPOL_DES[] = "DES";
  109. const char POTF_NEGPOL_3DES[] = "3DES";
  110. const char POTF_NEGPOL_SHA[] = "SHA";
  111. const char POTF_NEGPOL_SHA1[] = "SHA1"; // same as SHA
  112. const char POTF_NEGPOL_MD5[] = "MD5";
  113. const char POTF_NEGPOL_NONE[] = "NONE";
  114. const char POTF_NEGPOL_OPEN = '[';
  115. const char POTF_NEGPOL_CLOSE = ']';
  116. const char POTF_NEGPOL_AND = '+';
  117. const char POTF_NEGPOL_PFS = 'P';
  118. // COMMAND LINE FLAGS /////////////////////
  119. const char POTF_FLAG_TOKENS[] = "-/"; // what designates a flag
  120. const char POTF_FILTER_FLAG = 'f';
  121. const char POTF_NEGPOL_FLAG = 'n';
  122. const char POTF_TUNNEL_FLAG = 't';
  123. const char POTF_AUTH_FLAG = 'a';
  124. const char POTF_CONFIRM_FLAG = 'c';
  125. const char POTF_STORAGE_FLAG = 'w';
  126. const char POTF_POLNAME_FLAG = 'p';
  127. const char POTF_RULENAME_FLAG = 'r';
  128. const char POTF_SETACTIVE_FLAG = 'x';
  129. const char POTF_SETINACTIVE_FLAG = 'y';
  130. const char POTF_DEACTIVATE_FLAG = 'd';
  131. const char POTF_MMFILTER_FLAG[] = "1f"; // SPD addition
  132. const char POTF_SOFTSAEXP_FLAG[] = "1e"; // SPD addition
  133. const char POTF_SECMETHOD_FLAG[] = "1s";
  134. const char POTF_P1PFS_FLAG[] = "1p";
  135. const char POTF_P1REKEY_FLAG[] = "1k";
  136. const char POTF_SOFTSA_FLAG[] = "soft";
  137. const char POTF_DIALUP_FLAG[] = "dialup";
  138. const char POTF_LAN_FLAG[] = "lan";
  139. const char POTF_DELETERULE_FLAG = 'u';
  140. const char POTF_DELETEPOLICY_FLAG = 'o';
  141. const char POTF_HELP_FLAGS[] = "hH?";
  142. const DWORD POTF_MIN_P2LIFE_BYTES = 20480; // KB
  143. const DWORD POTF_MIN_P2LIFE_TIME = 300; // seconds
  144. const DWORD POTF_DEF_P1SOFT_TIME = 300; // seconds
  145. //
  146. // Structure for storage information
  147. //
  148. enum StorageType { STORAGE_TYPE_NONE = 0, STORAGE_TYPE_DS,
  149. STORAGE_TYPE_REGISTRY, STORAGE_TYPE_CACHE };
  150. const UINT DNSNAME_MAXLEN = 255;
  151. typedef struct DnsFilter {
  152. char szSourceName[DNSNAME_MAXLEN];
  153. char szDestName[DNSNAME_MAXLEN];
  154. } *PDNSFILTER, DNSFILTER;
  155. typedef struct StorageInfo {
  156. StorageType Type;
  157. time_t tPollingInterval;
  158. GUID guidNegPolAction; // passthur, block, inbound passthru
  159. BOOL bSetActive;
  160. BOOL bSetInActive;
  161. BOOL bDeleteRule;
  162. BOOL bDeletePolicy;
  163. PIPSEC_FILTER_SPEC FilterList; // holds filter data for the storage
  164. UINT uNumFilters;
  165. WCHAR szLocationName[POTF_MAX_STRLEN];
  166. WCHAR szPolicyName[POTF_MAX_STRLEN];
  167. WCHAR szRuleName[POTF_MAX_STRLEN];
  168. } *PSTORAGE_INFO, STORAGE_INFO;
  169. //
  170. // structre for passing to CmdLineToPolicy
  171. // holds everything you want to know about
  172. // setting policy through the SPD/Polstore API
  173. //
  174. // macros
  175. #define LASTERR(X,Y) sprintf(STRLASTERR, X, Y)
  176. #define LASTERR2(X,Y,Z) sprintf(STRLASTERR, X, Y, Z)
  177. #define PARSE_ERROR cerr << STRLASTERR << endl
  178. #define WARN cout << STRLASTERR << endl
  179. // use defaults from polwrap.h for policy
  180. const DWORD POTF_DEFAULT_P2REKEY_TIME = 0;
  181. const DWORD POTF_DEFAULT_P2REKEY_BYTES = 0;
  182. const DWORD POTF_DEFAULT_P1REKEY_TIME = 480*60;
  183. const DWORD POTF_DEFAULT_P1REKEY_QMS = 0;
  184. // globals
  185. extern char STRLASTERR[POTF_MAX_STRLEN]; // used for error macro
  186. #define POTF_FAILED 0
  187. // this is for calling HrSetActivePolicy explicitly
  188. typedef HRESULT (*LPHRSETACTIVEPOLICY)(GUID *);
  189. typedef struct _IPSEC_IKE_POLICY {
  190. DWORD dwNumMMFilters;
  191. MM_FILTER* pMMFilters;
  192. QM_FILTER_TYPE QMFilterType;
  193. DWORD dwNumFilters;
  194. TRANSPORT_FILTER* pTransportFilters;
  195. TUNNEL_FILTER* pTunnelFilters;
  196. IPSEC_MM_POLICY IkePol;
  197. IPSEC_QM_POLICY IpsPol;
  198. MM_AUTH_METHODS AuthInfos;
  199. } *PIPSEC_IKE_POLICY, IPSEC_IKE_POLICY;
  200. // this is T2P_FILTER structure
  201. typedef struct _T2P_FILTER {
  202. QM_FILTER_TYPE QMFilterType;
  203. TRANSPORT_FILTER TransportFilter; // only one out of two gets filled
  204. TUNNEL_FILTER TunnelFilter;
  205. } *PT2P_FILTER, T2P_FILTER;
  206. ////////////////////////////////////////////////////////////////
  207. // Function: TextToFilter
  208. // Purpose: Converts text to a T2P_FILTER struct
  209. /* string is of format:
  210. A.B.C.D/mask:port=A.B.C.D/mask:port:protocol
  211. The Source address is always on the left of the '=' and the Destination
  212. address is always on the right.
  213. If you replace the '=' with a '+' two filters will be created,
  214. one in each direction.
  215. mask and port are optional. If omitted, Any port and
  216. mask 255.255.255.255 will be used for the filter.
  217. You can replace A.B.C.D/mask with the following for
  218. special meaning:
  219. 0 means My address(es)
  220. * means Any address
  221. a DNS name
  222. protocol is optional, if omitted, Any protocol is assumed. If you
  223. indicate a protocol, a port must precede it or :: must preceded it.
  224. Examples:
  225. Machine1+Machine2::6 will filter TCP traffic between Machine1 and Machine2
  226. 172.31.0.0/255.255.0.0:80-157.0.0.0/255.0.0.0:80:TCP will filter
  227. all TCP traffic from the first subnet, port 80 to the second subnet,
  228. port 80
  229. And, yes, you can use the following protocol symbols:
  230. ICMP UDP RAW TCP
  231. */
  232. //
  233. // Pre-conditions: szText must be NULL terminated
  234. //
  235. // Parameters:
  236. // szText IN the string to convert
  237. // Filter IN OUT a user allocated T2P_FILTER struct,
  238. // user should fill QMFilterType field (otherwise we'll assume it's a transport filter)
  239. //
  240. // Returns: T2P_OK on success
  241. // on failure:
  242. // T2P_PASSTHRU_NOT_CLOSED
  243. // T2P_DROP_NOT_CLOSED
  244. // T2P_NULL_STRING
  245. // T2P_NOSRCDEST_TOKEN
  246. //
  247. // whatever UuidCreate,TextToFiltAddr, TextToProtocol returns on failure
  248. DWORD TextToFilter(IN char *szText,
  249. IN OUT T2P_FILTER &Filter,
  250. char *szSrc = NULL,
  251. char *szDst = NULL
  252. );
  253. DWORD ConvertFilter(IN T2P_FILTER &Filter,
  254. IN OUT IPSEC_FILTER_SPEC &PolstoreFilter);
  255. ////////////////////////////////////////////////////////////////
  256. // Function: TextToFiltAddr
  257. // Purpose:
  258. // will take A.B.C.D/Mask:port part and translate
  259. // if bDest is true, puts the info into the dest addr of a filter
  260. // if bDest is not specified or false, puts info into src addr
  261. //
  262. // Pre-conditions: szAddr must be zero terminated
  263. //
  264. // Parameters:
  265. // szAddr IN the string to convert
  266. // Filter IN OUT the target filter
  267. // bDest IN OPTIONAL
  268. //
  269. // Returns: T2P_OK on success
  270. // on failure:
  271. // T2P_DNSLOOKUP_FAILED
  272. // T2P_INVALID_ADDR
  273. // T2P_NULL_STRING
  274. DWORD TextToFiltAddr(IN char *szAddr, IN OUT T2P_FILTER & Filter,
  275. OUT char *szName = NULL,
  276. IN bool bDest = false);
  277. ////////////////////////////////////////////////////////////////
  278. // Function:
  279. // Purpose:
  280. // will convert string to protocol, including special
  281. // protocol strings like TCP, UDP, RAW, and ICMP
  282. //
  283. // Pre-conditions: szProt has to be NULL terminated
  284. //
  285. // Parameters:
  286. // szProt IN string to convert
  287. // dwProtocol OUT protocol number returned
  288. //
  289. // Returns: T2P_OK on success
  290. // T2P_INVALID_PROTOCOL on failure
  291. //
  292. DWORD TextToProtocol(IN char *szProt, OUT DWORD & dwProtocol);
  293. ////////////////////////////////////////////////////////////////
  294. // Function: TextToOffer
  295. // Purpose: converts string to a Phase 2 offer
  296. // based on following format:
  297. /*
  298. ESP[ConfAlg,AuthAlg]RekeyPFS
  299. AH[HashAlg]
  300. AH[HashAlg]+ESP[ConfAlg,AuthAlg]
  301. where ConfAlg can be NONE, DES, DES40 or 3DES
  302. and AuthAlg can be NONE, MD5, or SHA
  303. and HashAlg is MD5 or SHA
  304. ESP[NONE, NONE] is not a supported config
  305. */
  306. //
  307. // Pre-conditions: szText is null terminated
  308. //
  309. // Parameters:
  310. // szText IN the string to convert
  311. // Offer IN OUT the returned offer
  312. // Returns: T2P_OK on success
  313. // on failure:
  314. // T2P_INVALID_P2REKEY_UNIT
  315. // T2P_NULL_STRING
  316. // and anything that TextToAlgoInfo returns
  317. DWORD TextToOffer(IN char *szText, IN OUT IPSEC_QM_OFFER &);
  318. ////////////////////////////////////////////////////////////////
  319. // Function: TextToAlgoInfo
  320. // Purpose: converts string to IPSEC_QM_ALGO
  321. // parses AH[alg] or ESP[hashalg,encalg]
  322. //
  323. // Pre-conditions: szText is null terminated string
  324. //
  325. // Parameters:
  326. // szText IN string to convert
  327. // algoInfo IN OUT target struct
  328. // Returns: T2P_OK on success
  329. // on failure:
  330. // T2P_INVALID_HASH_ALG
  331. // T2P_GENERAL_PARSE_ERROR
  332. // T2P_DUP_ALGS
  333. // T2P_NONE_NONE
  334. // T2P_INCOMPLETE_ESPALGS
  335. // T2P_INVALID_IPSECPROT
  336. // T2P_NULL_STRING
  337. DWORD TextToAlgoInfo(IN char *szText, IN OUT IPSEC_QM_ALGO & algoInfo);
  338. ////////////////////////////////////////////////////////////////
  339. // Function: TextToIPAddr
  340. // Purpose: converts string to IPAddr, string of format:
  341. // IPv4 dot notation
  342. // DNS name
  343. //
  344. // CAVEAT: If domain name resolves to multiple addresses,
  345. // only the first one is used.
  346. // Pre-conditions: szText is null terminated string
  347. //
  348. // Parameters:
  349. // szText IN string to convert
  350. // ipaddr OUT target
  351. //
  352. // Returns: T2P_OK on success
  353. // on failure:
  354. // T2P_NULL_STRING
  355. // T2P_INVALID_ADDR
  356. // T2P_DNSLOOKUP_FAILED
  357. //
  358. DWORD TextToIPAddr(IN char *szText, IN OUT IPAddr &ipaddr);
  359. ////////////////////////////////////////////////////////////////
  360. // Function: TextToOakleyAuth
  361. // Purpose: converts string to IPSEC_MM_AUTH_INFO
  362. //
  363. // Pre-conditions: szText is null terminated string
  364. //
  365. // Parameters:
  366. // szText IN input string
  367. // OakAuth IN OUT target struct
  368. //
  369. // Returns: T2P_OK on success
  370. // on failure:
  371. // T2P_NO_PRESHARED_KEY
  372. // T2P_INVALID_AUTH_METHOD
  373. // T2P_MB2WC_FAILED
  374. // T2P_NULL_STRING
  375. //
  376. DWORD TextToOakleyAuth(IN char *szText, IN OUT IPSEC_MM_AUTH_INFO & OakAuth);
  377. ////////////////////////////////////////////////////////////////
  378. // Function: TextToSecMethod
  379. // Purpose: converts string to Phase 1 offer
  380. //
  381. // Pre-conditions: szText is null term. string
  382. //
  383. // Parameters:
  384. // szText IN string to convert
  385. // p1offer IN OUT target struct
  386. //
  387. // Returns: T2P_OK on success
  388. // T2P_NULL_STRING
  389. // T2P_GENERAL_PARSE_ERROR
  390. // T2P_DUP_ALGS
  391. // T2P_INVALID_P1GROUP
  392. // T2P_P1GROUP_MISSING
  393. //
  394. DWORD TextToSecMethod(IN char *szText, IN OUT IPSEC_MM_OFFER &p1offer);
  395. ////////////////////////////////////////////////////////////////
  396. // Function: TextToP1Rekey
  397. // Purpose: converts string to KEY_LIFETIME and QM limit
  398. //
  399. // Pre-conditions: szText is null term. string
  400. //
  401. // Parameters:
  402. // szText IN input string
  403. // OakLife IN OUT target struct
  404. // QMLimit IN OUT target QM limit
  405. //
  406. // Returns: T2P_OK on success
  407. // on failure:
  408. // T2P_INVALID_P1REKEY_UNIT
  409. // T2P_NULL_STRING
  410. DWORD TextToP1Rekey(IN char *szText, IN OUT KEY_LIFETIME &OakLife, DWORD & QMLim);
  411. ////////////////////////////////////////////////////////////////
  412. // Function: TextToMMFilter
  413. // Purpose: Converts text to a MM_FILTER struct
  414. /* string is of format:
  415. A.B.C.D/mask=A.B.C.D/mask
  416. The Source address is always on the left of the '=' and the Destination
  417. address is always on the right.
  418. If you replace the '=' with a '+' two filters will be created,
  419. one in each direction.
  420. mask is optional. If omitted,
  421. mask 255.255.255.255 will be used for the filter.
  422. You can replace A.B.C.D/mask with the following for
  423. special meaning:
  424. 0 means My address(es)
  425. * means Any address
  426. a DNS name
  427. */
  428. //
  429. // Pre-conditions: szText must be NULL terminated
  430. //
  431. // Parameters:
  432. // szText IN the string to convert
  433. // Filter IN OUT a user allocated MM_FILTER struct,
  434. //
  435. // Returns: T2P_OK on success
  436. // on failure:
  437. // T2P_NULL_STRING
  438. // T2P_NOSRCDEST_TOKEN
  439. //
  440. // whatever UuidCreate,TextToFiltAddr returns on failure
  441. DWORD TextToMMFilter(IN char *szText,
  442. IN OUT MM_FILTER &Filter,
  443. char *szSrc = NULL,
  444. char *szDst = NULL
  445. );
  446. // CmdLineToPolicy
  447. // This will take the command line, parse it all out
  448. // and fill out the policy structures.
  449. // Returns False if there is any kind of failure
  450. // NOTE: uArgCount should be > 0 and strArgs non-null
  451. DWORD CmdLineToPolicy(IN UINT uArgCount, IN char *strArgs[],
  452. OUT IPSEC_IKE_POLICY & IpsecIkePol,
  453. OUT bool & bConfirm
  454. ,OUT PSTORAGE_INFO pStorageInfo = NULL);
  455. // mirror filter
  456. bool MirrorFilter(IN T2P_FILTER, OUT T2P_FILTER &);
  457. // generate corresponding mainmode filter
  458. bool GenerateMMFilter(IN T2P_FILTER, OUT MM_FILTER &);
  459. // this shouldn't be in here, it's a kludge.
  460. void LoadIkeDefaults(OUT IPSEC_MM_POLICY & IkePol);
  461. void LoadOfferDefaults(OUT PIPSEC_QM_OFFER & Offers, OUT DWORD & NumOffers);
  462. DWORD TextToStorageLocation(IN char *szText, IN OUT STORAGE_INFO & StoreInfo);
  463. DWORD TextToPolicyName(IN char *szText, IN OUT STORAGE_INFO & StoreInfo);
  464. /*********************************************************************
  465. FUNCTION: GenerateGuidNamePair
  466. PURPOSE: Generates GUID and name for the object using specified prefix
  467. PARAMS:
  468. pszPrefix - prefix to use, can be NULL (then default prefix will be used)
  469. gID - reference to GUID
  470. ppszName - address of name pointer, memory will be allocated inside this function
  471. RETURNS: none, will assert if memory cannot be allocated
  472. COMMENTS:
  473. caller is responsible for freeing the memory allocated
  474. (see also DeleteGuidsNames routine)
  475. *********************************************************************/
  476. void GenerateGuidNamePair (IN LPWSTR pszPrefix, OUT GUID& gID, OUT LPWSTR* ppszName);
  477. /*********************************************************************
  478. FUNCTION: GenerateGuidsNames
  479. PURPOSE: Generates all necessary GUIDs and names for IPSEC_IKE_POLICY
  480. PARAMS:
  481. pszPrefix - prefix to use, can be NULL (then default prefix will be used)
  482. IPSecIkePol - reference to IPSEC_IKE_POLICY structure
  483. RETURNS: none, will assert if memory cannot be allocated
  484. COMMENTS:
  485. caller is responsible for freeing the memory allocated
  486. (see also DeleteGuidsNames routine)
  487. *********************************************************************/
  488. void GenerateGuidsNames (IN LPWSTR pszPrefix, IN OUT IPSEC_IKE_POLICY& IPSecIkePol);
  489. /*********************************************************************
  490. FUNCTION: DeleteGuidsNames
  491. PURPOSE: Deletes all GUIDs and names from IPSEC_IKE_POLICY (used for cleanup)
  492. PARAMS:
  493. IPSecIkePol - reference to IPSEC_IKE_POLICY structure
  494. RETURNS: none
  495. COMMENTS:
  496. *********************************************************************/
  497. void DeleteGuidsNames (IN OUT IPSEC_IKE_POLICY& IPSecIkePol);
  498. ///////////////////////////////////////////////////////////////////////
  499. //
  500. // PRIVATE DECLARATIONS (SPDUtil.cpp)
  501. //
  502. ///////////////////////////////////////////////////////////////////////
  503. int isdnsname(char *szStr);
  504. DWORD CM_EncodeName ( LPTSTR pszSubjectName, BYTE **EncodedName, DWORD *EncodedNameLength );
  505. DWORD CM_DecodeName ( BYTE *EncodedName, DWORD EncodedNameLength, LPTSTR *ppszSubjectName );
  506. #endif