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.

206 lines
4.9 KiB

  1. ///////////////////////////////////////////////////////////////////////
  2. //Header: staticset.h
  3. //
  4. // Purpose: Defining structures and prototypes for statiset.cpp.
  5. //
  6. // Developers Name: surya
  7. //
  8. // History:
  9. //
  10. // Date Author Comments
  11. // 21th Aug 2001 surya Initial Version.
  12. //
  13. ///////////////////////////////////////////////////////////////////////
  14. #ifndef _STATICSET_H_
  15. #define _STATICSET_H_
  16. typedef struct _POLICYDATA {
  17. LPTSTR pszGUIDStr;
  18. BOOL bGUIDSpecified;
  19. GUID PolicyGuid;
  20. LPTSTR pszPolicyName;
  21. BOOL bPolicyNameSpecified;
  22. LPTSTR pszNewPolicyName;
  23. LPTSTR pszDescription;
  24. LPTSTR pszGPOName;
  25. BOOL bPFS;
  26. BOOL bPFSSpecified;
  27. ULONG LifeTimeInSeconds;
  28. BOOL bLifeTimeInsecondsSpecified;
  29. DWORD dwQMLimit;
  30. BOOL bQMLimitSpecified;
  31. DWORD dwOfferCount;
  32. IPSEC_MM_OFFER *pIpSecMMOffer;
  33. DWORD dwAuthInfos;
  34. DWORD dwPollInterval;
  35. BOOL bPollIntervalSpecified;
  36. BOOL bAssign;
  37. BOOL bAssignSpecified;
  38. BOOL bActivateDefaultRule;
  39. BOOL bActivateDefaultRuleSpecified;
  40. BOOL bGuidConversionOk;
  41. BOOL bCertToAccMappingSpecified;
  42. BOOL bCertToAccMapping;
  43. }POLICYDATA,*PPOLICYDATA;
  44. typedef struct _FILTERACTION {
  45. LPTSTR pszGUIDStr;
  46. BOOL bGUIDSpecified;
  47. GUID FAGuid;
  48. LPTSTR pszFAName;
  49. LPTSTR pszNewFAName;
  50. LPTSTR pszFADescription;
  51. GUID NegPolAction;
  52. PIPSEC_QM_OFFER pIpsecSecMethods;
  53. DWORD dwNumSecMethodCount;
  54. BOOL bSecMethodsSpecified;
  55. BOOL bNegPolActionSpecified;
  56. BOOL bQMPfs;
  57. BOOL bQMPfsSpecified;
  58. BOOL bInpass;
  59. BOOL bInpassSpecified;
  60. BOOL bSoft;
  61. BOOL bSoftSpecified;
  62. BOOL bNegotiateSpecified;
  63. ULONG LifeTimeInSeconds;
  64. ULONG LifeTimeInkiloBytes;
  65. BOOL bLifeTimeInsecondsSpecified;
  66. BOOL bLifeTimeInkiloBytesSpecified;
  67. BOOL bGuidConversionOk;
  68. } FILTERACTION, *PFILTERACTION;
  69. typedef struct _RULEDATA {
  70. LPTSTR pszRuleName;
  71. DWORD dwRuleId;
  72. BOOL bIDSpecified;
  73. BOOL bGuidConversionOk;
  74. LPTSTR pszNewRuleName;
  75. LPTSTR pszRuleDescription;
  76. LPTSTR pszPolicyName;
  77. LPTSTR pszFLName;
  78. BOOL bFLSpecified;
  79. LPTSTR pszFAName;
  80. BOOL bFASpecified;
  81. BOOL bTunnel;
  82. BOOL bTunnelSpecified;
  83. IPADDR TunnelIPAddress;
  84. DWORD dwAuthInfos;
  85. STA_AUTH_METHODS AuthInfos;
  86. IF_TYPE ConnectionType;
  87. BOOL bConnectionTypeSpecified;
  88. BOOL bActivate;
  89. BOOL bActivateSpecified;
  90. BOOL bAuthMethodSpecified;
  91. }RULEDATA, *PRULEDATA;
  92. typedef struct _DEFAULTRULE {
  93. LPTSTR pszPolicyName;
  94. PIPSEC_QM_OFFER pIpsecSecMethods;
  95. DWORD dwNumSecMethodCount;
  96. DWORD dwAuthInfos;
  97. STA_AUTH_METHODS AuthInfos;
  98. BOOL bActivate;
  99. BOOL bActivateSpecified;
  100. BOOL bQMPfs;
  101. BOOL bQMPfsSpecified;
  102. ULONG LifeTimeInSeconds;
  103. ULONG LifeTimeInkiloBytes;
  104. BOOL bLifeTimeInsecondsSpecified;
  105. BOOL bLifeTimeInkiloBytesSpecified;
  106. }DEFAULTRULE, *PDEFAULTRULE;
  107. //
  108. //friendly names for the default policies
  109. //
  110. const _TCHAR GUID_CLIENT_RESPOND_ONLY[] = _TEXT("CLIENT_RESPOND");
  111. const _TCHAR GUID_SECURE_SERVER_REQUIRE_SECURITY[] = _TEXT("SECURE_SERVER");
  112. const _TCHAR GUID_SERVER_REQUEST_SECURITY[] = _TEXT("SERVER_REQUEST");
  113. //
  114. //default policy GUIDs
  115. //
  116. const CLSID CLSID_Server = { 0x72385230, 0x70FA, 0x11D1,
  117. { 0x86, 0x4C, 0x14, 0xA3, 0x00, 0x00, 0x00, 0x00 } };
  118. const CLSID CLSID_Client = { 0x72385236, 0x70FA, 0x11D1,
  119. { 0x86, 0x4C, 0x14, 0xA3, 0x00, 0x00, 0x00, 0x00 } };
  120. const CLSID CLSID_SecureServer = { 0x7238523C, 0x70FA, 0x11D1,
  121. { 0x86, 0x4C, 0x14, 0xA3, 0x00, 0x00, 0x00, 0x00 } };
  122. //
  123. // Prototypes
  124. //
  125. extern BOOL
  126. IsDomainMember(
  127. IN LPTSTR pszMachine
  128. );
  129. PIPSEC_NFA_DATA
  130. GetRuleFromPolicy(
  131. IN PIPSEC_POLICY_DATA pPolicy,
  132. IN PRULEDATA pRuleData
  133. );
  134. DWORD
  135. UpdateRule(
  136. IN PIPSEC_POLICY_DATA pPolicy,
  137. IN PRULEDATA pRuleData,
  138. IN PIPSEC_NEGPOL_DATA pNegPolData,
  139. IN PIPSEC_FILTER_DATA pFilterData,
  140. IN HANDLE hPolicyStorage
  141. );
  142. DWORD
  143. UpdateDefaultResponseNegotiationPolicy (
  144. IN PDEFAULTRULE pRuleData,
  145. IN OUT PIPSEC_NFA_DATA pRule
  146. );
  147. DWORD
  148. UpdateDefaultResponseRule (
  149. IN PDEFAULTRULE pRuleData,
  150. IN OUT PIPSEC_NFA_DATA pRule,
  151. IN OUT BOOL &bCertConversionSuceeded
  152. );
  153. DWORD
  154. UpdateNegotiationPolicy(
  155. IN OUT PIPSEC_NEGPOL_DATA pNegPol,
  156. IN PFILTERACTION pFilterAction
  157. );
  158. DWORD
  159. FillSetPolicyInfo(
  160. OUT PPOLICYDATA* ppPolicyData,
  161. IN PARSER_PKT & parser,
  162. IN const TOKEN_VALUE *vtokStaticSetPolicy
  163. );
  164. DWORD
  165. FillSetFilterActionInfo(
  166. OUT PFILTERACTION* ppFilterData,
  167. IN PARSER_PKT & parser,
  168. IN const TOKEN_VALUE *vtokStaticSetFilterAction
  169. );
  170. DWORD
  171. FillSetRuleInfo(
  172. OUT PRULEDATA* ppRuleData,
  173. IN PARSER_PKT & parser,
  174. IN const TOKEN_VALUE *vtokStaticSetRule
  175. );
  176. DWORD
  177. FillSetDefRuleInfo(
  178. OUT PDEFAULTRULE* ppRuleData,
  179. IN PARSER_PKT & parser,
  180. IN const TOKEN_VALUE *vtokStaticSetDefaultRule
  181. );
  182. BOOL
  183. GetPolicyFromStoreBasedOnGuid(
  184. OUT PIPSEC_POLICY_DATA *ppPolicy,
  185. IN PPOLICYDATA pPolicyData,
  186. IN HANDLE hPolicyStorage
  187. );
  188. #endif //_STATICSET_H_