]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
c311f86b | 2 | \r |
3 | EFI ARP Protocol Definition\r | |
4 | \r | |
5 | The EFI ARP Service Binding Protocol is used to locate EFI\r | |
6 | ARP Protocol drivers to create and destroy child of the\r | |
7 | driver to communicate with other host using ARP protocol.\r | |
8 | \r | |
9 | The EFI ARP Protocol provides services to map IP network\r | |
10 | address to hardware address used by a data link protocol.\r | |
11 | \r | |
4ca9b6c4 | 12 | Copyright (c) 2006 - 2008, Intel Corporation \r |
d1f95000 | 13 | All rights reserved. This program and the accompanying materials \r |
14 | are licensed and made available under the terms and conditions of the BSD License \r | |
15 | which accompanies this distribution. The full text of the license may be found at \r | |
16 | http://opensource.org/licenses/bsd-license.php \r | |
17 | \r | |
18 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
19 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
20 | \r | |
d1f95000 | 21 | **/\r |
22 | \r | |
23 | #ifndef __EFI_ARP_PROTOCOL_H__\r | |
24 | #define __EFI_ARP_PROTOCOL_H__\r | |
25 | \r | |
26 | #define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \\r | |
27 | { \\r | |
28 | 0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3 } \\r | |
29 | }\r | |
30 | \r | |
31 | #define EFI_ARP_PROTOCOL_GUID \\r | |
32 | { \\r | |
33 | 0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } \\r | |
34 | }\r | |
35 | \r | |
36 | typedef struct _EFI_ARP_PROTOCOL EFI_ARP_PROTOCOL;\r | |
37 | \r | |
38 | typedef struct {\r | |
107ffdc9 | 39 | UINT32 Size;\r |
40 | BOOLEAN DenyFlag;\r | |
41 | BOOLEAN StaticFlag;\r | |
42 | UINT16 HwAddressType;\r | |
43 | UINT16 SwAddressType;\r | |
44 | UINT8 HwAddressLength;\r | |
45 | UINT8 SwAddressLength;\r | |
d1f95000 | 46 | } EFI_ARP_FIND_DATA;\r |
47 | \r | |
48 | typedef struct {\r | |
107ffdc9 | 49 | UINT16 SwAddressType; ///< Host byte order\r |
d1f95000 | 50 | UINT8 SwAddressLength;\r |
107ffdc9 | 51 | VOID *StationAddress; ///< Network byte order\r |
d1f95000 | 52 | UINT32 EntryTimeOut;\r |
53 | UINT32 RetryCount;\r | |
54 | UINT32 RetryTimeOut;\r | |
55 | } EFI_ARP_CONFIG_DATA;\r | |
56 | \r | |
57 | \r | |
58 | /**\r | |
59 | Assigns a station address (protocol type and network address) to this instance of the ARP cache.\r | |
60 | \r | |
4ca9b6c4 LG |
61 | @param This A pointer to the EFI_ARP_PROTOCOL instance.\r |
62 | @param ConfigData A pointer to the EFI_ARP_CONFIG_DATA structure.Buffer\r | |
d1f95000 | 63 | \r |
64 | @retval EFI_SUCCESS The new station address was successfully registered.\r | |
65 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
66 | @retval EFI_ACCESS_DENIED The SwAddressType, SwAddressLength, or\r | |
67 | StationAddress is different from the one that is already\r | |
68 | registered.\r | |
69 | @retval EFI_OUT_OF_RESOURCES Storage for the new StationAddress could not be allocated.\r | |
70 | \r | |
71 | **/\r | |
72 | typedef \r | |
73 | EFI_STATUS\r | |
8b13229b | 74 | (EFIAPI *EFI_ARP_CONFIGURE)(\r |
d1f95000 | 75 | IN EFI_ARP_PROTOCOL *This,\r |
76 | IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL\r | |
ed66e1bc | 77 | ); \r |
d1f95000 | 78 | \r |
79 | /**\r | |
80 | Inserts an entry to the ARP cache.\r | |
81 | \r | |
82 | @param This A pointer to the EFI_ARP_PROTOCOL instance. \r | |
83 | @param DenyFlag Set to TRUE if this entry is a "deny" entry. Set to FALSE if this\r | |
84 | entry is a "normal" entry.\r | |
85 | @param TargetSwAddress Pointer to a protocol address to add (or deny). May be set to\r | |
86 | NULL if DenyFlag is TRUE.\r | |
87 | @param TargetHwAddress Pointer to a hardware address to add (or deny). May be set to\r | |
88 | NULL if DenyFlag is TRUE.\r | |
89 | @param TimeoutValue Time in 100-ns units that this entry will remain in the ARP\r | |
90 | cache. A value of zero means that the entry is permanent. A\r | |
91 | nonzero value will override the one given by Configure() if\r | |
92 | the entry to be added is dynamic entry.\r | |
93 | @param Overwrite If TRUE, the matching cache entry will be overwritten with the\r | |
4ca9b6c4 LG |
94 | supplied parameters. If FALSE, EFI_ACCESS_DENIED is returned \r |
95 | if the corresponding cache entry already exists.\r | |
d1f95000 | 96 | \r |
97 | @retval EFI_SUCCESS The entry has been added or updated.\r | |
98 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
4ca9b6c4 LG |
99 | This is NULL. DenyFlag is FALSE and TargetHwAddress is NULL.\r |
100 | DenyFlag is FALSE and TargetSwAddress is NULL. TargetHwAddress is NULL and TargetSwAddress is NULL. \r | |
101 | Both TargetSwAddress and TargetHwAddress are not NULL when DenyFlag is TRUE.\r | |
d1f95000 | 102 | @retval EFI_OUT_OF_RESOURCES The new ARP cache entry could not be allocated.\r |
103 | @retval EFI_ACCESS_DENIED The ARP cache entry already exists and Overwrite is not true.\r | |
104 | @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r | |
105 | \r | |
106 | **/\r | |
107 | typedef\r | |
108 | EFI_STATUS\r | |
8b13229b | 109 | (EFIAPI *EFI_ARP_ADD)(\r |
d1f95000 | 110 | IN EFI_ARP_PROTOCOL *This,\r |
111 | IN BOOLEAN DenyFlag,\r | |
112 | IN VOID *TargetSwAddress OPTIONAL,\r | |
113 | IN VOID *TargetHwAddress OPTIONAL,\r | |
114 | IN UINT32 TimeoutValue,\r | |
115 | IN BOOLEAN Overwrite\r | |
ed66e1bc | 116 | ); \r |
d1f95000 | 117 | \r |
118 | /**\r | |
119 | Locates one or more entries in the ARP cache.\r | |
120 | \r | |
121 | @param This A pointer to the EFI_ARP_PROTOCOL instance.\r | |
122 | @param BySwAddress Set to TRUE to look for matching software protocol addresses.\r | |
123 | Set to FALSE to look for matching hardware protocol addresses.\r | |
124 | @param AddressBuffer Pointer to address buffer. Set to NULL to match all addresses.\r | |
125 | @param EntryLength The size of an entry in the entries buffer. To keep the\r | |
126 | EFI_ARP_FIND_DATA structure properly aligned, this field\r | |
127 | may be longer than sizeof(EFI_ARP_FIND_DATA) plus\r | |
128 | the length of the software and hardware addresses.\r | |
129 | @param EntryCount The number of ARP cache entries that are found by the specified criteria.\r | |
130 | @param Entries Pointer to the buffer that will receive the ARP cache entries.\r | |
131 | @param Refresh Set to TRUE to refresh the timeout value of the matching ARP\r | |
132 | cache entry.\r | |
133 | \r | |
134 | @retval EFI_SUCCESS The requested ARP cache entries were copied into the buffer.\r | |
135 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
4ca9b6c4 LG |
136 | This is NULL. Both EntryCount and EntryLength are NULL, \r |
137 | when Refresh is FALSE.\r | |
d1f95000 | 138 | @retval EFI_NOT_FOUND No matching entries were found.\r |
139 | @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r | |
140 | \r | |
141 | **/\r | |
142 | typedef \r | |
143 | EFI_STATUS\r | |
8b13229b | 144 | (EFIAPI *EFI_ARP_FIND)(\r |
d1f95000 | 145 | IN EFI_ARP_PROTOCOL *This,\r |
146 | IN BOOLEAN BySwAddress,\r | |
147 | IN VOID *AddressBuffer OPTIONAL,\r | |
148 | OUT UINT32 *EntryLength OPTIONAL,\r | |
149 | OUT UINT32 *EntryCount OPTIONAL,\r | |
150 | OUT EFI_ARP_FIND_DATA **Entries OPTIONAL,\r | |
151 | IN BOOLEAN Refresh\r | |
ed66e1bc | 152 | ); \r |
d1f95000 | 153 | \r |
154 | \r | |
155 | /**\r | |
156 | Removes entries from the ARP cache.\r | |
157 | \r | |
158 | @param This A pointer to the EFI_ARP_PROTOCOL instance.\r | |
159 | @param BySwAddress Set to TRUE to delete matching protocol addresses.\r | |
160 | Set to FALSE to delete matching hardware addresses.\r | |
161 | @param AddressBuffer Pointer to the address buffer that is used as a key to look for the\r | |
162 | cache entry. Set to NULL to delete all entries.\r | |
163 | \r | |
164 | @retval EFI_SUCCESS The entry was removed from the ARP cache.\r | |
165 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
166 | @retval EFI_NOT_FOUND The specified deletion key was not found.\r | |
167 | @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r | |
168 | \r | |
169 | **/\r | |
170 | typedef\r | |
171 | EFI_STATUS\r | |
8b13229b | 172 | (EFIAPI *EFI_ARP_DELETE)(\r |
d1f95000 | 173 | IN EFI_ARP_PROTOCOL *This,\r |
174 | IN BOOLEAN BySwAddress,\r | |
175 | IN VOID *AddressBuffer OPTIONAL\r | |
ed66e1bc | 176 | ); \r |
d1f95000 | 177 | \r |
178 | /**\r | |
179 | Removes all dynamic ARP cache entries that were added by this interface.\r | |
180 | \r | |
4ca9b6c4 | 181 | @param This A pointer to the EFI_ARP_PROTOCOL instance.\r |
d1f95000 | 182 | \r |
183 | @retval EFI_SUCCESS The cache has been flushed.\r | |
184 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
185 | @retval EFI_NOT_FOUND There are no matching dynamic cache entries.\r | |
186 | @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r | |
187 | \r | |
188 | **/\r | |
189 | typedef\r | |
190 | EFI_STATUS\r | |
8b13229b | 191 | (EFIAPI *EFI_ARP_FLUSH)(\r |
d1f95000 | 192 | IN EFI_ARP_PROTOCOL *This\r |
ed66e1bc | 193 | ); \r |
d1f95000 | 194 | \r |
195 | /**\r | |
196 | Starts an ARP request session.\r | |
197 | \r | |
198 | @param This A pointer to the EFI_ARP_PROTOCOL instance.\r | |
199 | @param TargetSwAddress Pointer to the protocol address to resolve.\r | |
200 | @param ResolvedEvent Pointer to the event that will be signaled when the address is\r | |
201 | resolved or some error occurs.\r | |
202 | @param TargetHwAddress Pointer to the buffer for the resolved hardware address in\r | |
203 | network byte order. The buffer must be large enough to hold the\r | |
204 | resulting hardware address. TargetHwAddress must not be\r | |
205 | NULL.\r | |
206 | \r | |
207 | @retval EFI_SUCCESS The data was copied from the ARP cache into the\r | |
208 | TargetHwAddress buffer.\r | |
209 | @retval EFI_INVALID_PARAMETER This or TargetHwAddress is NULL.\r | |
210 | @retval EFI_ACCESS_DENIED The requested address is not present in the normal ARP cache but\r | |
211 | is present in the deny address list. Outgoing traffic to that address is\r | |
212 | forbidden.\r | |
213 | @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r | |
214 | @retval EFI_NOT_READY The request has been started and is not finished.\r | |
215 | @retval EFI_UNSUPPORTED The requested conversion is not supported in this implementation or\r | |
216 | configuration.\r | |
217 | \r | |
218 | **/\r | |
219 | typedef\r | |
220 | EFI_STATUS\r | |
8b13229b | 221 | (EFIAPI *EFI_ARP_REQUEST)(\r |
d1f95000 | 222 | IN EFI_ARP_PROTOCOL *This, \r |
223 | IN VOID *TargetSwAddress OPTIONAL,\r | |
224 | IN EFI_EVENT ResolvedEvent OPTIONAL,\r | |
225 | OUT VOID *TargetHwAddress \r | |
ed66e1bc | 226 | ); \r |
d1f95000 | 227 | \r |
228 | /**\r | |
229 | Cancels an ARP request session.\r | |
230 | \r | |
231 | @param This A pointer to the EFI_ARP_PROTOCOL instance.\r | |
232 | @param TargetSwAddress Pointer to the protocol address in previous request session.\r | |
233 | @param ResolvedEvent Pointer to the event that is used as the notification event in\r | |
234 | previous request session.\r | |
235 | \r | |
236 | @retval EFI_SUCCESS The pending request session(s) is/are aborted and corresponding\r | |
237 | event(s) is/are signaled.\r | |
238 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
239 | @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r | |
240 | @retval EFI_NOT_FOUND The request is not issued by\r | |
241 | EFI_ARP_PROTOCOL.Request().\r | |
242 | \r | |
243 | **/\r | |
244 | typedef\r | |
245 | EFI_STATUS\r | |
8b13229b | 246 | (EFIAPI *EFI_ARP_CANCEL)(\r |
d1f95000 | 247 | IN EFI_ARP_PROTOCOL *This, \r |
248 | IN VOID *TargetSwAddress OPTIONAL,\r | |
249 | IN EFI_EVENT ResolvedEvent OPTIONAL\r | |
ed66e1bc | 250 | ); \r |
d1f95000 | 251 | \r |
44717a39 | 252 | ///\r |
253 | /// ARP is used to resolve local network protocol addresses into \r | |
254 | /// network hardware addresses.\r | |
255 | ///\r | |
d1f95000 | 256 | struct _EFI_ARP_PROTOCOL {\r |
257 | EFI_ARP_CONFIGURE Configure;\r | |
258 | EFI_ARP_ADD Add;\r | |
259 | EFI_ARP_FIND Find;\r | |
260 | EFI_ARP_DELETE Delete;\r | |
261 | EFI_ARP_FLUSH Flush;\r | |
262 | EFI_ARP_REQUEST Request;\r | |
263 | EFI_ARP_CANCEL Cancel;\r | |
264 | };\r | |
265 | \r | |
266 | \r | |
267 | extern EFI_GUID gEfiArpServiceBindingProtocolGuid;\r | |
268 | extern EFI_GUID gEfiArpProtocolGuid;\r | |
269 | \r | |
270 | #endif\r |