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.

268 lines
5.1 KiB

  1. ////////////////////////////////////////////////////////////
  2. //Header: staticadd.h
  3. //
  4. // Purpose: Defining structures and prototypes for staticadd.cpp.
  5. //
  6. // Developers Name: surya
  7. //
  8. // Revision History:
  9. //
  10. // Date Author Comments
  11. // 21th Aug 2001 surya Initial Version.
  12. //
  13. ////////////////////////////////////////////////////////////
  14. #ifndef _STATICADD_H_
  15. #define _STATICADD_H_
  16. const DWORD MMPFS_QM_LIMIT = 1;
  17. const time_t P2STORE_DEFAULT_KBLIFE = 0;
  18. const time_t P2STORE_DEFAULT_LIFETIME = POTF_DEFAULT_P1REKEY_TIME;//60 * 480; by VKR to reflect the IPSECCMD defaults
  19. const time_t QM_DEFAULT_LIFETIMEINKILOBYTES = 0;
  20. const time_t QM_DEFAULT_LIFETIMEINSECONDS = 0;
  21. const ULONG POTF_OAKLEY_ALGOKEYLEN = 64;
  22. const ULONG POTF_OAKLEY_ALGOROUNDS = 8;
  23. const DWORD PROTOCOL_ANY = 0;
  24. const WORD PORT_ANY = 0;
  25. const WORD DEF_NUMBER_OF_ADDR = 1;
  26. const DWORD ADDR_ME = 0x00000000;
  27. const DWORD MASK_ME = 0xFFFFFFFF;
  28. typedef struct _FILTERDATA {
  29. LPTSTR pszFLName;
  30. LPTSTR pszDescription;
  31. GUID FilterSpecGUID;
  32. DNSIPADDR SourceAddr;
  33. BOOL bSrcAddrSpecified;
  34. DWORD SourMask;
  35. BOOL bSrcMaskSpecified;
  36. DNSIPADDR DestnAddr;
  37. BOOL bDstAddrSpecified;
  38. DWORD DestMask;
  39. BOOL bDstMaskSpecified;
  40. DWORD TunnAddr;
  41. BOOL TunnFiltExists;
  42. BOOL bMirrored;
  43. DWORD dwProtocol;
  44. WORD SourPort;
  45. WORD DestPort;
  46. UCHAR ExType;
  47. BOOL bSrcServerSpecified;
  48. BOOL bDstServerSpecified;
  49. BOOL bSrcMeSpecified;
  50. BOOL bSrcAnySpecified;
  51. BOOL bDstMeSpecified;
  52. BOOL bDstAnySpecified;
  53. }FILTERDATA, *PFILTERDATA;
  54. extern BOOL
  55. IsDomainMember(
  56. IN LPTSTR pszMachine
  57. );
  58. //
  59. //Add policy prototypes
  60. //
  61. DWORD
  62. CreateNewPolicy(
  63. IN PPOLICYDATA pPolicyData
  64. );
  65. DWORD
  66. LoadIkeDefaults(
  67. IN OUT PPOLICYDATA pPolicy,
  68. OUT IPSEC_MM_OFFER **ppIpSecMMOffer
  69. );
  70. DWORD
  71. AddDefaultResponseRule(
  72. IN OUT PIPSEC_POLICY_DATA pPolicy,
  73. IN HANDLE hPolicyStorage,
  74. IN BOOL bActivateDefaultRule,
  75. IN BOOL bActivateDefaultRuleSpecified
  76. );
  77. PIPSEC_NFA_DATA
  78. MakeDefaultResponseRule (
  79. IN BOOL bActivate,
  80. IN BOOL bActivateSpecified
  81. );
  82. PIPSEC_NEGPOL_DATA
  83. MakeDefaultResponseNegotiationPolicy (
  84. VOID
  85. );
  86. BOOL
  87. CheckPolicyExistance(
  88. IN HANDLE hPolicyStorage,
  89. IN LPTSTR pszPolicyName
  90. );
  91. //
  92. //Add filter action proto types
  93. //
  94. DWORD
  95. LoadOfferDefaults(
  96. OUT PIPSEC_QM_OFFER & pOffers,
  97. OUT DWORD & dwNumOffers
  98. );
  99. DWORD
  100. MakeNegotiationPolicy(
  101. OUT PIPSEC_NEGPOL_DATA *ppNegPol,
  102. IN PFILTERACTION pFilterAction
  103. );
  104. //
  105. //Add rule
  106. //
  107. DWORD
  108. CreateNewRule(
  109. IN PRULEDATA pRuleData
  110. );
  111. BOOL
  112. GetPolicyFromStore(
  113. OUT PIPSEC_POLICY_DATA *ppPolicy,
  114. IN LPTSTR szPolicyName,
  115. IN HANDLE hPolicyStorage
  116. );
  117. BOOL
  118. GetFilterListFromStore(
  119. OUT PIPSEC_FILTER_DATA *ppFilter,
  120. IN LPTSTR pszFLName,
  121. IN HANDLE hPolicyStorage,
  122. IN OUT BOOL &bFilterExists
  123. );
  124. BOOL
  125. GetNegPolFromStore(
  126. OUT PIPSEC_NEGPOL_DATA *ppNegPol,
  127. IN LPTSTR pszFAName,
  128. IN HANDLE hPolicyStorage
  129. );
  130. PIPSEC_NFA_DATA
  131. MakeRule(
  132. IN PRULEDATA pRuleData,
  133. IN PIPSEC_NEGPOL_DATA pNegPolData,
  134. IN PIPSEC_FILTER_DATA pFilterData
  135. );
  136. DWORD
  137. AddRule(
  138. IN OUT PIPSEC_POLICY_DATA pPolicy,
  139. IN PRULEDATA pRuleData,
  140. IN PIPSEC_NEGPOL_DATA pNegPolData,
  141. IN PIPSEC_FILTER_DATA pFilterData ,
  142. IN HANDLE hPolicyStorage
  143. );
  144. DWORD
  145. LoadAuthenticationInfos(
  146. IN STA_AUTH_METHODS AuthInfos,
  147. IN OUT PIPSEC_NFA_DATA &pRule,
  148. IN OUT BOOL &bCertConversionSuceeded
  149. );
  150. PIPSEC_NFA_DATA*
  151. ReAllocRuleMem(
  152. IN PIPSEC_NFA_DATA *ppOldMem,
  153. IN DWORD cbOld,
  154. IN DWORD cbNew
  155. );
  156. DWORD
  157. DecodeCertificateName (
  158. IN LPBYTE EncodedName,
  159. IN DWORD EncodedNameLength,
  160. IN OUT LPTSTR *ppszSubjectName
  161. );
  162. //
  163. //Add Filter
  164. //
  165. PIPSEC_FILTER_SPEC *
  166. ReAllocFilterSpecMem(
  167. IN PIPSEC_FILTER_SPEC * ppOldMem,
  168. IN DWORD cbOld,
  169. IN DWORD cbNew
  170. );
  171. DWORD
  172. FillAddPolicyInfo(
  173. OUT PPOLICYDATA* ppFilter,
  174. IN PARSER_PKT & parser,
  175. IN const TOKEN_VALUE *vtokStaticAddPolicy
  176. );
  177. DWORD
  178. FillAddFilterInfo(
  179. OUT PFILTERDATA* ppFilterData,
  180. IN PARSER_PKT & parser,
  181. IN const TOKEN_VALUE *vtokStaticAddFilter
  182. );
  183. DWORD
  184. FillAddFilterActionInfo(
  185. OUT PFILTERACTION* ppFilterData,
  186. IN PARSER_PKT & parser,
  187. IN const TOKEN_VALUE *vtokStaticAddFilterAction
  188. );
  189. DWORD
  190. FillAddRuleInfo(
  191. OUT PRULEDATA* ppRuleData,
  192. IN PARSER_PKT & parser,
  193. IN const TOKEN_VALUE *vtokStaticAddRule
  194. );
  195. //
  196. //add filterlist
  197. //
  198. DWORD
  199. CreateNewFilterList(
  200. IN HANDLE hPolicyStorage,
  201. IN LPTSTR pszFLName,
  202. IN LPTSTR pszFLDescription
  203. );
  204. DWORD
  205. ValidateFilterSpec(
  206. IN PFILTERDATA pFilterData
  207. );
  208. BOOL
  209. CheckForRuleExistance(
  210. IN PIPSEC_POLICY_DATA pPolicy,
  211. IN LPTSTR pszRuleName
  212. );
  213. BOOL
  214. CheckFilterListExistance(
  215. IN HANDLE hPolicyStorage,
  216. IN LPTSTR pszFLName
  217. );
  218. BOOL
  219. CheckFilterActionExistance(
  220. IN HANDLE hPolicyStorage,
  221. IN LPTSTR pszFAName
  222. );
  223. DWORD
  224. ConvertMMAuthToStaticLocal(
  225. IN PINT_IPSEC_MM_AUTH_INFO pAuthenticationInfo,
  226. IN DWORD dwAuthInfos,
  227. IN OUT STA_AUTH_METHODS &AuthInfos
  228. );
  229. DWORD
  230. ConnectStaticMachine(
  231. IN LPCWSTR pwszMachine,
  232. IN DWORD dwLocation
  233. );
  234. #endif //_STATICADD_H_