2 EFI ARP Protocol Definition
4 The EFI ARP Service Binding Protocol is used to locate EFI
5 ARP Protocol drivers to create and destroy child of the
6 driver to communicate with other host using ARP protocol.
7 The EFI ARP Protocol provides services to map IP network
8 address to hardware address used by a data link protocol.
10 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
11 This program and the accompanying materials are licensed and made available under
12 the terms and conditions of the BSD License that accompanies this distribution.
13 The full text of the license may be found at
14 http://opensource.org/licenses/bsd-license.php.
16 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
17 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 @par Revision Reference:
20 This Protocol was introduced in UEFI Specification 2.0.
24 #ifndef __EFI_ARP_PROTOCOL_H__
25 #define __EFI_ARP_PROTOCOL_H__
27 FILE_LICENCE ( BSD3 );
29 #define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \
31 0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3 } \
34 #define EFI_ARP_PROTOCOL_GUID \
36 0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } \
39 typedef struct _EFI_ARP_PROTOCOL EFI_ARP_PROTOCOL;
43 /// Length in bytes of this entry.
48 /// Set to TRUE if this entry is a "deny" entry.
49 /// Set to FALSE if this entry is a "normal" entry.
54 /// Set to TRUE if this entry will not time out.
55 /// Set to FALSE if this entry will time out.
60 /// 16-bit ARP hardware identifier number.
65 /// 16-bit protocol type number.
70 /// The length of the hardware address.
72 UINT8 HwAddressLength;
75 /// The length of the protocol address.
77 UINT8 SwAddressLength;
82 /// 16-bit protocol type number in host byte order.
87 /// The length in bytes of the station's protocol address to register.
89 UINT8 SwAddressLength;
92 /// The pointer to the first byte of the protocol address to register. For
93 /// example, if SwAddressType is 0x0800 (IP), then
94 /// StationAddress points to the first byte of this station's IP
95 /// address stored in network byte order.
100 /// The timeout value in 100-ns units that is associated with each
101 /// new dynamic ARP cache entry. If it is set to zero, the value is
102 /// implementation-specific.
107 /// The number of retries before a MAC address is resolved. If it is
108 /// set to zero, the value is implementation-specific.
113 /// The timeout value in 100-ns units that is used to wait for the ARP
114 /// reply packet or the timeout value between two retries. Set to zero
115 /// to use implementation-specific value.
118 } EFI_ARP_CONFIG_DATA;
122 This function is used to assign a station address to the ARP cache for this instance
125 Each ARP instance has one station address. The EFI_ARP_PROTOCOL driver will
126 respond to ARP requests that match this registered station address. A call to
127 this function with the ConfigData field set to NULL will reset this ARP instance.
129 Once a protocol type and station address have been assigned to this ARP instance,
130 all the following ARP functions will use this information. Attempting to change
131 the protocol type or station address to a configured ARP instance will result in errors.
133 @param This The pointer to the EFI_ARP_PROTOCOL instance.
134 @param ConfigData The pointer to the EFI_ARP_CONFIG_DATA structure.
136 @retval EFI_SUCCESS The new station address was successfully
138 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
140 * SwAddressLength is zero when ConfigData is not NULL.
141 * StationAddress is NULL when ConfigData is not NULL.
142 @retval EFI_ACCESS_DENIED The SwAddressType, SwAddressLength, or
143 StationAddress is different from the one that is
145 @retval EFI_OUT_OF_RESOURCES Storage for the new StationAddress could not be
151 (EFIAPI *EFI_ARP_CONFIGURE)(
152 IN EFI_ARP_PROTOCOL *This,
153 IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL
157 This function is used to insert entries into the ARP cache.
159 ARP cache entries are typically inserted and updated by network protocol drivers
160 as network traffic is processed. Most ARP cache entries will time out and be
161 deleted if the network traffic stops. ARP cache entries that were inserted
162 by the Add() function may be static (will not time out) or dynamic (will time out).
163 Default ARP cache timeout values are not covered in most network protocol
164 specifications (although RFC 1122 comes pretty close) and will only be
165 discussed in general terms in this specification. The timeout values that are
166 used in the EFI Sample Implementation should be used only as a guideline.
167 Final product implementations of the EFI network stack should be tuned for
168 their expected network environments.
170 @param This Pointer to the EFI_ARP_PROTOCOL instance.
171 @param DenyFlag Set to TRUE if this entry is a deny entry. Set to
172 FALSE if this entry is a normal entry.
173 @param TargetSwAddress Pointer to a protocol address to add (or deny).
174 May be set to NULL if DenyFlag is TRUE.
175 @param TargetHwAddress Pointer to a hardware address to add (or deny).
176 May be set to NULL if DenyFlag is TRUE.
177 @param TimeoutValue Time in 100-ns units that this entry will remain
178 in the ARP cache. A value of zero means that the
179 entry is permanent. A nonzero value will override
180 the one given by Configure() if the entry to be
181 added is a dynamic entry.
182 @param Overwrite If TRUE, the matching cache entry will be
183 overwritten with the supplied parameters. If
184 FALSE, EFI_ACCESS_DENIED is returned if the
185 corresponding cache entry already exists.
187 @retval EFI_SUCCESS The entry has been added or updated.
188 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
190 * DenyFlag is FALSE and TargetHwAddress is NULL.
191 * DenyFlag is FALSE and TargetSwAddress is NULL.
192 * TargetHwAddress is NULL and TargetSwAddress is NULL.
193 * Neither TargetSwAddress nor TargetHwAddress are NULL when DenyFlag is
195 @retval EFI_OUT_OF_RESOURCES The new ARP cache entry could not be allocated.
196 @retval EFI_ACCESS_DENIED The ARP cache entry already exists and Overwrite
198 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
203 (EFIAPI *EFI_ARP_ADD)(
204 IN EFI_ARP_PROTOCOL *This,
206 IN VOID *TargetSwAddress OPTIONAL,
207 IN VOID *TargetHwAddress OPTIONAL,
208 IN UINT32 TimeoutValue,
213 This function searches the ARP cache for matching entries and allocates a buffer into
214 which those entries are copied.
216 The first part of the allocated buffer is EFI_ARP_FIND_DATA, following which
217 are protocol address pairs and hardware address pairs.
218 When finding a specific protocol address (BySwAddress is TRUE and AddressBuffer
219 is not NULL), the ARP cache timeout for the found entry is reset if Refresh is
220 set to TRUE. If the found ARP cache entry is a permanent entry, it is not
223 @param This The pointer to the EFI_ARP_PROTOCOL instance.
224 @param BySwAddress Set to TRUE to look for matching software protocol
225 addresses. Set to FALSE to look for matching
226 hardware protocol addresses.
227 @param AddressBuffer The pointer to the address buffer. Set to NULL
228 to match all addresses.
229 @param EntryLength The size of an entry in the entries buffer.
230 @param EntryCount The number of ARP cache entries that are found by
231 the specified criteria.
232 @param Entries The pointer to the buffer that will receive the ARP
234 @param Refresh Set to TRUE to refresh the timeout value of the
235 matching ARP cache entry.
237 @retval EFI_SUCCESS The requested ARP cache entries were copied into
239 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
240 This is NULL. Both EntryCount and EntryLength are
241 NULL, when Refresh is FALSE.
242 @retval EFI_NOT_FOUND No matching entries were found.
243 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
248 (EFIAPI *EFI_ARP_FIND)(
249 IN EFI_ARP_PROTOCOL *This,
250 IN BOOLEAN BySwAddress,
251 IN VOID *AddressBuffer OPTIONAL,
252 OUT UINT32 *EntryLength OPTIONAL,
253 OUT UINT32 *EntryCount OPTIONAL,
254 OUT EFI_ARP_FIND_DATA **Entries OPTIONAL,
260 This function removes specified ARP cache entries.
262 @param This The pointer to the EFI_ARP_PROTOCOL instance.
263 @param BySwAddress Set to TRUE to delete matching protocol addresses.
264 Set to FALSE to delete matching hardware
266 @param AddressBuffer The pointer to the address buffer that is used as a
267 key to look for the cache entry. Set to NULL to
270 @retval EFI_SUCCESS The entry was removed from the ARP cache.
271 @retval EFI_INVALID_PARAMETER This is NULL.
272 @retval EFI_NOT_FOUND The specified deletion key was not found.
273 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
278 (EFIAPI *EFI_ARP_DELETE)(
279 IN EFI_ARP_PROTOCOL *This,
280 IN BOOLEAN BySwAddress,
281 IN VOID *AddressBuffer OPTIONAL
285 This function delete all dynamic entries from the ARP cache that match the specified
286 software protocol type.
288 @param This The pointer to the EFI_ARP_PROTOCOL instance.
290 @retval EFI_SUCCESS The cache has been flushed.
291 @retval EFI_INVALID_PARAMETER This is NULL.
292 @retval EFI_NOT_FOUND There are no matching dynamic cache entries.
293 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
298 (EFIAPI *EFI_ARP_FLUSH)(
299 IN EFI_ARP_PROTOCOL *This
303 This function tries to resolve the TargetSwAddress and optionally returns a
304 TargetHwAddress if it already exists in the ARP cache.
306 @param This The pointer to the EFI_ARP_PROTOCOL instance.
307 @param TargetSwAddress The pointer to the protocol address to resolve.
308 @param ResolvedEvent The pointer to the event that will be signaled when
309 the address is resolved or some error occurs.
310 @param TargetHwAddress The pointer to the buffer for the resolved hardware
311 address in network byte order.
313 @retval EFI_SUCCESS The data is copied from the ARP cache into the
314 TargetHwAddress buffer.
315 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
316 This is NULL. TargetHwAddress is NULL.
317 @retval EFI_ACCESS_DENIED The requested address is not present in the normal
318 ARP cache but is present in the deny address list.
319 Outgoing traffic to that address is forbidden.
320 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
321 @retval EFI_NOT_READY The request has been started and is not finished.
326 (EFIAPI *EFI_ARP_REQUEST)(
327 IN EFI_ARP_PROTOCOL *This,
328 IN VOID *TargetSwAddress OPTIONAL,
329 IN EFI_EVENT ResolvedEvent OPTIONAL,
330 OUT VOID *TargetHwAddress
334 This function aborts the previous ARP request (identified by This, TargetSwAddress
335 and ResolvedEvent) that is issued by EFI_ARP_PROTOCOL.Request().
337 If the request is in the internal ARP request queue, the request is aborted
338 immediately and its ResolvedEvent is signaled. Only an asynchronous address
339 request needs to be canceled. If TargeSwAddress and ResolveEvent are both
340 NULL, all the pending asynchronous requests that have been issued by This
341 instance will be cancelled and their corresponding events will be signaled.
343 @param This The pointer to the EFI_ARP_PROTOCOL instance.
344 @param TargetSwAddress The pointer to the protocol address in previous
346 @param ResolvedEvent Pointer to the event that is used as the
347 notification event in previous request session.
349 @retval EFI_SUCCESS The pending request session(s) is/are aborted and
350 corresponding event(s) is/are signaled.
351 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
352 This is NULL. TargetSwAddress is not NULL and
353 ResolvedEvent is NULL. TargetSwAddress is NULL and
354 ResolvedEvent is not NULL.
355 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
356 @retval EFI_NOT_FOUND The request is not issued by
357 EFI_ARP_PROTOCOL.Request().
363 (EFIAPI *EFI_ARP_CANCEL)(
364 IN EFI_ARP_PROTOCOL *This,
365 IN VOID *TargetSwAddress OPTIONAL,
366 IN EFI_EVENT ResolvedEvent OPTIONAL
370 /// ARP is used to resolve local network protocol addresses into
371 /// network hardware addresses.
373 struct _EFI_ARP_PROTOCOL {
374 EFI_ARP_CONFIGURE Configure;
377 EFI_ARP_DELETE Delete;
379 EFI_ARP_REQUEST Request;
380 EFI_ARP_CANCEL Cancel;
384 extern EFI_GUID gEfiArpServiceBindingProtocolGuid;
385 extern EFI_GUID gEfiArpProtocolGuid;