jwaauthif.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. {******************************************************************************}
  2. { }
  3. { Internet Authentication Extensions API interface Unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: authif.h, released June 2000. The original Pascal }
  9. { code is: Authif.pas, released December 2000. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. // $Id: JwaAuthif.pas,v 1.6 2005/09/03 14:27:47 marquardt Exp $
  43. unit JwaAuthif;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "authif.h"'}
  47. {$HPPEMIT ''}
  48. {$I jediapilib.inc}
  49. interface
  50. uses
  51. JwaWindows;
  52. //
  53. // Enumerates the attribute types that are passed to the extension DLL. The
  54. // RADIUS standard attributes are included for convenience and should not be
  55. // considered exhaustive.
  56. //
  57. type
  58. _RADIUS_ATTRIBUTE_TYPE = DWORD;
  59. {$EXTERNALSYM _RADIUS_ATTRIBUTE_TYPE}
  60. RADIUS_ATTRIBUTE_TYPE = _RADIUS_ATTRIBUTE_TYPE;
  61. {$EXTERNALSYM RADIUS_ATTRIBUTE_TYPE}
  62. TRadiusAttributeType = RADIUS_ATTRIBUTE_TYPE;
  63. const
  64. // Used to terminate attribute arrays.
  65. ratMinimum = 0;
  66. {$EXTERNALSYM ratMinimum}
  67. // RADIUS standard attributes.
  68. ratUserName = 1;
  69. {$EXTERNALSYM ratUserName}
  70. ratUserPassword = 2;
  71. {$EXTERNALSYM ratUserPassword}
  72. ratCHAPPassword = 3;
  73. {$EXTERNALSYM ratCHAPPassword}
  74. ratNASIPAddress = 4;
  75. {$EXTERNALSYM ratNASIPAddress}
  76. ratNASPort = 5;
  77. {$EXTERNALSYM ratNASPort}
  78. ratServiceType = 6;
  79. {$EXTERNALSYM ratServiceType}
  80. ratFramedProtocol = 7;
  81. {$EXTERNALSYM ratFramedProtocol}
  82. ratFramedIPAddress = 8;
  83. {$EXTERNALSYM ratFramedIPAddress}
  84. ratFramedIPNetmask = 9;
  85. {$EXTERNALSYM ratFramedIPNetmask}
  86. ratFramedRouting = 10;
  87. {$EXTERNALSYM ratFramedRouting}
  88. ratFilterId = 11;
  89. {$EXTERNALSYM ratFilterId}
  90. ratFramedMTU = 12;
  91. {$EXTERNALSYM ratFramedMTU}
  92. ratFramedCompression = 13;
  93. {$EXTERNALSYM ratFramedCompression}
  94. ratLoginIPHost = 14;
  95. {$EXTERNALSYM ratLoginIPHost}
  96. ratLoginService = 15;
  97. {$EXTERNALSYM ratLoginService}
  98. ratLoginPort = 16;
  99. {$EXTERNALSYM ratLoginPort}
  100. ratReplyMessage = 18;
  101. {$EXTERNALSYM ratReplyMessage}
  102. ratCallbackNumber = 19;
  103. {$EXTERNALSYM ratCallbackNumber}
  104. ratCallbackId = 20;
  105. {$EXTERNALSYM ratCallbackId}
  106. ratFramedRoute = 22;
  107. {$EXTERNALSYM ratFramedRoute}
  108. ratFramedIPXNetwork = 23;
  109. {$EXTERNALSYM ratFramedIPXNetwork}
  110. ratState = 24;
  111. {$EXTERNALSYM ratState}
  112. ratClass = 25;
  113. {$EXTERNALSYM ratClass}
  114. ratVendorSpecific = 26;
  115. {$EXTERNALSYM ratVendorSpecific}
  116. ratSessionTimeout = 27;
  117. {$EXTERNALSYM ratSessionTimeout}
  118. ratIdleTimeout = 28;
  119. {$EXTERNALSYM ratIdleTimeout}
  120. ratTerminationAction = 29;
  121. {$EXTERNALSYM ratTerminationAction}
  122. ratCalledStationId = 30;
  123. {$EXTERNALSYM ratCalledStationId}
  124. ratCallingStationId = 31;
  125. {$EXTERNALSYM ratCallingStationId}
  126. ratNASIdentifier = 32;
  127. {$EXTERNALSYM ratNASIdentifier}
  128. ratProxyState = 33;
  129. {$EXTERNALSYM ratProxyState}
  130. ratLoginLATService = 34;
  131. {$EXTERNALSYM ratLoginLATService}
  132. ratLoginLATNode = 35;
  133. {$EXTERNALSYM ratLoginLATNode}
  134. ratLoginLATGroup = 36;
  135. {$EXTERNALSYM ratLoginLATGroup}
  136. ratFramedAppleTalkLink = 37;
  137. {$EXTERNALSYM ratFramedAppleTalkLink}
  138. ratFramedAppleTalkNetwork = 38;
  139. {$EXTERNALSYM ratFramedAppleTalkNetwork}
  140. ratFramedAppleTalkZone = 39;
  141. {$EXTERNALSYM ratFramedAppleTalkZone}
  142. ratAcctStatusType = 40;
  143. {$EXTERNALSYM ratAcctStatusType}
  144. ratAcctDelayTime = 41;
  145. {$EXTERNALSYM ratAcctDelayTime}
  146. ratAcctInputOctets = 42;
  147. {$EXTERNALSYM ratAcctInputOctets}
  148. ratAcctOutputOctets = 43;
  149. {$EXTERNALSYM ratAcctOutputOctets}
  150. ratAcctSessionId = 44;
  151. {$EXTERNALSYM ratAcctSessionId}
  152. ratAcctAuthentic = 45;
  153. {$EXTERNALSYM ratAcctAuthentic}
  154. ratAcctSessionTime = 46;
  155. {$EXTERNALSYM ratAcctSessionTime}
  156. ratAcctInputPackets = 47;
  157. {$EXTERNALSYM ratAcctInputPackets}
  158. ratAcctOutputPackets = 48;
  159. {$EXTERNALSYM ratAcctOutputPackets}
  160. ratAcctTerminationCause = 49;
  161. {$EXTERNALSYM ratAcctTerminationCause}
  162. ratCHAPChallenge = 60;
  163. {$EXTERNALSYM ratCHAPChallenge}
  164. ratNASPortType = 61;
  165. {$EXTERNALSYM ratNASPortType}
  166. ratPortLimit = 62;
  167. {$EXTERNALSYM ratPortLimit}
  168. // Extended attribute types used to pass additional information.
  169. ratCode = 262; // Request type code.
  170. {$EXTERNALSYM ratCode}
  171. ratIdentifier = 263; // Request identifier.
  172. {$EXTERNALSYM ratIdentifier}
  173. ratAuthenticator = 264; // Request authenticator.
  174. {$EXTERNALSYM ratAuthenticator}
  175. ratSrcIPAddress = 265; // Source IP address.
  176. {$EXTERNALSYM ratSrcIPAddress}
  177. ratSrcPort = 266; // Source IP port.
  178. {$EXTERNALSYM ratSrcPort}
  179. ratProvider = 267; // Authentication provider.
  180. {$EXTERNALSYM ratProvider}
  181. ratStrippedUserName = 268; // User-Name with realm stripped.
  182. {$EXTERNALSYM ratStrippedUserName}
  183. ratFQUserName = 269; // Fully-Qualified-User-Name.
  184. {$EXTERNALSYM ratFQUserName}
  185. ratPolicyName = 270; // Remote Access Policy name.
  186. {$EXTERNALSYM ratPolicyName}
  187. ratUniqueId = 271; // Unique ID identifying the request.
  188. {$EXTERNALSYM ratUniqueId}
  189. ratExtensionState = 272; // Used to pass state between extensions.
  190. {$EXTERNALSYM ratExtensionState}
  191. //
  192. // Enumerates the different RADIUS packet codes. Used for the ratCode extended
  193. // attribute.
  194. //
  195. type
  196. _RADIUS_CODE = DWORD;
  197. {$EXTERNALSYM _RADIUS_CODE}
  198. RADIUS_CODE = _RADIUS_CODE;
  199. {$EXTERNALSYM RADIUS_CODE}
  200. TRadiusCode = RADIUS_CODE;
  201. const
  202. rcUnknown = 0;
  203. {$EXTERNALSYM rcUnknown}
  204. rcAccessRequest = 1;
  205. {$EXTERNALSYM rcAccessRequest}
  206. rcAccessAccept = 2;
  207. {$EXTERNALSYM rcAccessAccept}
  208. rcAccessReject = 3;
  209. {$EXTERNALSYM rcAccessReject}
  210. rcAccountingRequest = 4;
  211. {$EXTERNALSYM rcAccountingRequest}
  212. rcAccountingResponse = 5;
  213. {$EXTERNALSYM rcAccountingResponse}
  214. rcAccessChallenge = 11;
  215. {$EXTERNALSYM rcAccessChallenge}
  216. rcDiscard = 256;
  217. {$EXTERNALSYM rcDiscard}
  218. //
  219. // Enumerates the different authentication providers used for processing a
  220. // request. Used for the ratProvider extended attribute.
  221. //
  222. type
  223. _RADIUS_AUTHENTICATION_PROVIDER = (
  224. rapUnknown,
  225. rapUsersFile,
  226. rapProxy,
  227. rapWindowsNT,
  228. rapMCIS,
  229. rapODBC,
  230. rapNone);
  231. {$EXTERNALSYM _RADIUS_AUTHENTICATION_PROVIDER}
  232. RADIUS_AUTHENTICATION_PROVIDER = _RADIUS_AUTHENTICATION_PROVIDER;
  233. {$EXTERNALSYM RADIUS_AUTHENTICATION_PROVIDER}
  234. TRadiusAuthenticationProvider = RADIUS_AUTHENTICATION_PROVIDER;
  235. //
  236. // Enumerates the different RADIUS data types. A type of 'rdtUnknown' means
  237. // the attribute was not recognized by the dictionary.
  238. //
  239. _RADIUS_DATA_TYPE = (
  240. rdtUnknown,
  241. rdtString,
  242. rdtAddress,
  243. rdtInteger,
  244. rdtTime);
  245. {$EXTERNALSYM _RADIUS_DATA_TYPE}
  246. RADIUS_DATA_TYPE = _RADIUS_DATA_TYPE;
  247. {$EXTERNALSYM RADIUS_DATA_TYPE}
  248. TRadiusDataType = RADIUS_DATA_TYPE;
  249. //
  250. // Struct representing a RADIUS or extended attribute.
  251. //
  252. _RADIUS_ATTRIBUTE = record
  253. dwAttrType: DWORD; // Attribute type
  254. fDataType: RADIUS_DATA_TYPE; // RADIUS_DATA_TYPE of the value
  255. cbDataLength: DWORD; // Length of the value (in bytes)
  256. case Integer of
  257. 0: (dwValue: DWORD); // For rdtAddress, rdtInteger, and rdtTime
  258. 1: (lpValue: PCSTR); // For rdtUnknown, and rdtString
  259. end;
  260. {$EXTERNALSYM _RADIUS_ATTRIBUTE}
  261. RADIUS_ATTRIBUTE = _RADIUS_ATTRIBUTE;
  262. {$EXTERNALSYM RADIUS_ATTRIBUTE}
  263. PRADIUS_ATTRIBUTE = ^RADIUS_ATTRIBUTE;
  264. {$EXTERNALSYM PRADIUS_ATTRIBUTE}
  265. TRadiusAttribute = RADIUS_ATTRIBUTE;
  266. PRadiusAttribute = PRADIUS_ATTRIBUTE;
  267. //
  268. // Struct representing the layout of a RADIUS Vendor-Specific attribute. This
  269. // is useful when interpreting the RADIUS_ATTRIBUTE lpValue field when
  270. // dwAttrType is ratVendorSpecific.
  271. //
  272. _RADIUS_VSA_FORMAT = record
  273. VendorId: array [0..3] of BYTE;
  274. VendorType: BYTE;
  275. VendorLength: BYTE;
  276. AttributeSpecific: array [0..0] of BYTE;
  277. end;
  278. {$EXTERNALSYM _RADIUS_VSA_FORMAT}
  279. RADIUS_VSA_FORMAT = _RADIUS_VSA_FORMAT;
  280. {$EXTERNALSYM RADIUS_VSA_FORMAT}
  281. TRadiusVsaFormat = RADIUS_VSA_FORMAT;
  282. //
  283. // Enumerates the different actions an extension DLL can generate in
  284. // response to an Access-Request.
  285. //
  286. _RADIUS_ACTION = (
  287. raContinue,
  288. raReject,
  289. raAccept);
  290. {$EXTERNALSYM _RADIUS_ACTION}
  291. RADIUS_ACTION = _RADIUS_ACTION;
  292. {$EXTERNALSYM RADIUS_ACTION}
  293. PRADIUS_ACTION = ^RADIUS_ACTION;
  294. {$EXTERNALSYM PRADIUS_ACTION}
  295. TRadiusAction = RADIUS_ACTION;
  296. PRadiusAction = PRADIUS_ACTION;
  297. //
  298. // Routines exported by a RADIUS extension DLL.
  299. //
  300. //
  301. // RadiusExtensionInit is optional. If it exists, it will be invoked prior to
  302. // the service coming on-line. A return value other than NO_ERROR prevents the
  303. // service from initializing.
  304. //
  305. const
  306. RADIUS_EXTENSION_INIT = 'RadiusExtensionInit';
  307. {$EXTERNALSYM RADIUS_EXTENSION_INIT}
  308. type
  309. PRADIUS_EXTENSION_INIT = function: DWORD; stdcall;
  310. {$EXTERNALSYM PRADIUS_EXTENSION_INIT}
  311. PRadiusExtensionInit = PRADIUS_EXTENSION_INIT;
  312. //
  313. // RadiusExtensionTerm is optional. If it exists, it will be invoked prior to
  314. // unloading the DLL to give the extension a chance to clean-up.
  315. //
  316. const
  317. RADIUS_EXTENSION_TERM = 'RadiusExtensionTerm';
  318. {$EXTERNALSYM RADIUS_EXTENSION_TERM}
  319. type
  320. PRADIUS_EXTENSION_TERM = procedure; stdcall;
  321. {$EXTERNALSYM PRADIUS_EXTENSION_TERM}
  322. PRadiusExtensionTerm = PRADIUS_EXTENSION_TERM;
  323. //
  324. // RadiusExtensionProcess is mandatory for NT4. For Windows 2000, an
  325. // extension may export RadiusExtensionProcessEx (q.v.) instead.
  326. //
  327. // Parameters:
  328. // pAttrs Array of attributes from the request. It is terminated by an
  329. // attribute with dwAttrType set to ratMinimum. These attributes
  330. // should be treated as read-only and must not be referenced
  331. // after the function returns.
  332. // pfAction For Access-Requests, this parameter will be non-NULL with
  333. // *pfAction == raContinue. The extension DLL can set *pfAction
  334. // to abort further processing and force an Access-Accept or
  335. // Access-Reject. For all other request types, this parameter
  336. // will be NULL.
  337. //
  338. // Return Value:
  339. // A return value other than NO_ERROR causes the request to be discarded.
  340. //
  341. const
  342. RADIUS_EXTENSION_PROCESS = 'RadiusExtensionProcess';
  343. {$EXTERNALSYM RADIUS_EXTENSION_PROCESS}
  344. type
  345. PRADIUS_EXTENSION_PROCESS = function(pAttrs: PRADIUS_ATTRIBUTE; pfAction: PRADIUS_ACTION): DWORD; stdcall;
  346. {$EXTERNALSYM PRADIUS_EXTENSION_PROCESS}
  347. PRadiusExtensionProcess = PRADIUS_EXTENSION_PROCESS;
  348. //
  349. // RadiusExtensionProcessEx is only supported on Windows 2000. If it exits,
  350. // RadiusExtensionProcess is ignored.
  351. //
  352. // Parameters:
  353. // pInAttrs Array of attributes from the request. It is terminated by an
  354. // attribute with dwAttrType set to ratMinimum. These attributes
  355. // should be treated as read-only and must not be referenced
  356. // after the function returns.
  357. // pOutAttrs Array of attributes to add to the response. It is terminated
  358. // by an attribute with dwAttrType set to ratMinimum.
  359. // *pOutAttrs may be set to NULL if no attributes are returned.
  360. // pfAction For Access-Requests, this parameter will be non-NULL with
  361. // *pfAction == raContinue. The extension DLL can set *pfAction
  362. // to abort further processing and force an Access-Accept or
  363. // Access-Reject. For all other request types, this parameter
  364. // will be NULL.
  365. //
  366. // Return Value:
  367. // A return value other than NO_ERROR causes the request to be discarded.
  368. //
  369. const
  370. RADIUS_EXTENSION_PROCESS_EX = 'RadiusExtensionProcessEx';
  371. {$EXTERNALSYM RADIUS_EXTENSION_PROCESS_EX}
  372. type
  373. PRADIUS_EXTENSION_PROCESS_EX = function(pInAttrs: PRADIUS_ATTRIBUTE;
  374. pOutAttrs: PRADIUS_ATTRIBUTE; pfAction: PRADIUS_ACTION): DWORD; stdcall;
  375. {$EXTERNALSYM PRADIUS_EXTENSION_PROCESS_EX}
  376. PRadiusExtensionProcessEx = PRADIUS_EXTENSION_PROCESS_EX;
  377. //
  378. // RadiusExtensionFreeAttributes must be defined if RadiusExtensionProcessEx
  379. // is defined. It is used to free the attributes returned by
  380. // RadiusExtensionProcessEx
  381. //
  382. // Parameters:
  383. // pAttrs Array of attributes to be freed.
  384. //
  385. const
  386. RADIUS_EXTENSION_FREE_ATTRIBUTES = 'RadiusExtensionFreeAttributes';
  387. {$EXTERNALSYM RADIUS_EXTENSION_FREE_ATTRIBUTES}
  388. type
  389. PRADIUS_EXTENSION_FREE_ATTRIBUTES = procedure(pAttrs: PRADIUS_ATTRIBUTE); stdcall;
  390. {$EXTERNALSYM PRADIUS_EXTENSION_FREE_ATTRIBUTES}
  391. PRadiusExtensionFreeAttributes = PRADIUS_EXTENSION_FREE_ATTRIBUTES;
  392. //
  393. // Defines used for installation of an extension DLL.
  394. // The following registry values are used for loading extensions:
  395. //
  396. // HKLM\System\CurrentControlSet\Services\AuthSrv\Parameters
  397. // ExtensionDLLs (REG_MULTI_SZ) <list of DLL paths>
  398. // AuthorizationDLLs (REG_MULTI_SZ) <list of DLL paths>
  399. //
  400. // ExtensionDLLs are invoked before any of the built-in authentication
  401. // providers. They receive all the attributes from the request plus all
  402. // the extended attribute types.
  403. //
  404. // AuthorizationDLLs are invoked after the built-in authentication and
  405. // authorization providers. They receive all the attributes from the
  406. // response plus all the extended attributes types. AuthorizationDLLs may
  407. // not return an action of raAccept.
  408. //
  409. const
  410. AUTHSRV_PARAMETERS_KEY_W = WideString('System\CurrentControlSet\Services\AuthSrv\Parameters');
  411. {$EXTERNALSYM AUTHSRV_PARAMETERS_KEY_W}
  412. AUTHSRV_EXTENSIONS_VALUE_W = WideString('ExtensionDLLs');
  413. {$EXTERNALSYM AUTHSRV_EXTENSIONS_VALUE_W}
  414. AUTHSRV_AUTHORIZATION_VALUE_W = WideString('AuthorizationDLLs');
  415. {$EXTERNALSYM AUTHSRV_AUTHORIZATION_VALUE_W}
  416. // #if _WIN32_WINNT >= 0x0501
  417. // Version of this spec.
  418. const
  419. RADIUS_EXTENSION_VERSION = 1;
  420. {$EXTERNALSYM RADIUS_EXTENSION_VERSION}
  421. //
  422. // Enumerates the different points during request processing where an
  423. // extension can be invoked.
  424. //
  425. type
  426. _RADIUS_EXTENSION_POINT = (
  427. repAuthentication, // ExtensionDLLs
  428. repAuthorization); // AuthorizationDLLs
  429. {$EXTERNALSYM _RADIUS_EXTENSION_POINT}
  430. RADIUS_EXTENSION_POINT = _RADIUS_EXTENSION_POINT;
  431. {$EXTERNALSYM RADIUS_EXTENSION_POINT}
  432. TRadiusExtensionPoint = RADIUS_EXTENSION_POINT;
  433. //
  434. // Struct representing an array of RADIUS_ATTRIBUTE structs. All the functions
  435. // for adding attributes to a request copy the supplied memory, so there is no
  436. // need for the extension to export RadiusExtensionFreeAttributes. The
  437. // extension must not modify this struct. All changes must be made by using the
  438. // supplied callback functions.
  439. //
  440. PRADIUS_ATTRIBUTE_ARRAY = ^RADIUS_ATTRIBUTE_ARRAY;
  441. {$EXTERNALSYM PRADIUS_ATTRIBUTE_ARRAY}
  442. PPRADIUS_ATTRIBUTE_ARRAY = ^PRADIUS_ATTRIBUTE_ARRAY;
  443. _RADIUS_ATTRIBUTE_ARRAY = record
  444. // Size of this structure in bytes.
  445. cbSize: DWORD;
  446. // Adds a new attribute to the end of the array.
  447. Add: function(This: PRADIUS_ATTRIBUTE_ARRAY; pAttr: PRADIUS_ATTRIBUTE): DWORD; stdcall;
  448. //
  449. // Returns a const pointer to the specified attribute within the array or
  450. // NULL if the index is out of range.
  451. //
  452. AttributeAt: function(This: PPRADIUS_ATTRIBUTE_ARRAY; dwIndex: DWORD): PRADIUS_ATTRIBUTE; stdcall;
  453. //
  454. // Returns the size of the array. Since indexes are zero-based, the size is
  455. // 1 greater than the largest index.
  456. //
  457. GetSize: function(This: PRADIUS_ATTRIBUTE_ARRAY): DWORD; stdcall;
  458. //
  459. // Inserts a new attribute at a specified index in the array. In the
  460. // process, it shifts up (by incrementing the index) the existing attribute
  461. // at this index, and it shifts up all the attributes above it. Returns
  462. // ERROR_INVALID_PARAMETER if the index is out of range.
  463. //
  464. InsertAt: function(This: PRADIUS_ATTRIBUTE_ARRAY; dwIndex: DWORD; pAttr: PRADIUS_ATTRIBUTE): DWORD; stdcall;
  465. //
  466. // Removes the attribute at the specified index in the array. In the
  467. // process, it shifts down all the attributes above the removed attribute.
  468. // Returns ERROR_ACCESS_DENIED if the specified attribute is read-only.
  469. // Returns ERROR_INVALID_PARAMETER if the index is out of range.
  470. //
  471. RemoveAt: function(This: PRADIUS_ATTRIBUTE_ARRAY; dwIndex: DWORD): DWORD; stdcall;
  472. //
  473. // Sets the array element at the specified index, replacing the existing
  474. // attribute. Returns ERROR_INVALID_PARAMETER if the index is out of range.
  475. //
  476. SetAt: function(This: PPRADIUS_ATTRIBUTE_ARRAY; dwIndex: DWORD; pAttr: PRADIUS_ATTRIBUTE): DWORD; stdcall;
  477. end;
  478. {$EXTERNALSYM _RADIUS_ATTRIBUTE_ARRAY}
  479. RADIUS_ATTRIBUTE_ARRAY = _RADIUS_ATTRIBUTE_ARRAY;
  480. {$EXTERNALSYM RADIUS_ATTRIBUTE_ARRAY}
  481. TRadiusAttributeArray = RADIUS_ATTRIBUTE_ARRAY;
  482. PRadiusAttributeArray = PRADIUS_ATTRIBUTE_ARRAY;
  483. //
  484. // Struct used to exchange information with the extension during request
  485. // processing. The extension must not modify this struct. All changes must be
  486. // made by using the supplied callback functions.
  487. //
  488. PRADIUS_EXTENSION_CONTROL_BLOCK = ^RADIUS_EXTENSION_CONTROL_BLOCK;
  489. {$EXTERNALSYM PRADIUS_EXTENSION_CONTROL_BLOCK}
  490. _RADIUS_EXTENSION_CONTROL_BLOCK = record
  491. // Size of this structure.
  492. cbSize: DWORD;
  493. // Version info of this specification.
  494. dwVersion: DWORD;
  495. // Point during request processing where the extension is being invoked.
  496. repPoint: RADIUS_EXTENSION_POINT;
  497. // Type of RADIUS request being processed.
  498. rcRequestType: RADIUS_CODE;
  499. //
  500. // Final disposition of the request. This field must not be modified
  501. // directly; use the SetResponseType callback function instead. At the
  502. // repAuthentication point, this may be set to rcUnknown to indicate that no
  503. // decision has been made yet.
  504. //
  505. rcResponseType: RADIUS_CODE;
  506. //
  507. // Returns the attributes received in the RADIUS request and any internal
  508. // attributes describing the request state. The extenstion can modify the
  509. // request attributes. For example, when IAS is acting as a RADIUS proxy, an
  510. // extension could filter which attributes are forwarded to a remote RADIUS
  511. // server.
  512. //
  513. GetRequest: function(This: PRADIUS_EXTENSION_CONTROL_BLOCK): PRADIUS_ATTRIBUTE_ARRAY; stdcall;
  514. //
  515. // Returns the attributes that will be sent in the response if the final
  516. // outcome of request processing matches the specified response type.
  517. // Returns NULL if rcResponseType is invalid. Note that an extension may
  518. // retrieve and modify the attributes for any valid response type regardless
  519. // of the request's current disposition. For example, an extension can set
  520. // the response type to rcAccessAccept, but still add attributes to the
  521. // Access-Reject in case the response type is overridden during further
  522. // processing.
  523. //
  524. GetResponse: function(This: PRADIUS_EXTENSION_CONTROL_BLOCK; rcResponseType: RADIUS_CODE): PRADIUS_ATTRIBUTE_ARRAY; stdcall;
  525. //
  526. // Sets the final disposition of the request.
  527. // Returns ERROR_INVALID_PARAMETER if the specified response type is invalid
  528. // for the request type.
  529. //
  530. SetResponseType: function(This: PRADIUS_EXTENSION_CONTROL_BLOCK; rcResponseType: RADIUS_CODE): DWORD; stdcall;
  531. end;
  532. {$EXTERNALSYM _RADIUS_EXTENSION_CONTROL_BLOCK}
  533. RADIUS_EXTENSION_CONTROL_BLOCK = _RADIUS_EXTENSION_CONTROL_BLOCK;
  534. {$EXTERNALSYM RADIUS_EXTENSION_CONTROL_BLOCK}
  535. TRadiusExtensionControlBlock = RADIUS_EXTENSION_CONTROL_BLOCK;
  536. PRadiusExtensionControlBlock = PRADIUS_EXTENSION_CONTROL_BLOCK;
  537. //
  538. // If RadiusExtensionProcess2 exists, RadiusExtensionProcess and
  539. // RadiusExtensionProcessEx are ignored.
  540. //
  541. // Parameters:
  542. // pECB Info exchanged with the extension.
  543. //
  544. // Return Value:
  545. // A return value other than NO_ERROR causes the request to be discarded.
  546. ///
  547. const
  548. RADIUS_EXTENSION_PROCESS2 = 'RadiusExtensionProcess2';
  549. {$EXTERNALSYM RADIUS_EXTENSION_PROCESS2}
  550. type
  551. PRADIUS_EXTENSION_PROCESS_2 = function(pECB: PRADIUS_EXTENSION_CONTROL_BLOCK): DWORD; stdcall;
  552. {$EXTERNALSYM PRADIUS_EXTENSION_PROCESS_2}
  553. implementation
  554. end.