]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Eap.h
99c2b865ecd1a8ac5d8099c7c8e5bfaaf15473cc
[mirror_edk2.git] / MdePkg / Include / Protocol / Eap.h
1 /** @file
2 EFI EAP(Extended Authenticaton Protocol) Protocol Definition
3 The EFI EAP Protocol is used to abstract the ability to configure and extend the
4 EAP framework.
5 The definitions in this file are defined in UEFI Specification 2.3, which have
6 not been verified by one implementation yet.
7
8 Copyright (c) 2009, Intel Corporation
9 All rights reserved. This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16
17 **/
18
19 #ifndef __EFI_EAP_PROTOCOL_H__
20 #define __EFI_EAP_PROTOCOL_H__
21
22
23 #define EFI_EAP_PROTOCOL_GUID \
24 { \
25 0x5d9f96db, 0xe731, 0x4caa, {0xa0, 0xd, 0x72, 0xe1, 0x87, 0xcd, 0x77, 0x62 } \
26 }
27
28 typedef struct _EFI_EAP_PROTOCOL EFI_EAP_PROTOCOL;
29
30 ///
31 /// Type for the identification number assigned to the Port by the
32 /// System in which the Port resides.
33 ///
34 typedef VOID * EFI_PORT_HANDLE;
35
36 ///
37 /// EAP Authentication Method Type (RFC 2284 Section 3)
38 ///@{
39 #define EFI_EAP_TYPE_MD5 0x4 ///< REQUIRED
40 #define EFI_EAP_TYPE_OTP 0x5 ///< OPTIONAL
41 #define EFI_EAP_TYPE_TOKEN_CARD 0x6 ///< OPTIONAL
42 ///@}
43
44
45 /**
46 One user provided EAP authentication method.
47
48 Build EAP response packet in response to the EAP request packet specified by
49 (RequestBuffer, RequestSize).
50
51 @param[in] PortNumber Specified the Port where the EAP request packet comes.
52 @param[in] RequestBuffer Pointer to the most recently received EAP- Request packet.
53 @param[in] RequestSize Packet size in bytes for the most recently received
54 EAP-Request packet.
55 @param[in] Buffer Pointer to the buffer to hold the built packet.
56 @param[in, out] BufferSize Pointer to the buffer size in bytes.
57 On input, it is the buffer size provided by the caller.
58 On output, it is the buffer size in fact needed to contain
59 the packet.
60
61 @retval EFI_SUCCESS The required EAP response packet is built successfully.
62 @retval others Failures are encountered during the packet building process.
63
64 **/
65 typedef
66 EFI_STATUS
67 (EFIAPI *EFI_EAP_BUILD_RESPONSE_PACKET)(
68 IN EFI_PORT_HANDLE PortNumber,
69 IN UINT8 *RequestBuffer,
70 IN UINTN RequestSize,
71 IN UINT8 *Buffer,
72 IN OUT UINTN *BufferSize
73 );
74
75 /**
76 Set the desired EAP authentication method for the Port.
77
78 The SetDesiredAuthMethod() function sets the desired EAP authentication method indicated
79 by EapAuthType for the Port.
80
81 If EapAuthType is an invalid EAP authentication type, then EFI_INVALID_PARAMETER is
82 returned.
83 If the EAP authentication method of EapAuthType is unsupported by the Ports, then this
84 function will return EFI_UNSUPPORTED.
85
86 @param[in] This A pointer to the EFI_EAP_PROTOCOL instance that indicates
87 the calling context.
88 @param[in] EapAuthType The type of the EAP authentication method to register. It should
89 be the type value defined by RFC. See RFC 2284 for details.
90 @param[in] Handler The handler of the EAP authentication method to register.
91
92 @retval EFI_SUCCESS The EAP authentication method of EapAuthType is
93 registered successfully.
94 @retval EFI_INVALID_PARAMETER EapAuthType is an invalid EAP authentication type.
95 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to perform the registration.
96
97 **/
98 typedef
99 EFI_STATUS
100 (EFIAPI *EFI_EAP_SET_DESIRED_AUTHENTICATION_METHOD)(
101 IN struct _EFI_EAP_PROTOCOL *This,
102 IN UINT8 EapAuthType
103 );
104
105 /**
106 Register an EAP authentication method.
107
108 The RegisterAuthMethod() function registers the user provided EAP authentication method,
109 the type of which is EapAuthType and the handler of which is Handler.
110
111 If EapAuthType is an invalid EAP authentication type, then EFI_INVALID_PARAMETER is
112 returned.
113 If there is not enough system memory to perform the registration, then
114 EFI_OUT_OF_RESOURCES is returned.
115
116 @param[in] This A pointer to the EFI_EAP_PROTOCOL instance that indicates
117 the calling context.
118 @param[in] EapAuthType The type of the EAP authentication method to register. It should
119 be the type value defined by RFC. See RFC 2284 for details.
120 @param[in] Handler The handler of the EAP authentication method to register.
121
122 @retval EFI_SUCCESS The EAP authentication method of EapAuthType is
123 registered successfully.
124 @retval EFI_INVALID_PARAMETER EapAuthType is an invalid EAP authentication type.
125 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to perform the registration.
126
127 **/
128 typedef
129 EFI_STATUS
130 (EFIAPI *EFI_EAP_REGISTER_AUTHENTICATION_METHOD)(
131 IN struct _EFI_EAP_PROTOCOL *This,
132 IN UINT8 EapAuthType,
133 IN EFI_EAP_BUILD_RESPONSE_PACKET Handler
134 );
135
136 ///
137 /// EFI_EAP_PROTOCOL
138 /// is used to configure the desired EAP authentication method for the EAP
139 /// framework and extend the EAP framework by registering new EAP authentication
140 /// method on a Port. The EAP framework is built on a per-Port basis. Herein, a
141 /// Port means a NIC. For the details of EAP protocol, please refer to RFC 2284.
142 ///
143 struct _EFI_EAP_PROTOCOL {
144 EFI_EAP_SET_DESIRED_AUTHENTICATION_METHOD SetDesiredAuthMethod;
145 EFI_EAP_REGISTER_AUTHENTICATION_METHOD RegisterAuthMethod;
146 };
147
148 extern EFI_GUID gEfiEapProtocolGuid;
149
150 #endif
151