]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/EapManagement.h
fc67a15aa0347197007c009a46ca1a4f8064cd57
[mirror_edk2.git] / MdePkg / Include / Protocol / EapManagement.h
1 /** @file
2 EFI EAP Management Protocol Definition
3 The EFI EAP Management Protocol is designed to provide ease of management and
4 ease of test for EAPOL state machine. It is intended for the supplicant side.
5 It conforms to IEEE 802.1x specification.
6 The definitions in this file are defined in UEFI Specification 2.3, which have
7 not been verified by one implementation yet.
8
9 Copyright (c) 2009, Intel Corporation
10 All rights reserved. This program and the accompanying materials
11 are licensed and made available under the terms and conditions of the BSD License
12 which accompanies this distribution. The full text of the license may be found at
13 http://opensource.org/licenses/bsd-license.php
14
15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
16 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17
18 **/
19
20 #ifndef __EFI_EAP_MANAGEMENT_PROTOCOL_H__
21 #define __EFI_EAP_MANAGEMENT_PROTOCOL_H__
22
23 #include <Protocol/Eap.h>
24
25 #define EFI_EAP_MANAGEMENT_PROTOCOL_GUID \
26 { \
27 0xbb62e663, 0x625d, 0x40b2, {0xa0, 0x88, 0xbb, 0xe8, 0x36, 0x23, 0xa2, 0x45 } \
28 }
29
30 typedef struct _EFI_EAP_MANAGEMENT_PROTOCOL EFI_EAP_MANAGEMENT_PROTOCOL;
31
32 ///
33 /// PAE Capabilities
34 ///
35 ///@{
36 #define PAE_SUPPORT_AUTHENTICATOR 0x01
37 #define PAE_SUPPORT_SUPPLICANT 0x02
38 ///@}
39
40 ///
41 /// EFI_EAPOL_PORT_INFO
42 ///
43 typedef struct _EFI_EAPOL_PORT_INFO {
44 ///
45 /// The identification number assigned to the Port by the System in
46 /// which the Port resides.
47 ///
48 EFI_PORT_HANDLE PortNumber;
49 ///
50 /// The protocol version number of the EAPOL implementation
51 /// supported by the Port.
52 ///
53 UINT8 ProtocolVersion;
54 ///
55 /// The capabilities of the PAE associated with the Port. This field
56 /// indicates whether Authenticator functionality, Supplicant
57 /// functionality, both, or neither, is supported by the Port's PAE.
58 ///
59 UINT8 PaeCapabilities;
60 } EFI_EAPOL_PORT_INFO;
61
62 ///
63 /// Supplicant PAE state machine (IEEE Std 802.1X Section 8.5.10)
64 ///
65 typedef enum _EFI_EAPOL_SUPPLICANT_PAE_STATE {
66 Logoff,
67 Disconnected,
68 Connecting,
69 Acquired,
70 Authenticating,
71 Held,
72 Authenticated,
73 MaxSupplicantPaeState
74 } EFI_EAPOL_SUPPLICANT_PAE_STATE;
75
76 ///
77 /// Definitions for ValidFieldMask
78 ///
79 ///@{
80 #define AUTH_PERIOD_FIELD_VALID 0x01
81 #define HELD_PERIOD_FIELD_VALID 0x02
82 #define START_PERIOD_FIELD_VALID 0x04
83 #define MAX_START_FIELD_VALID 0x08
84 ///@}
85
86 ///
87 /// EFI_EAPOL_SUPPLICANT_PAE_CONFIGURATION
88 ///
89 typedef struct _EFI_EAPOL_SUPPLICANT_PAE_CONFIGURATION {
90 ///
91 /// Indicates which of the following fields are valid.
92 ///
93 UINT8 ValidFieldMask;
94 ///
95 /// The initial value for the authWhile timer. Its default value is 30s.
96 ///
97 UINTN AuthPeriod;
98 ///
99 /// The initial value for the heldWhile timer. Its default value is 60s.
100 ///
101 UINTN HeldPeriod;
102 ///
103 /// The initial value for the startWhen timer. Its default value is 30s.
104 ///
105 UINTN StartPeriod;
106 ///
107 /// The maximum number of successive EAPOL-Start messages will
108 /// be sent before the Supplicant assumes that there is no
109 /// Authenticator present. Its default value is 3.
110 ///
111 UINTN MaxStart;
112 } EFI_EAPOL_SUPPLICANT_PAE_CONFIGURATION;
113
114 ///
115 /// Supplicant Statistics (IEEE Std 802.1X Section 9.5.2)
116 ///
117 typedef struct _EFI_EAPOL_SUPPLICANT_PAE_STATISTICS {
118 ///
119 /// The number of EAPOL frames of any type that have been received by this Supplican.
120 ///
121 UINTN EapolFramesReceived;
122 ///
123 /// The number of EAPOL frames of any type that have been transmitted by this Supplicant.
124 ///
125 UINTN EapolFramesTransmitted;
126 ///
127 /// The number of EAPOL Start frames that have been transmitted by this Supplicant.
128 ///
129 UINTN EapolStartFramesTransmitted;
130 ///
131 /// The number of EAPOL Logoff frames that have been transmitted by this Supplicant.
132 ///
133 UINTN EapolLogoffFramesTransmitted;
134 ///
135 /// The number of EAP Resp/Id frames that have been transmitted by this Supplicant.
136 ///
137 UINTN EapRespIdFramesTransmitted;
138 ///
139 /// The number of valid EAP Response frames (other than Resp/Id frames) that have been
140 /// transmitted by this Supplicant.
141 ///
142 UINTN EapResponseFramesTransmitted;
143 ///
144 /// The number of EAP Req/Id frames that have been received by this Supplicant.
145 ///
146 UINTN EapReqIdFramesReceived;
147 ///
148 /// The number of EAP Request frames (other than Rq/Id frames) that have been received
149 /// by this Supplicant.
150 ///
151 UINTN EapRequestFramesReceived;
152 ///
153 /// The number of EAPOL frames that have been received by this Supplicant in which the
154 /// frame type is not recognized.
155 ///
156 UINTN InvalidEapolFramesReceived;
157 ///
158 /// The number of EAPOL frames that have been received by this Supplicant in which the
159 /// Packet Body Length field (7.5.5) is invalid.
160 ///
161 UINTN EapLengthErrorFramesReceived;
162 ///
163 /// The protocol version number carried in the most recently received EAPOL frame.
164 ///
165 UINTN LastEapolFrameVersion;
166 ///
167 /// The source MAC address carried in the most recently received EAPOL frame.
168 ///
169 UINTN LastEapolFrameSource;
170 } EFI_EAPOL_SUPPLICANT_PAE_STATISTICS;
171
172 /**
173 Read the system configuration information associated with the Port.
174
175 The GetSystemConfiguration() function reads the system configuration
176 information associated with the Port, including the value of the
177 SystemAuthControl parameter of the System is returned in SystemAuthControl
178 and the Port's information is returned in the buffer pointed to by PortInfo.
179 The Port's information is optional.
180 If PortInfo is NULL, then reading the Port's information is ignored.
181
182 If SystemAuthControl is NULL, then EFI_INVALID_PARAMETER is returned.
183
184 @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
185 instance that indicates the calling context.
186 @param[out] SystemAuthControl Returns the value of the SystemAuthControl
187 parameter of the System.
188 TRUE means Enabled. FALSE means Disabled.
189 @param[out] PortInfo Returns EFI_EAPOL_PORT_INFO structure to describe
190 the Port's information. This parameter can be NULL
191 to ignore reading the Port's information.
192
193 @retval EFI_SUCCESS The system configuration information of the
194 Port is read successfully.
195 @retval EFI_INVALID_PARAMETER SystemAuthControl is NULL.
196
197
198 **/
199 typedef
200 EFI_STATUS
201 (EFIAPI *EFI_EAP_GET_SYSTEM_CONFIGURATION)(
202 IN struct _EFI_EAP_MANAGEMENT_PROTOCOL *This,
203 OUT BOOLEAN *SystemAuthControl,
204 OUT EFI_EAPOL_PORT_INFO *PortInfo OPTIONAL
205 );
206
207 /**
208 Set the system configuration information associated with the Port.
209
210 The SetSystemConfiguration() function sets the value of the SystemAuthControl
211 parameter of the System to SystemAuthControl.
212
213 @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
214 instance that indicates the calling context.
215 @param[in] SystemAuthControl The desired value of the SystemAuthControl
216 parameter of the System.
217 TRUE means Enabled. FALSE means Disabled.
218
219 @retval EFI_SUCCESS The system configuration information of the
220 Port is set successfully.
221
222 **/
223 typedef
224 EFI_STATUS
225 (EFIAPI *EFI_EAP_SET_SYSTEM_CONFIGURATION)(
226 IN struct _EFI_EAP_MANAGEMENT_PROTOCOL *This,
227 IN BOOLEAN SystemAuthControl
228 );
229
230 /**
231 Cause the EAPOL state machines for the Port to be initialized.
232
233 The InitializePort() function causes the EAPOL state machines for the Port.
234
235 @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
236 instance that indicates the calling context.
237
238 @retval EFI_SUCCESS The Port is initialized successfully.
239
240 **/
241 typedef
242 EFI_STATUS
243 (EFIAPI *EFI_EAP_INITIALIZE_PORT)(
244 IN struct _EFI_EAP_MANAGEMENT_PROTOCOL *This
245 );
246
247 /**
248 Notify the EAPOL state machines for the Port that the user of the System has
249 logged on.
250
251 The UserLogon() function notifies the EAPOL state machines for the Port.
252
253 @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
254 instance that indicates the calling context.
255
256 @retval EFI_SUCCESS The Port is notified successfully.
257
258 **/
259 typedef
260 EFI_STATUS
261 (EFIAPI *EFI_EAP_USER_LOGON)(
262 IN struct _EFI_EAP_MANAGEMENT_PROTOCOL *This
263 );
264
265 /**
266 Notify the EAPOL state machines for the Port that the user of the System has
267 logged off.
268
269 The UserLogoff() function notifies the EAPOL state machines for the Port.
270
271 @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
272 instance that indicates the calling context.
273
274 @retval EFI_SUCCESS The Port is notified successfully.
275
276 **/
277 typedef
278 EFI_STATUS
279 (EFIAPI *EFI_EAP_USER_LOGOFF)(
280 IN struct _EFI_EAP_MANAGEMENT_PROTOCOL *This
281 );
282
283 /**
284 Read the status of the Supplicant PAE state machine for the Port, including the
285 current state and the configuration of the operational parameters.
286
287 The GetSupplicantStatus() function reads the status of the Supplicant PAE state
288 machine for the Port, including the current state CurrentState and the configuration
289 of the operational parameters Configuration. The configuration of the operational
290 parameters is optional. If Configuration is NULL, then reading the configuration
291 is ignored. The operational parameters in Configuration to be read can also be
292 specified by Configuration.ValidFieldMask.
293
294 If CurrentState is NULL, then EFI_INVALID_PARAMETER is returned.
295
296 @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
297 instance that indicates the calling context.
298 @param[out] CurrentState Returns the current state of the Supplicant PAE
299 state machine for the Port.
300 @param[in, out] Configuration Returns the configuration of the operational
301 parameters of the Supplicant PAE state machine
302 for the Port as required. This parameter can be
303 NULL to ignore reading the configuration.
304 On input, Configuration.ValidFieldMask specifies the
305 operational parameters to be read.
306 On output, Configuration returns the configuration
307 of the required operational parameters.
308
309 @retval EFI_SUCCESS The configuration of the operational parameter
310 of the Supplicant PAE state machine for the Port
311 is set successfully.
312 @retval EFI_INVALID_PARAMETER CurrentState is NULL.
313
314 **/
315 typedef
316 EFI_STATUS
317 (EFIAPI *EFI_EAP_GET_SUPPLICANT_STATUS)(
318 IN struct _EFI_EAP_MANAGEMENT_PROTOCOL *This,
319 OUT EFI_EAPOL_SUPPLICANT_PAE_STATE *CurrentState,
320 IN OUT EFI_EAPOL_SUPPLICANT_PAE_CONFIGURATION *Configuration OPTIONAL
321 );
322
323 /**
324 Set the configuration of the operational parameter of the Supplicant PAE
325 state machine for the Port.
326
327 The SetSupplicantConfiguration() function sets the configuration of the
328 operational Parameter of the Supplicant PAE state machine for the Port to
329 Configuration. The operational parameters in Configuration to be set can be
330 specified by Configuration.ValidFieldMask.
331
332 If Configuration is NULL, then EFI_INVALID_PARAMETER is returned.
333
334 @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
335 instance that indicates the calling context.
336 @param[in] Configuration The desired configuration of the operational
337 parameters of the Supplicant PAE state machine
338 for the Port as required.
339
340 @retval EFI_SUCCESS The configuration of the operational parameter
341 of the Supplicant PAE state machine for the Port
342 is set successfully.
343 @retval EFI_INVALID_PARAMETER Configuration is NULL.
344
345 **/
346 typedef
347 EFI_STATUS
348 (EFIAPI *EFI_EAP_SET_SUPPLICANT_CONFIGURATION)(
349 IN struct _EFI_EAP_MANAGEMENT_PROTOCOL *This,
350 IN EFI_EAPOL_SUPPLICANT_PAE_CONFIGURATION *Configuration
351 );
352
353 /**
354 Read the statistical information regarding the operation of the Supplicant
355 associated with the Port.
356
357 The GetSupplicantStatistics() function reads the statistical information
358 Statistics regarding the operation of the Supplicant associated with the Port.
359
360 If Statistics is NULL, then EFI_INVALID_PARAMETER is returned.
361
362 @param[in] This A pointer to the EFI_EAP_MANAGEMENT_PROTOCOL
363 instance that indicates the calling context.
364 @param[out] Statistics Returns the statistical information regarding the
365 operation of the Supplicant for the Port.
366
367 @retval EFI_SUCCESS The statistical information regarding the operation
368 of the Supplicant for the Port is read successfully.
369 @retval EFI_INVALID_PARAMETER Statistics is NULL.
370
371 **/
372 typedef
373 EFI_STATUS
374 (EFIAPI *EFI_EAP_GET_SUPPLICANT_STATISTICS)(
375 IN struct _EFI_EAP_MANAGEMENT_PROTOCOL *This,
376 OUT EFI_EAPOL_SUPPLICANT_PAE_STATISTICS *Statistics
377 );
378
379 ///
380 /// EFI_EAP_MANAGEMENT_PROTOCOL
381 /// is used to control, configure and monitor EAPOL state machine on
382 /// a Port. EAPOL state machine is built on a per-Port basis. Herein,
383 /// a Port means a NIC. For the details of EAPOL, please refer to
384 /// IEEE 802.1x specification.
385 ///
386 struct _EFI_EAP_MANAGEMENT_PROTOCOL {
387 EFI_EAP_GET_SYSTEM_CONFIGURATION GetSystemConfiguration;
388 EFI_EAP_SET_SYSTEM_CONFIGURATION SetSystemConfiguration;
389 EFI_EAP_INITIALIZE_PORT InitializePort;
390 EFI_EAP_USER_LOGON UserLogon;
391 EFI_EAP_USER_LOGOFF UserLogoff;
392 EFI_EAP_GET_SUPPLICANT_STATUS GetSupplicantStatus;
393 EFI_EAP_SET_SUPPLICANT_CONFIGURATION SetSupplicantConfiguration;
394 EFI_EAP_GET_SUPPLICANT_STATISTICS GetSupplicantStatistics;
395 };
396
397 extern EFI_GUID gEfiEapManagementProtocolGuid;
398
399 #endif
400