jwaauthif.pas 22 KB

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