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 - 2009, Intel Corporation.<BR>
11 All rights reserved. This program and the accompanying materials
12 are licensed and made available under the terms and conditions of the BSD License
13 which accompanies this distribution. The full text of the license may be found at<BR>
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 is introduced in UEFI Specification 2.0
24 #ifndef __EFI_ARP_PROTOCOL_H__
25 #define __EFI_ARP_PROTOCOL_H__
27 #define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \
29 0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3 } \
32 #define EFI_ARP_PROTOCOL_GUID \
34 0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } \
37 typedef struct _EFI_ARP_PROTOCOL EFI_ARP_PROTOCOL
;
41 /// Length in bytes of this entry.
46 /// Set to TRUE if this entry is a "deny" entry.
47 /// Set to FALSE if this entry is a "normal" entry.
52 /// Set to TRUE if this entry will not time out.
53 /// Set to FALSE if this entry will time out.
58 /// 16-bit ARP hardware identifier number.
63 /// 16-bit protocol type number.
68 /// Length of the hardware address.
70 UINT8 HwAddressLength
;
73 /// Length of the protocol address.
75 UINT8 SwAddressLength
;
80 /// 16-bit protocol type number in host byte order.
85 /// Length in bytes of the station's protocol address to register.
87 UINT8 SwAddressLength
;
90 /// Pointer to the first byte of the protocol address to register. For
91 /// example, if SwAddressType is 0x0800 (IP), then
92 /// StationAddress points to the first byte of this station's IP
93 /// address stored in network byte order.
98 /// The timeout value in 100-ns units that is associated with each
99 /// new dynamic ARP cache entry. If it is set to zero, the value is
100 /// implementation-specific.
105 /// The number of retries before a MAC address is resolved. If it is
106 /// set to zero, the value is implementation-specific.
111 /// The timeout value in 100-ns units that is used to wait for the ARP
112 /// reply packet or the timeout value between two retries. Set to zero
113 /// to use implementation-specific value.
116 } EFI_ARP_CONFIG_DATA
;
120 This function is used to assign a station address to the ARP cache for this instance
123 Each ARP instance has one station address. The EFI_ARP_PROTOCOL driver will
124 respond to ARP requests that match this registered station address. A call to
125 this function with the ConfigData field set to NULL will reset this ARP instance.
127 Once a protocol type and station address have been assigned to this ARP instance,
128 all the following ARP functions will use this information. Attempting to change
129 the protocol type or station address to a configured ARP instance will result in errors.
131 @param This Pointer to the EFI_ARP_PROTOCOL instance.
132 @param ConfigData Pointer to the EFI_ARP_CONFIG_DATA structure.
134 @retval EFI_SUCCESS The new station address was successfully
136 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
138 * SwAddressLength is zero when ConfigData is not NULL.
139 * StationAddress is NULL when ConfigData is not NULL.
140 @retval EFI_ACCESS_DENIED The SwAddressType, SwAddressLength, or
141 StationAddress is different from the one that is
143 @retval EFI_OUT_OF_RESOURCES Storage for the new StationAddress could not be
149 (EFIAPI
*EFI_ARP_CONFIGURE
)(
150 IN EFI_ARP_PROTOCOL
*This
,
151 IN EFI_ARP_CONFIG_DATA
*ConfigData OPTIONAL
155 This function is used to insert entries into the ARP cache.
157 ARP cache entries are typically inserted and updated by network protocol drivers
158 as network traffic is processed. Most ARP cache entries will time out and be
159 deleted if the network traffic stops. ARP cache entries that were inserted
160 by the Add() function may be static (will not time out) or dynamic (will time out).
161 Default ARP cache timeout values are not covered in most network protocol
162 specifications (although RFC 1122 comes pretty close) and will only be
163 discussed in general in this specification. The timeout values that are
164 used in the EFI Sample Implementation should be used only as a guideline.
165 Final product implementations of the EFI network stack should be tuned for
166 their expected network environments.
168 @param This Pointer to the EFI_ARP_PROTOCOL instance.
169 @param DenyFlag Set to TRUE if this entry is a deny entry. Set to
170 FALSE if this entry is a normal entry.
171 @param TargetSwAddress Pointer to a protocol address to add (or deny).
172 May be set to NULL if DenyFlag is TRUE.
173 @param TargetHwAddress Pointer to a hardware address to add (or deny).
174 May be set to NULL if DenyFlag is TRUE.
175 @param TimeoutValue Time in 100-ns units that this entry will remain
176 in the ARP cache. A value of zero means that the
177 entry is permanent. A nonzero value will override
178 the one given by Configure() if the entry to be
179 added is a dynamic entry.
180 @param Overwrite If TRUE, the matching cache entry will be
181 overwritten with the supplied parameters. If
182 FALSE, EFI_ACCESS_DENIED is returned if the
183 corresponding cache entry already exists.
185 @retval EFI_SUCCESS The entry has been added or updated.
186 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
188 * DenyFlag is FALSE and TargetHwAddress is NULL.
189 * DenyFlag is FALSE and TargetSwAddress is NULL.
190 * TargetHwAddress is NULL and TargetSwAddress is NULL.
191 * Neither TargetSwAddress nor TargetHwAddress are NULL when DenyFlag is
193 @retval EFI_OUT_OF_RESOURCES The new ARP cache entry could not be allocated.
194 @retval EFI_ACCESS_DENIED The ARP cache entry already exists and Overwrite
196 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
201 (EFIAPI
*EFI_ARP_ADD
)(
202 IN EFI_ARP_PROTOCOL
*This
,
204 IN VOID
*TargetSwAddress OPTIONAL
,
205 IN VOID
*TargetHwAddress OPTIONAL
,
206 IN UINT32 TimeoutValue
,
211 This function searches the ARP cache for matching entries and allocates a buffer into
212 which those entries are copied.
214 The first part of the allocated buffer is EFI_ARP_FIND_DATA, following which
215 are protocol address pairs and hardware address pairs.
216 When finding a specific protocol address (BySwAddress is TRUE and AddressBuffer
217 is not NULL), the ARP cache timeout for the found entry is reset if Refresh is
218 set to TRUE. If the found ARP cache entry is a permanent entry, it is not
221 @param This Pointer to the EFI_ARP_PROTOCOL instance.
222 @param BySwAddress Set to TRUE to look for matching software protocol
223 addresses. Set to FALSE to look for matching
224 hardware protocol addresses.
225 @param AddressBuffer Pointer to address buffer. Set to NULL to match
227 @param EntryLength The size of an entry in the entries buffer.
228 @param EntryCount The number of ARP cache entries that are found by
229 the specified criteria.
230 @param Entries Pointer to the buffer that will receive the ARP
232 @param Refresh Set to TRUE to refresh the timeout value of the
233 matching ARP cache entry.
235 @retval EFI_SUCCESS The requested ARP cache entries were copied into
237 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
238 This is NULL. Both EntryCount and EntryLength are
239 NULL, when Refresh is FALSE.
240 @retval EFI_NOT_FOUND No matching entries were found.
241 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
246 (EFIAPI
*EFI_ARP_FIND
)(
247 IN EFI_ARP_PROTOCOL
*This
,
248 IN BOOLEAN BySwAddress
,
249 IN VOID
*AddressBuffer OPTIONAL
,
250 OUT UINT32
*EntryLength OPTIONAL
,
251 OUT UINT32
*EntryCount OPTIONAL
,
252 OUT EFI_ARP_FIND_DATA
**Entries OPTIONAL
,
258 This function removes specified ARP cache entries.
260 @param This Pointer to the EFI_ARP_PROTOCOL instance.
261 @param BySwAddress Set to TRUE to delete matching protocol addresses.
262 Set to FALSE to delete matching hardware
264 @param AddressBuffer Pointer to the address buffer that is used as a
265 key to look for the cache entry. Set to NULL to
268 @retval EFI_SUCCESS The entry was removed from the ARP cache.
269 @retval EFI_INVALID_PARAMETER This is NULL.
270 @retval EFI_NOT_FOUND The specified deletion key was not found.
271 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
276 (EFIAPI
*EFI_ARP_DELETE
)(
277 IN EFI_ARP_PROTOCOL
*This
,
278 IN BOOLEAN BySwAddress
,
279 IN VOID
*AddressBuffer OPTIONAL
283 This function delete all dynamic entries from the ARP cache that match the specified
284 software protocol type.
286 @param This Pointer to the EFI_ARP_PROTOCOL instance.
288 @retval EFI_SUCCESS The cache has been flushed.
289 @retval EFI_INVALID_PARAMETER This is NULL.
290 @retval EFI_NOT_FOUND There are no matching dynamic cache entries.
291 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
296 (EFIAPI
*EFI_ARP_FLUSH
)(
297 IN EFI_ARP_PROTOCOL
*This
301 This function tries to resolve the TargetSwAddress and optionally returns a
302 TargetHwAddress if it already exists in the ARP cache.
304 @param This Pointer to the EFI_ARP_PROTOCOL instance.
305 @param TargetSwAddress Pointer to the protocol address to resolve.
306 @param ResolvedEvent Pointer to the event that will be signaled when
307 the address is resolved or some error occurs.
308 @param TargetHwAddress Pointer to the buffer for the resolved hardware
309 address in network byte order.
311 @retval EFI_SUCCESS The data is copied from the ARP cache into the
312 TargetHwAddress buffer.
313 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
314 This is NULL. TargetHwAddress is NULL.
315 @retval EFI_ACCESS_DENIED The requested address is not present in the normal
316 ARP cache but is present in the deny address list.
317 Outgoing traffic to that address is forbidden.
318 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
319 @retval EFI_NOT_READY The request has been started and is not finished.
324 (EFIAPI
*EFI_ARP_REQUEST
)(
325 IN EFI_ARP_PROTOCOL
*This
,
326 IN VOID
*TargetSwAddress OPTIONAL
,
327 IN EFI_EVENT ResolvedEvent OPTIONAL
,
328 OUT VOID
*TargetHwAddress
332 This function aborts the previous ARP request (identified by This, TargetSwAddress
333 and ResolvedEvent) that is issued by EFI_ARP_PROTOCOL.Request().
335 If the request is in the internal ARP request queue, the request is aborted
336 immediately and its ResolvedEvent is signaled. Only an asynchronous address
337 request needs to be canceled. If TargeSwAddress and ResolveEvent are both
338 NULL, all the pending asynchronous requests that have been issued by This
339 instance will be cancelled and their corresponding events will be signaled.
341 @param This Pointer to the EFI_ARP_PROTOCOL instance.
342 @param TargetSwAddress Pointer to the protocol address in previous
344 @param ResolvedEvent Pointer to the event that is used as the
345 notification event in previous request session.
347 @retval EFI_SUCCESS The pending request session(s) is/are aborted and
348 corresponding event(s) is/are signaled.
349 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
350 This is NULL. TargetSwAddress is not NULL and
351 ResolvedEvent is NULL. TargetSwAddress is NULL and
352 ResolvedEvent is not NULL.
353 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
354 @retval EFI_NOT_FOUND The request is not issued by
355 EFI_ARP_PROTOCOL.Request().
361 (EFIAPI
*EFI_ARP_CANCEL
)(
362 IN EFI_ARP_PROTOCOL
*This
,
363 IN VOID
*TargetSwAddress OPTIONAL
,
364 IN EFI_EVENT ResolvedEvent OPTIONAL
368 /// ARP is used to resolve local network protocol addresses into
369 /// network hardware addresses.
371 struct _EFI_ARP_PROTOCOL
{
372 EFI_ARP_CONFIGURE Configure
;
375 EFI_ARP_DELETE Delete
;
377 EFI_ARP_REQUEST Request
;
378 EFI_ARP_CANCEL Cancel
;
382 extern EFI_GUID gEfiArpServiceBindingProtocolGuid
;
383 extern EFI_GUID gEfiArpProtocolGuid
;