+/** @file\r
+ EFI EAP(Extended Authenticaton Protocol) Protocol Definition\r
+ The EFI EAP Protocol is used to abstract the ability to configure and extend the\r
+ EAP framework. \r
+ The definitions in this file are defined in UEFI Specification 2.3, which have\r
+ not been verified by one implementation yet.\r
+\r
+ Copyright (c) 2009, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __EFI_EAP_PROTOCOL_H__\r
+#define __EFI_EAP_PROTOCOL_H__\r
+\r
+\r
+#define EFI_EAP_PROTOCOL_GUID \\r
+ { \\r
+ 0x5d9f96db, 0xe731, 0x4caa, {0xa0, 0xd, 0x72, 0xe1, 0x87, 0xcd, 0x77, 0x62 } \\r
+ }\r
+\r
+typedef struct _EFI_EAP_PROTOCOL EFI_EAP_PROTOCOL;\r
+\r
+///\r
+/// Type for the identification number assigned to the Port by the \r
+/// System in which the Port resides.\r
+///\r
+typedef VOID * EFI_PORT_HANDLE;\r
+\r
+///\r
+/// EAP Authentication Method Type (RFC 2284 Section 3)\r
+///@{\r
+#define EFI_EAP_TYPE_MD5 0x4 ///< REQUIRED\r
+#define EFI_EAP_TYPE_OTP 0x5 ///< OPTIONAL\r
+#define EFI_EAP_TYPE_TOKEN_CARD 0x6 ///< OPTIONAL\r
+///@}\r
+\r
+\r
+/**\r
+ One user provided EAP authentication method.\r
+\r
+ Build EAP response packet in response to the EAP request packet specified by\r
+ (RequestBuffer, RequestSize).\r
+\r
+ @param[in] PortNumber Specified the Port where the EAP request packet comes.\r
+ @param[in] RequestBuffer Pointer to the most recently received EAP- Request packet.\r
+ @param[in] RequestSize Packet size in bytes for the most recently received\r
+ EAP-Request packet.\r
+ @param[in] Buffer Pointer to the buffer to hold the built packet.\r
+ @param[in, out] BufferSize Pointer to the buffer size in bytes. \r
+ On input, it is the buffer size provided by the caller.\r
+ On output, it is the buffer size in fact needed to contain\r
+ the packet.\r
+\r
+ @retval EFI_SUCCESS The required EAP response packet is built successfully.\r
+ @retval others Failures are encountered during the packet building process.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EAP_BUILD_RESPONSE_PACKET)(\r
+ IN EFI_PORT_HANDLE PortNumber,\r
+ IN UINT8 *RequestBuffer, \r
+ IN UINTN RequestSize, \r
+ IN UINT8 *Buffer, \r
+ IN OUT UINTN *BufferSize\r
+ );\r
+\r
+/**\r
+ Set the desired EAP authentication method for the Port.\r
+\r
+ The SetDesiredAuthMethod() function sets the desired EAP authentication method indicated \r
+ by EapAuthType for the Port.\r
+ \r
+ If EapAuthType is an invalid EAP authentication type, then EFI_INVALID_PARAMETER is \r
+ returned.\r
+ If the EAP authentication method of EapAuthType is unsupported by the Ports, then this\r
+ function will return EFI_UNSUPPORTED.\r
+\r
+ @param[in] This A pointer to the EFI_EAP_PROTOCOL instance that indicates \r
+ the calling context.\r
+ @param[in] EapAuthType The type of the EAP authentication method to register. It should \r
+ be the type value defined by RFC. See RFC 2284 for details.\r
+ @param[in] Handler The handler of the EAP authentication method to register.\r
+\r
+ @retval EFI_SUCCESS The EAP authentication method of EapAuthType is \r
+ registered successfully.\r
+ @retval EFI_INVALID_PARAMETER EapAuthType is an invalid EAP authentication type.\r
+ @retval EFI_OUT_OF_RESOURCES There is not enough system memory to perform the registration.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EAP_SET_DESIRED_AUTHENTICATION_METHOD)(\r
+ IN struct _EFI_EAP_PROTOCOL *This, \r
+ IN UINT8 EapAuthType\r
+ );\r
+\r
+/**\r
+ Register an EAP authentication method. \r
+\r
+ The RegisterAuthMethod() function registers the user provided EAP authentication method, \r
+ the type of which is EapAuthType and the handler of which is Handler. \r
+ \r
+ If EapAuthType is an invalid EAP authentication type, then EFI_INVALID_PARAMETER is \r
+ returned.\r
+ If there is not enough system memory to perform the registration, then \r
+ EFI_OUT_OF_RESOURCES is returned.\r
+\r
+ @param[in] This A pointer to the EFI_EAP_PROTOCOL instance that indicates \r
+ the calling context.\r
+ @param[in] EapAuthType The type of the EAP authentication method to register. It should \r
+ be the type value defined by RFC. See RFC 2284 for details.\r
+ @param[in] Handler The handler of the EAP authentication method to register.\r
+\r
+ @retval EFI_SUCCESS The EAP authentication method of EapAuthType is \r
+ registered successfully.\r
+ @retval EFI_INVALID_PARAMETER EapAuthType is an invalid EAP authentication type.\r
+ @retval EFI_OUT_OF_RESOURCES There is not enough system memory to perform the registration.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EAP_REGISTER_AUTHENTICATION_METHOD)(\r
+ IN struct _EFI_EAP_PROTOCOL *This, \r
+ IN UINT8 EapAuthType, \r
+ IN EFI_EAP_BUILD_RESPONSE_PACKET Handler\r
+ );\r
+\r
+///\r
+/// EFI_EAP_PROTOCOL \r
+/// is used to configure the desired EAP authentication method for the EAP \r
+/// framework and extend the EAP framework by registering new EAP authentication\r
+/// method on a Port. The EAP framework is built on a per-Port basis. Herein, a\r
+/// Port means a NIC. For the details of EAP protocol, please refer to RFC 2284. \r
+///\r
+struct _EFI_EAP_PROTOCOL {\r
+ EFI_EAP_SET_DESIRED_AUTHENTICATION_METHOD SetDesiredAuthMethod;\r
+ EFI_EAP_REGISTER_AUTHENTICATION_METHOD RegisterAuthMethod;\r
+};\r
+\r
+extern EFI_GUID gEfiEapProtocolGuid;\r
+\r
+#endif\r
+\r