jwaauthif.pas 23 KB

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