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.

385 lines
14 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., **/
  4. /**********************************************************************/
  5. /*
  6. dialinusr.h
  7. Definition of names, values, default values, containers information
  8. related to msRASUser, msRASProfile in DS
  9. Author:
  10. Wei Jiang (weijiang) 13-Oct-97
  11. Revision History:
  12. Wei Jiang (weijiang) 20-Oct-97 -- define more bits for msRASAllowDialin Attribute
  13. -- static IP address
  14. -- callback number
  15. -- caller id
  16. -- default profile name --> "DefaultRASProfile"
  17. Wei Jiang (weijiang) 13-Nov-97 -- move definition of timeOfDay into this header
  18. Wei Jiang (weijiang) 29-APR-98 -- SDO Wrapper APIs
  19. Wei Jiang (weijiang) 29-APR-98 -- move profile UI APIs into this folder
  20. */
  21. // dsrasuse.h : header file for RAS User and Profile definition
  22. //
  23. #ifndef _RAS_USER_PROFILE_
  24. #define _RAS_USER_PROFILE_
  25. // Attribute DN
  26. #define RAS_DSAN_DN L"distinguishedName"
  27. // Callback number length
  28. #define RAS_CALLBACK_NUMBER_LEN MAX_PHONE_NUMBER_LEN
  29. #define RAS_CALLBACK_NUMBER_LEN_NT4 48
  30. // IP Address Policy, used in profile msRASIPAddressPolicy
  31. #define RAS_IP_USERSELECT 0xffffffff
  32. #define RAS_IP_SERVERASSIGN 0xfffffffe
  33. #define RAS_IP_STATIC 0xfffffffd
  34. #define RAS_IP_NONE 0x0
  35. // Radius Service type
  36. #define RAS_RST_FRAMED 0x2
  37. #define RAS_RST_FRAMEDCALLBACK 0x4
  38. // Authentication Type, used in profile, for msRASAuthenticationType
  39. /*
  40. 1 PAP/SPAP
  41. 2 CHAP
  42. 3 MS-CHAP-1
  43. 4 MS-CHAP-2
  44. 5 EAP
  45. 6 ARAP
  46. 7 None >> Can we rename it to:- Unauthenticated Access.
  47. 8 Custom Authentication Module
  48. 9 MS-CHAP-1 with password change
  49. 10 MS-CHAP-2 with Password change
  50. // replace old value == (EAP=1, CHAP=2, MS-CHAP=3, PAP=4, SPAP=5)
  51. */
  52. #define RAS_AT_PAP_SPAP 1
  53. #define RAS_AT_MD5CHAP 2
  54. #define RAS_AT_MSCHAP 3
  55. #define RAS_AT_MSCHAP2 4
  56. #define RAS_AT_EAP 5
  57. #if 0
  58. #define RAS_AT_ARAP 6
  59. #endif
  60. #define RAS_AT_UNAUTHEN 7
  61. #define RAS_AT_EXTENSION_DLL 8
  62. #define RAS_AT_MSCHAPPASS 9
  63. #define RAS_AT_MSCHAP2PASS 10
  64. // Authentication Type Names
  65. #define RAS_ATN_MSCHAP _T("MSCHAP")
  66. #define RAS_ATN_MD5CHAP _T("MD5CHAP")
  67. #define RAS_ATN_CHAP _T("CHAP")
  68. #define RAS_ATN_EAP _T("EAP")
  69. #define RAS_ATN_PAP _T("PAP")
  70. // Encryption Policy, used in profile for msRASAllowEncryption
  71. #define RAS_EP_DISALLOW 1 // the type should set to ET_NONE
  72. #define RAS_EP_ALLOW 1
  73. #define RAS_EP_REQUIRE 2
  74. // Encrpytiopn Type
  75. #define RAS_ET_BASIC 0x00000002
  76. #define RAS_ET_STRONGEST 0x00000004
  77. #define RAS_ET_STRONG 0x00000008
  78. #define RAS_ET_AUTO (RAS_ET_BASIC | RAS_ET_STRONG | RAS_ET_STRONGEST)
  79. #if 0 // old values
  80. // Encryption Types, profile, for msRASEncryptionType
  81. #define RAS_ET_NONE 0x0
  82. #define RAS_ET_IPSEC 0x00000001
  83. #define RAS_ET_40 0x00000002
  84. #define RAS_ET_128 0x00000004
  85. #define RAS_ET_56 0x00000008
  86. // change it back after beta3
  87. #define RAS_ET_DES_40 0x00000010
  88. // #define RAS_ET_DES_40 RAS_ET_IPSEC
  89. #define RAS_ET_DES_56 0x00000020
  90. #define RAS_ET_3DES 0x00000040
  91. #endif
  92. // Framed Routing
  93. #define RAS_FR_FALSE 0x0 // or absent
  94. #define RAS_FR_TRUE 0x1
  95. // BAP Policy -- profile, for msRASBAPRequired
  96. #define RAS_BAP_ALLOW 1
  97. #define RAS_BAP_REQUIRE 2
  98. // Port Types -- profile, for msRASAllowPortType
  99. #define RAS_PT_ISDN 0x00000001
  100. #define RAS_PT_MODEM 0x00000002
  101. #define RAS_PT_VPN 0x00000004
  102. #define RAS_PT_OTHERS 0xFFFFFFF8
  103. #define RAS_PT_ALL 0xffffffff
  104. #ifdef _TUNNEL
  105. //Tunnel Types
  106. #define RAS_TT_PPTP 1
  107. #define RAS_TT_L2F 2
  108. #define RAS_TT_L2TP 3
  109. #define RAS_TT_ATMP 4
  110. #define RAS_TT_VTP 5
  111. #define RAS_TT_AH 6
  112. #define RAS_TT_IP_IP 7
  113. #define RAS_TT_MIN_IP_IP 8
  114. #define RAS_TT_ESP 9
  115. #define RAS_TT_GRE 10
  116. #define RAS_TT_DVS 11
  117. //Tunnel Type Names
  118. #define RAS_TTN_PPTP _T("PPTP") // Point-to-Point Tunneling Protocol (PPTP)
  119. #define RAS_TTN_L2F _T("L2F") // Layer Two Forwarding
  120. #define RAS_TTN_L2TP _T("L2TP") // Layer Two Tunneling Protocol
  121. #define RAS_TTN_ATMP _T("ATMP") // Ascend Tunnel Management Protocol
  122. #define RAS_TTN_VTP _T("VTP") // Virtual Tunneling Protocol
  123. #define RAS_TTN_AH _T("AH") // IP Authentication Header in the Tunnel-mode
  124. #define RAS_TTN_IP_IP _T("IP-IP") // IP-in-IP Encapsulation
  125. #define RAS_TTN_MIN_IP_IP _T("MIN-IP-IP") // Minimal IP-in-IP Encapsulation
  126. #define RAS_TTN_ESP _T("ESP") // IP Encapsulation Security Payload in the Tunnel-mode
  127. #define RAS_TTN_GRE _T("GRE") // Generic Route Encapsulation
  128. #define RAS_TTN_DVS _T("DVS") // Bay Dial Virtual Services
  129. // Tunnel Medium Types
  130. #define RAS_TMT_IP 1
  131. #define RAS_TMT_X25 2
  132. #define RAS_TMT_ATM 3
  133. #define RAS_TMT_FRAMEDELAY 4
  134. // Tunnel Medium Type Names
  135. #define RAS_TMTN_IP _T("IP")
  136. #define RAS_TMTN_X25 _T("X.25")
  137. #define RAS_TMTN_ATM _T("ATM")
  138. #define RAS_TMTN_FRAMEDELAY _T("Frame Relay")
  139. #endif // _TUNNEL
  140. //=========================================================
  141. // for msRASAllowDialin attribute of RAS User object
  142. // dialin policy, RASUser, msRASAllowDialin
  143. /*
  144. #define RASPRIV_NoCallback 0x01
  145. #define RASPRIV_AdminSetCallback 0x02
  146. #define RASPRIV_CallerSetCallback 0x04
  147. #define RASPRIV_DialinPrivilege 0x08
  148. */
  149. #define RAS_DIALIN_MASK RASPRIV_DialinPrivilege
  150. #define RAS_DIALIN_ALLOW RASPRIV_DialinPrivilege
  151. #define RAS_DIALIN_DISALLOW 0
  152. // callback policy, RASUser, msRASAllowDialin
  153. #define RAS_CALLBACK_MASK 0x00000007
  154. #define RAS_CALLBACK_NOCALLBACK RASPRIV_NoCallback
  155. #define RAS_CALLBACK_CALLERSET RASPRIV_CallerSetCallback
  156. #define RAS_CALLBACK_SECURE RASPRIV_AdminSetCallback
  157. #define RAS_USE_CALLBACK RASPRIV_AdminSetCallback
  158. #define RADUIS_SERVICETYPE_CALLBACK_FRAME RAS_RST_FRAMEDCALLBACK
  159. // caller id -- uses the caller id attribute, RASUser, msRASAllowDialin
  160. #define RAS_USE_CALLERID 0x00000010
  161. // static IP address -- uses the framed Ip address attribute, RASUser, msRASAllowDialin
  162. #define RAS_USE_STATICIP 0x00000020
  163. // static routes -- uses the framed routes attribute, RASUser, msRASAllowDialin
  164. #define RAS_USE_STATICROUTES 0x00000040
  165. //==========================================================
  166. // msRASTimeOfDay
  167. //
  168. // msRASTimeOfDay is multi-valued string attribute of ras profile
  169. // when it's absent, no restriction
  170. // sample values: 0 10:00-15:00 18:00-20:00 --> meaning allow dailin Monday, 10:00 to 15:00, 18:00 to 20:00 GMT
  171. // day of week definition
  172. // changed to start 0 from SUNDAY rather that MON, and SAT to 6, BUG -- 171343
  173. #define RAS_DOW_SUN _T("0")
  174. #define RAS_DOW_MON _T("1")
  175. #define RAS_DOW_TUE _T("2")
  176. #define RAS_DOW_WED _T("3")
  177. #define RAS_DOW_THU _T("4")
  178. #define RAS_DOW_FRI _T("5")
  179. #define RAS_DOW_SAT _T("6")
  180. //==========================================================
  181. // the default
  182. // ras user object
  183. #define RAS_DEF_ALLOWDIALIN RAS_DIALIN_DISALLOW
  184. #define RAS_DEF_CALLBACKPOLICY RAS_CALLBACK_NOCALLBACK
  185. #define RAS_DEF_IPADDRESSPOLICY RAS_IP_NONE
  186. #define RAS_DEF_FRAMEDROUTE // not route
  187. #define RAS_DEF_PROFILE L"DefaultRASProfile"
  188. #define RAS_DEF_PROFILE_T _T("DefaultRASProfile")
  189. // ras profile object
  190. // constraints
  191. #define RAS_DEF_SESSIONSALLOWED 0
  192. #define RAS_DEF_IDLETIMEOUT 0
  193. #define RAS_DEF_SESSIONTIMEOUT 0
  194. #define RAS_DEF_TIMEOUTDAY // no restriction
  195. #define RAS_DEF_CALLEDSTATIONID // no checking
  196. #define RAS_DEF_ALLOWEDPORTTYPE RAS_PT_ALL
  197. // networking
  198. #ifdef _RIP
  199. #define RAS_DEF_FRAMEDROUTING RAS_FR_FALSE
  200. #endif
  201. #ifdef _FILTER
  202. #define RAS_DEF_FILTERID // no filter
  203. #endif
  204. #define RAS_DEF_FRAMEDIPADDRESS RAS_IP_NONE
  205. // multilink
  206. #define RAS_DEF_PORTLIMIT 1
  207. #define RAS_DEF_BAPLINEDNLIMIT 50 // percentage
  208. #define RAS_DEF_BAPLINEDNTIME 120 // second
  209. #define RAS_DEF_BAPREQUIRED 0
  210. // Authentication
  211. #define RAS_DEF_AUTHENTICATIONTYPE RAS_AT_MSCHAP
  212. #define RAS_DEF_EAPTYPE 0
  213. // encryption
  214. #define RAS_DEF_ENCRYPTIONPOLICY RAS_EP_ALLOW
  215. #define RAS_DEF_ENCRYPTIONTYPE RAS_ET_AUTO
  216. // tunneling -- default to no tunneling
  217. #define RAS_DEF_TUNNELTYPE 0
  218. #define RAS_DEF_TUNNELMEDIUMTYPE 0
  219. #define RAS_DEF_TUNNELSERVERENDPOINT _T("")
  220. #define RAS_DEF_TUNNELPRIVATEGROUPID _T("")
  221. // the relative path from the DS (DSP-DS PATH)
  222. #define RAS_DSP_HEADER L"LDAP://" // DS provider header
  223. #define RAS_DSP_ROOTDSE L"LDAP://RootDSE" // DS Root
  224. #define RAS_DSP_HEADER_T _T("LDAP://")
  225. #define RAS_DSP_GLUE L","
  226. #define RAS_DSP_GLUE_T _T(",") // glue to put path together
  227. #define RAS_DSA_CONFIGCONTEXT L"configurationNamingContext"
  228. // DS user userparameters attribute name
  229. #define DSUSER_USERPARAMETERS L"userParameters"
  230. // the name of the radius user object within the DS user object container
  231. #define RAS_OBJN_USER L"rasDialin"
  232. // the relative path (RPATH - Relative Path to DC)
  233. #define RAS_RPATH_USERCONTAINER L"CN=Users"
  234. #define RAS_RPATH_USERCONTAINER_T _T("CN=Users")
  235. #define RAS_RPATH_PROFILECONTAINERINCONFIG L"CN=Profiles,CN=RAS,CN=Services,"
  236. #define RAS_RPATH_PROFILECONTAINERINONFIG_T _T("CN=Profiles,CN=RAS,CN=Services,")
  237. #define RAS_RPATH_EAPDICTIONARYINCONFIG L"CN=EapDictionary,CN=RAS,CN=Services,"
  238. #define RAS_RPATH_EAPDICTIONARYINCONFIG_T _T("CN=EapDictionary,CN=RAS,CN=Services,")
  239. // Radius Class name definitions -- in UniCode ??
  240. #define RAS_CLSN_USER L"msRASUserClass"
  241. #define RAS_CLSN_PROFILE L"msRASProfileClass"
  242. #define RAS_CLSN_EAPDICTIONARY L"msRASEapDictionaryClass"
  243. // RAS Eap Dictionary Attribute Name
  244. #define RAS_EAN_EAPDICTIONARYENTRY L"msRASEapDictionaryEntry"
  245. // in format "Description name : typeid"
  246. // Radius User Attributes Names -- in Unicode
  247. #define RAS_UAN_ALLOWDIALIN L"msRASAllowDialin"
  248. #define RAS_UAN_FRAMEDIPADDRESS L"msRASFramedIPAddress"
  249. #define RAS_UAN_CALLBACKNUMBER L"msRASCallbackNumber"
  250. #define RAS_UAN_FRAMEDROUTE L"msRASFramedRoute"
  251. #define RAS_UAN_CALLINGSTATIONID L"msRASCallingStationId"
  252. #define RAS_UAN_RADIUSPROFILE L"msRASProfilePointer"
  253. // Radius Profile Attributes Names -- in Unicode
  254. #define RAS_PAN_FRAMEDIPADDRESS L"msRASIPAddressPolicy"
  255. #ifdef _RIP
  256. #define RAS_PAN_FORWARDROUTING L"msRASFramedRouting"
  257. #endif
  258. #ifdef _FILTER
  259. #define RAS_PAN_FILTERID L"msRASFilterId"
  260. #endif
  261. #define RAS_PAN_SESSIONTIMEOUT L"msRASSessionTimeout"
  262. #define RAS_PAN_IDLETIMEOUT L"msRASIdleTimeout"
  263. #define RAS_PAN_CALLEDSTATIONID L"msRASCalledStationId"
  264. #define RAS_PAN_PORTLIMIT L"msRASPortLimit"
  265. #define RAS_PAN_ALLOWEDPORTTYPE L"msRASAllowedPortType"
  266. #define RAS_PAN_BAPLINEDNLIMIT L"msRASBapLineDnLimit"
  267. #define RAS_PAN_BAPLINEDNTIME L"msRASBapLineDnTime"
  268. #define RAS_PAN_BAPREQUIRED L"msRASBapRequired"
  269. #define RAS_PAN_CACHETIMEOUT L"msRASCacheTimeout"
  270. #define RAS_PAN_EAPTYPE L"msRASEapType"
  271. #define RAS_PAN_SESSIONSALLOWED L"msRASSessionsAllowed"
  272. #define RAS_PAN_TIMEOFDAY L"msRASTimeOfDay"
  273. #define RAS_PAN_AUTHENTICATIONTYPE L"msRASAuthenticationType"
  274. #define RAS_PAN_ENCRYPTIONPOLICY L"msRASAllowEncryption"
  275. #define RAS_PAN_ENCRYPTIONTYPE L"msRASEncryptionType"
  276. #ifdef _TUNNEL
  277. #define RAS_PAN_TUNNELTYPE L"msRASTunnelType"
  278. #define RAS_PAN_TUNNELMEDIUMTYPE L"msRASTunnelMediumType"
  279. #define RAS_PAN_TUNNELSERVERENDPOINT L"msRASTunnelServerEndpoint"
  280. #define RAS_PAN_TUNNELPRIVATEGROUPID L"msRASTunnelPrivateGroupId"
  281. #endif //_TUNNEL
  282. //===============================================================
  283. // for local case, neet to set footprint after saving data
  284. #define REGKEY_REMOTEACCESS_PARAMS L"SYSTEM\\CurrentControlSet\\Services\\RemoteAccess\\Parameters"
  285. #define REGVAL_NAME_USERSCONFIGUREDWITHMMC L"UsersConfiguredWithMMC"
  286. #define REGVAL_VAL_USERSCONFIGUREDWITHMMC 1
  287. //=====================================================================
  288. // For machine with NO DS, ras profiles are stored in registry,
  289. // Registry key definitions
  290. // Root of RAS
  291. #define RAS_REG_ROOT HKEY_LOCAL_MACHINE
  292. #define RAS_REG_RAS L"SOFTWARE\\Microsoft\\Ras"
  293. #define RAS_REG_RAS_T _T("SOFTWARE\\Microsoft\\Ras")
  294. #define RAS_REG_PROFILES L"Profiles"
  295. #define RAS_REG_PROFILES_T _T("Profiles")
  296. #define RAS_REG_DEFAULT_PROFILE L"SOFTWARE\\Microsoft\\Ras\\Profiles\\DefaultRASProfile"
  297. #define RAS_REG_DEFAULT_PROFILE_T _T("SOFTWARE\\Microsoft\\Ras\\Profiles\\DefaultRASProfile")
  298. //=================================================
  299. // APIs
  300. #define DllImport __declspec( dllimport )
  301. #define DllExport __declspec( dllexport )
  302. #ifndef __NOT_INCLUDE_OpenRAS_IASProfileDlg__
  303. // =======================================================
  304. // APIs to start profile UI
  305. #define RAS_IAS_PROFILEDLG_SHOW_RASTABS 0x00000001
  306. #define RAS_IAS_PROFILEDLG_SHOW_IASTABS 0x00000002
  307. #define RAS_IAS_PROFILEDLG_SHOW_WIN2K 0x00000004
  308. DllExport HRESULT OpenRAS_IASProfileDlg(
  309. LPCWSTR pMachineName, // the machine name where the snapin is focused
  310. ISdo* pProfile, // profile SDO pointer
  311. ISdoDictionaryOld* pDictionary, // dictionary SDO pointer
  312. BOOL bReadOnly, // if the dlg is for readonly
  313. DWORD dwTabFlags, // what to show
  314. void *pvData // additional data
  315. );
  316. #endif // __NOT_INCLUDE_OpenRAS_IASProfileDlg__
  317. #endif // _RAS_USER_PROFILE