]>
Commit | Line | Data |
---|---|---|
5f597758 LG |
1 | /** @file\r |
2 | This file defines NicIp4Config Protocol.\r | |
c8d8f1e3 | 3 | EFI_NIC_IP4_CONFIG_PROTOCOL is a proprietary protocol, not defined by UEFI2.0.\r |
da89d703 | 4 | \r |
5f597758 | 5 | Copyright (c) 2006 - 2008, Intel Corporation\r |
da89d703 | 6 | All rights reserved. This program and the accompanying materials\r |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
5f597758 | 14 | **/\r |
da89d703 | 15 | \r |
16 | #ifndef __NIC_IP4_CONFIG_H__\r | |
17 | #define __NIC_IP4_CONFIG_H__\r | |
18 | \r | |
19 | #include <Protocol/Ip4Config.h>\r | |
20 | \r | |
21 | \r | |
22 | #define EFI_NIC_IP4_CONFIG_PROTOCOL_GUID \\r | |
23 | { \\r | |
24 | 0xdca3d4d, 0x12da, 0x4728, { 0xbf, 0x7e, 0x86, 0xce, 0xb9, 0x28, 0xd0, 0x67 } \\r | |
25 | }\r | |
26 | \r | |
27 | #define EFI_NIC_IP4_CONFIG_VARIABLE_GUID \\r | |
28 | { \\r | |
29 | 0xd8944553, 0xc4dd, 0x41f4, { 0x9b, 0x30, 0xe1, 0x39, 0x7c, 0xfb, 0x26, 0x7b } \\r | |
30 | }\r | |
31 | \r | |
32 | #define EFI_NIC_IP4_CONFIG_VARIABLE L"EfiNicIp4ConfigVariable"\r | |
33 | \r | |
34 | \r | |
35 | typedef struct _EFI_NIC_IP4_CONFIG_PROTOCOL EFI_NIC_IP4_CONFIG_PROTOCOL;\r | |
36 | \r | |
5f597758 | 37 | typedef enum {\r |
da89d703 | 38 | //\r |
39 | // Config source: dhcp or static\r | |
40 | //\r | |
41 | IP4_CONFIG_SOURCE_DHCP = 0,\r | |
42 | IP4_CONFIG_SOURCE_STATIC,\r | |
43 | IP4_CONFIG_SOURCE_MAX,\r | |
44 | \r | |
45 | IP4_NIC_NAME_LENGTH = 64,\r | |
552b2523 | 46 | MAX_IP4_CONFIG_IN_VARIABLE = 16\r |
5f597758 | 47 | } IP4_CONFIG_TYPE;\r |
da89d703 | 48 | \r |
49 | //\r | |
50 | // The following structures are used by drivers/applications other\r | |
51 | // than EFI_IP4_PROTOCOL, such as ifconfig shell application, to\r | |
52 | // communicate the IP configuration information to EFI_IP4_CONFIG_PROTOCOL.\r | |
53 | // EFI_IP4_CONFIG_PROTOCOL in turn is used by EFI_IP4_PROTOCOL to get\r | |
54 | // the default IP4 configuration. ifconfig can't use the EFI_IP4_PROTOCOL\r | |
55 | // because it don't know how to configure the default IP address even\r | |
56 | // it has got the address.\r | |
57 | //\r | |
c8d8f1e3 | 58 | \r |
59 | ///\r | |
60 | /// NIC_ADDR contains the interface's type and MAC address to identify\r | |
61 | /// a specific NIC.\r | |
62 | ///\r | |
da89d703 | 63 | typedef struct {\r |
c8d8f1e3 | 64 | UINT16 Type; ///< Interface type\r |
65 | UINT8 Len; ///< Length of MAC address\r | |
66 | EFI_MAC_ADDRESS MacAddr; ///< MAC address of interface\r | |
da89d703 | 67 | } NIC_ADDR;\r |
68 | \r | |
c8d8f1e3 | 69 | ///\r |
70 | /// NIC_IP4_CONFIG_INFO contains the IP4 configure\r | |
71 | /// parameters for that NIC. NIC_IP4_CONFIG_INFO is\r | |
72 | /// of variable length.\r | |
73 | ///\r | |
da89d703 | 74 | typedef struct {\r |
c8d8f1e3 | 75 | NIC_ADDR NicAddr; ///< Link layer address to identify the NIC\r |
76 | UINT32 Source; ///< Static or DHCP\r | |
77 | BOOLEAN Perment; ///< Survive the reboot or not\r | |
78 | EFI_IP4_IPCONFIG_DATA Ip4Info; ///< IP addresses\r | |
da89d703 | 79 | } NIC_IP4_CONFIG_INFO;\r |
80 | \r | |
c8d8f1e3 | 81 | ///\r |
82 | /// IP4_CONFIG_VARIABLE is the EFI variable to\r | |
83 | /// save the configuration. IP4_CONFIG_VARIABLE is\r | |
84 | /// of variable length.\r | |
85 | ///\r | |
da89d703 | 86 | typedef struct {\r |
c8d8f1e3 | 87 | UINT32 Len; ///< Total length of the variable\r |
88 | UINT16 CheckSum; ///< CheckSum, the same as IP4 head checksum\r | |
89 | UINT32 Count; ///< Number of NIC_IP4_CONFIG_INFO follows\r | |
da89d703 | 90 | NIC_IP4_CONFIG_INFO ConfigInfo;\r |
91 | } IP4_CONFIG_VARIABLE;\r | |
92 | \r | |
c8d8f1e3 | 93 | /**\r |
94 | Get the configure parameter for this NIC.\r | |
95 | \r | |
96 | @param This The NIC IP4 CONFIG protocol.\r | |
97 | @param Len The length of the NicConfig buffer.\r | |
98 | @param NicConfig The buffer to receive the NIC's configure\r | |
99 | parameter.\r | |
100 | \r | |
101 | @retval EFI_SUCCESS The configure parameter for this NIC was \r | |
102 | obtained successfully .\r | |
103 | @retval EFI_INVALID_PARAMETER This or ConfigLen is NULL.\r | |
104 | @retval EFI_NOT_FOUND There is no configure parameter for the NIC in\r | |
105 | NVRam.\r | |
106 | @retval EFI_BUFFER_TOO_SMALL The ConfigLen is too small or the NicConfig is \r | |
107 | NULL.\r | |
108 | \r | |
109 | **/\r | |
da89d703 | 110 | typedef\r |
111 | EFI_STATUS\r | |
7d839888 | 112 | (EFIAPI *EFI_NIC_IP4_CONFIG_GET_INFO)(\r |
da89d703 | 113 | IN EFI_NIC_IP4_CONFIG_PROTOCOL *This,\r |
114 | IN OUT UINTN *Len,\r | |
115 | OUT NIC_IP4_CONFIG_INFO *NicConfig OPTIONAL\r | |
116 | );\r | |
117 | \r | |
c8d8f1e3 | 118 | /**\r |
119 | Set the IP configure parameters for this NIC. \r | |
120 | \r | |
121 | If Reconfig is TRUE, the IP driver will be informed to discard current \r | |
122 | auto configure parameter and restart the auto configuration process. \r | |
123 | If current there is a pending auto configuration, EFI_ALREADY_STARTED is\r | |
124 | returned. You can only change the configure setting when either\r | |
125 | the configure has finished or not started yet. If NicConfig, the\r | |
126 | NIC's configure parameter is removed from the variable.\r | |
127 | \r | |
128 | @param This The NIC IP4 CONFIG protocol\r | |
129 | @param NicConfig The new NIC IP4 configure parameter\r | |
130 | @param Reconfig Inform the IP4 driver to restart the auto\r | |
131 | configuration\r | |
132 | \r | |
133 | @retval EFI_SUCCESS The configure parameter for this NIC was \r | |
134 | set successfully .\r | |
135 | @retval EFI_INVALID_PARAMETER This is NULL or the configure parameter is\r | |
136 | invalid.\r | |
137 | @retval EFI_ALREADY_STARTED There is a pending auto configuration.\r | |
138 | @retval EFI_NOT_FOUND No auto configure parameter is found\r | |
139 | \r | |
140 | **/\r | |
da89d703 | 141 | typedef\r |
142 | EFI_STATUS\r | |
7d839888 | 143 | (EFIAPI *EFI_NIC_IP4_CONFIG_SET_INFO)(\r |
da89d703 | 144 | IN EFI_NIC_IP4_CONFIG_PROTOCOL *This,\r |
c8d8f1e3 | 145 | IN NIC_IP4_CONFIG_INFO *NicConfig OPTIONAL,\r |
da89d703 | 146 | IN BOOLEAN ReConfig\r |
147 | );\r | |
148 | \r | |
c8d8f1e3 | 149 | /**\r |
150 | Return the name and MAC address for the NIC. The Name, if not NULL,\r | |
151 | has at least IP4_NIC_NAME_LENGTH bytes.\r | |
152 | \r | |
153 | @param This The NIC IP4 CONFIG protocol\r | |
154 | @param Name The buffer to return the name\r | |
155 | @param NicAddr The buffer to return the MAC addr\r | |
156 | \r | |
157 | @retval EFI_INVALID_PARAMETER This is NULL\r | |
158 | @retval EFI_SUCCESS The name or address of the NIC are returned.\r | |
159 | \r | |
160 | **/\r | |
da89d703 | 161 | typedef\r |
162 | EFI_STATUS\r | |
7d839888 | 163 | (EFIAPI *EFI_NIC_IP4_CONFIG_GET_NAME)(\r |
da89d703 | 164 | IN EFI_NIC_IP4_CONFIG_PROTOCOL *This,\r |
c8d8f1e3 | 165 | OUT UINT16 *Name OPTIONAL,\r |
166 | OUT NIC_ADDR *NicAddr OPTIONAL\r | |
da89d703 | 167 | );\r |
168 | \r | |
da89d703 | 169 | struct _EFI_NIC_IP4_CONFIG_PROTOCOL {\r |
170 | EFI_NIC_IP4_CONFIG_GET_NAME GetName;\r | |
171 | EFI_NIC_IP4_CONFIG_GET_INFO GetInfo;\r | |
172 | EFI_NIC_IP4_CONFIG_SET_INFO SetInfo;\r | |
173 | };\r | |
174 | \r | |
175 | extern EFI_GUID gEfiNicIp4ConfigVariableGuid;\r | |
176 | extern EFI_GUID gEfiNicIp4ConfigProtocolGuid;\r | |
177 | #endif\r |