iPXE
Arp.h
Go to the documentation of this file.
1/** @file
2 EFI ARP Protocol Definition
3
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.
9
10Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
11SPDX-License-Identifier: BSD-2-Clause-Patent
12
13 @par Revision Reference:
14 This Protocol was introduced in UEFI Specification 2.0.
15
16**/
17
18#ifndef __EFI_ARP_PROTOCOL_H__
19#define __EFI_ARP_PROTOCOL_H__
20
21FILE_LICENCE ( BSD2_PATENT );
22FILE_SECBOOT ( PERMITTED );
23
24#define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \
25 { \
26 0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3 } \
27 }
28
29#define EFI_ARP_PROTOCOL_GUID \
30 { \
31 0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } \
32 }
33
35
36typedef struct {
37 ///
38 /// Length in bytes of this entry.
39 ///
41
42 ///
43 /// Set to TRUE if this entry is a "deny" entry.
44 /// Set to FALSE if this entry is a "normal" entry.
45 ///
47
48 ///
49 /// Set to TRUE if this entry will not time out.
50 /// Set to FALSE if this entry will time out.
51 ///
53
54 ///
55 /// 16-bit ARP hardware identifier number.
56 ///
58
59 ///
60 /// 16-bit protocol type number.
61 ///
63
64 ///
65 /// The length of the hardware address.
66 ///
68
69 ///
70 /// The length of the protocol address.
71 ///
74
75typedef struct {
76 ///
77 /// 16-bit protocol type number in host byte order.
78 ///
80
81 ///
82 /// The length in bytes of the station's protocol address to register.
83 ///
85
86 ///
87 /// The pointer to the first byte of the protocol address to register. For
88 /// example, if SwAddressType is 0x0800 (IP), then
89 /// StationAddress points to the first byte of this station's IP
90 /// address stored in network byte order.
91 ///
93
94 ///
95 /// The timeout value in 100-ns units that is associated with each
96 /// new dynamic ARP cache entry. If it is set to zero, the value is
97 /// implementation-specific.
98 ///
100
101 ///
102 /// The number of retries before a MAC address is resolved. If it is
103 /// set to zero, the value is implementation-specific.
104 ///
106
107 ///
108 /// The timeout value in 100-ns units that is used to wait for the ARP
109 /// reply packet or the timeout value between two retries. Set to zero
110 /// to use implementation-specific value.
111 ///
114
115/**
116 This function is used to assign a station address to the ARP cache for this instance
117 of the ARP driver.
118
119 Each ARP instance has one station address. The EFI_ARP_PROTOCOL driver will
120 respond to ARP requests that match this registered station address. A call to
121 this function with the ConfigData field set to NULL will reset this ARP instance.
122
123 Once a protocol type and station address have been assigned to this ARP instance,
124 all the following ARP functions will use this information. Attempting to change
125 the protocol type or station address to a configured ARP instance will result in errors.
126
127 @param This The pointer to the EFI_ARP_PROTOCOL instance.
128 @param ConfigData The pointer to the EFI_ARP_CONFIG_DATA structure.
129
130 @retval EFI_SUCCESS The new station address was successfully
131 registered.
132 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
133 * This is NULL.
134 * SwAddressLength is zero when ConfigData is not NULL.
135 * StationAddress is NULL when ConfigData is not NULL.
136 @retval EFI_ACCESS_DENIED The SwAddressType, SwAddressLength, or
137 StationAddress is different from the one that is
138 already registered.
139 @retval EFI_OUT_OF_RESOURCES Storage for the new StationAddress could not be
140 allocated.
141
142**/
143typedef
146 IN EFI_ARP_PROTOCOL *This,
148 );
149
150/**
151 This function is used to insert entries into the ARP cache.
152
153 ARP cache entries are typically inserted and updated by network protocol drivers
154 as network traffic is processed. Most ARP cache entries will time out and be
155 deleted if the network traffic stops. ARP cache entries that were inserted
156 by the Add() function may be static (will not time out) or dynamic (will time out).
157 Default ARP cache timeout values are not covered in most network protocol
158 specifications (although RFC 1122 comes pretty close) and will only be
159 discussed in general terms in this specification. The timeout values that are
160 used in the EFI Sample Implementation should be used only as a guideline.
161 Final product implementations of the EFI network stack should be tuned for
162 their expected network environments.
163
164 @param This Pointer to the EFI_ARP_PROTOCOL instance.
165 @param DenyFlag Set to TRUE if this entry is a deny entry. Set to
166 FALSE if this entry is a normal entry.
167 @param TargetSwAddress Pointer to a protocol address to add (or deny).
168 May be set to NULL if DenyFlag is TRUE.
169 @param TargetHwAddress Pointer to a hardware address to add (or deny).
170 May be set to NULL if DenyFlag is TRUE.
171 @param TimeoutValue Time in 100-ns units that this entry will remain
172 in the ARP cache. A value of zero means that the
173 entry is permanent. A nonzero value will override
174 the one given by Configure() if the entry to be
175 added is a dynamic entry.
176 @param Overwrite If TRUE, the matching cache entry will be
177 overwritten with the supplied parameters. If
178 FALSE, EFI_ACCESS_DENIED is returned if the
179 corresponding cache entry already exists.
180
181 @retval EFI_SUCCESS The entry has been added or updated.
182 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
183 * This is NULL.
184 * DenyFlag is FALSE and TargetHwAddress is NULL.
185 * DenyFlag is FALSE and TargetSwAddress is NULL.
186 * TargetHwAddress is NULL and TargetSwAddress is NULL.
187 * Neither TargetSwAddress nor TargetHwAddress are NULL when DenyFlag is
188 TRUE.
189 @retval EFI_OUT_OF_RESOURCES The new ARP cache entry could not be allocated.
190 @retval EFI_ACCESS_DENIED The ARP cache entry already exists and Overwrite
191 is not true.
192 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
193
194**/
195typedef
198 IN EFI_ARP_PROTOCOL *This,
199 IN BOOLEAN DenyFlag,
200 IN VOID *TargetSwAddress OPTIONAL,
201 IN VOID *TargetHwAddress OPTIONAL,
202 IN UINT32 TimeoutValue,
203 IN BOOLEAN Overwrite
204 );
205
206/**
207 This function searches the ARP cache for matching entries and allocates a buffer into
208 which those entries are copied.
209
210 The first part of the allocated buffer is EFI_ARP_FIND_DATA, following which
211 are protocol address pairs and hardware address pairs.
212 When finding a specific protocol address (BySwAddress is TRUE and AddressBuffer
213 is not NULL), the ARP cache timeout for the found entry is reset if Refresh is
214 set to TRUE. If the found ARP cache entry is a permanent entry, it is not
215 affected by Refresh.
216
217 @param This The pointer to the EFI_ARP_PROTOCOL instance.
218 @param BySwAddress Set to TRUE to look for matching software protocol
219 addresses. Set to FALSE to look for matching
220 hardware protocol addresses.
221 @param AddressBuffer The pointer to the address buffer. Set to NULL
222 to match all addresses.
223 @param EntryLength The size of an entry in the entries buffer.
224 @param EntryCount The number of ARP cache entries that are found by
225 the specified criteria.
226 @param Entries The pointer to the buffer that will receive the ARP
227 cache entries.
228 @param Refresh Set to TRUE to refresh the timeout value of the
229 matching ARP cache entry.
230
231 @retval EFI_SUCCESS The requested ARP cache entries were copied into
232 the buffer.
233 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
234 This is NULL. Both EntryCount and EntryLength are
235 NULL, when Refresh is FALSE.
236 @retval EFI_NOT_FOUND No matching entries were found.
237 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
238
239**/
240typedef
243 IN EFI_ARP_PROTOCOL *This,
244 IN BOOLEAN BySwAddress,
245 IN VOID *AddressBuffer OPTIONAL,
246 OUT UINT32 *EntryLength OPTIONAL,
247 OUT UINT32 *EntryCount OPTIONAL,
249 IN BOOLEAN Refresh
250 );
251
252/**
253 This function removes specified ARP cache entries.
254
255 @param This The pointer to the EFI_ARP_PROTOCOL instance.
256 @param BySwAddress Set to TRUE to delete matching protocol addresses.
257 Set to FALSE to delete matching hardware
258 addresses.
259 @param AddressBuffer The pointer to the address buffer that is used as a
260 key to look for the cache entry. Set to NULL to
261 delete all entries.
262
263 @retval EFI_SUCCESS The entry was removed from the ARP cache.
264 @retval EFI_INVALID_PARAMETER This is NULL.
265 @retval EFI_NOT_FOUND The specified deletion key was not found.
266 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
267
268**/
269typedef
272 IN EFI_ARP_PROTOCOL *This,
273 IN BOOLEAN BySwAddress,
274 IN VOID *AddressBuffer OPTIONAL
275 );
276
277/**
278 This function delete all dynamic entries from the ARP cache that match the specified
279 software protocol type.
280
281 @param This The pointer to the EFI_ARP_PROTOCOL instance.
282
283 @retval EFI_SUCCESS The cache has been flushed.
284 @retval EFI_INVALID_PARAMETER This is NULL.
285 @retval EFI_NOT_FOUND There are no matching dynamic cache entries.
286 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
287
288**/
289typedef
292 IN EFI_ARP_PROTOCOL *This
293 );
294
295/**
296 This function tries to resolve the TargetSwAddress and optionally returns a
297 TargetHwAddress if it already exists in the ARP cache.
298
299 @param This The pointer to the EFI_ARP_PROTOCOL instance.
300 @param TargetSwAddress The pointer to the protocol address to resolve.
301 @param ResolvedEvent The pointer to the event that will be signaled when
302 the address is resolved or some error occurs.
303 @param TargetHwAddress The pointer to the buffer for the resolved hardware
304 address in network byte order.
305
306 @retval EFI_SUCCESS The data is copied from the ARP cache into the
307 TargetHwAddress buffer.
308 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
309 This is NULL. TargetHwAddress is NULL.
310 @retval EFI_ACCESS_DENIED The requested address is not present in the normal
311 ARP cache but is present in the deny address list.
312 Outgoing traffic to that address is forbidden.
313 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
314 @retval EFI_NOT_READY The request has been started and is not finished.
315
316**/
317typedef
320 IN EFI_ARP_PROTOCOL *This,
321 IN VOID *TargetSwAddress OPTIONAL,
322 IN EFI_EVENT ResolvedEvent OPTIONAL,
323 OUT VOID *TargetHwAddress
324 );
325
326/**
327 This function aborts the previous ARP request (identified by This, TargetSwAddress
328 and ResolvedEvent) that is issued by EFI_ARP_PROTOCOL.Request().
329
330 If the request is in the internal ARP request queue, the request is aborted
331 immediately and its ResolvedEvent is signaled. Only an asynchronous address
332 request needs to be canceled. If TargeSwAddress and ResolveEvent are both
333 NULL, all the pending asynchronous requests that have been issued by This
334 instance will be cancelled and their corresponding events will be signaled.
335
336 @param This The pointer to the EFI_ARP_PROTOCOL instance.
337 @param TargetSwAddress The pointer to the protocol address in previous
338 request session.
339 @param ResolvedEvent Pointer to the event that is used as the
340 notification event in previous request session.
341
342 @retval EFI_SUCCESS The pending request session(s) is/are aborted and
343 corresponding event(s) is/are signaled.
344 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
345 This is NULL. TargetSwAddress is not NULL and
346 ResolvedEvent is NULL. TargetSwAddress is NULL and
347 ResolvedEvent is not NULL.
348 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
349 @retval EFI_NOT_FOUND The request is not issued by
350 EFI_ARP_PROTOCOL.Request().
351
352
353**/
354typedef
357 IN EFI_ARP_PROTOCOL *This,
358 IN VOID *TargetSwAddress OPTIONAL,
359 IN EFI_EVENT ResolvedEvent OPTIONAL
360 );
361
362///
363/// ARP is used to resolve local network protocol addresses into
364/// network hardware addresses.
365///
375
378
379#endif
unsigned short UINT16
2-byte unsigned value.
unsigned char BOOLEAN
Logical Boolean.
#define EFIAPI
unsigned char UINT8
1-byte unsigned value.
unsigned int UINT32
4-byte unsigned value.
EFI_GUID gEfiArpServiceBindingProtocolGuid
EFI_GUID gEfiArpProtocolGuid
struct _EFI_ARP_PROTOCOL EFI_ARP_PROTOCOL
Definition Arp.h:34
EFI_STATUS(EFIAPI * EFI_ARP_FIND)(IN EFI_ARP_PROTOCOL *This, IN BOOLEAN BySwAddress, IN VOID *AddressBuffer OPTIONAL, OUT UINT32 *EntryLength OPTIONAL, OUT UINT32 *EntryCount OPTIONAL, OUT EFI_ARP_FIND_DATA **Entries OPTIONAL, IN BOOLEAN Refresh)
This function searches the ARP cache for matching entries and allocates a buffer into which those ent...
Definition Arp.h:242
EFI_STATUS(EFIAPI * EFI_ARP_CONFIGURE)(IN EFI_ARP_PROTOCOL *This, IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL)
This function is used to assign a station address to the ARP cache for this instance of the ARP drive...
Definition Arp.h:145
EFI_STATUS(EFIAPI * EFI_ARP_CANCEL)(IN EFI_ARP_PROTOCOL *This, IN VOID *TargetSwAddress OPTIONAL, IN EFI_EVENT ResolvedEvent OPTIONAL)
This function aborts the previous ARP request (identified by This, TargetSwAddress and ResolvedEvent)...
Definition Arp.h:356
EFI_STATUS(EFIAPI * EFI_ARP_DELETE)(IN EFI_ARP_PROTOCOL *This, IN BOOLEAN BySwAddress, IN VOID *AddressBuffer OPTIONAL)
This function removes specified ARP cache entries.
Definition Arp.h:271
EFI_STATUS(EFIAPI * EFI_ARP_FLUSH)(IN EFI_ARP_PROTOCOL *This)
This function delete all dynamic entries from the ARP cache that match the specified software protoco...
Definition Arp.h:291
EFI_STATUS(EFIAPI * EFI_ARP_REQUEST)(IN EFI_ARP_PROTOCOL *This, IN VOID *TargetSwAddress OPTIONAL, IN EFI_EVENT ResolvedEvent OPTIONAL, OUT VOID *TargetHwAddress)
This function tries to resolve the TargetSwAddress and optionally returns a TargetHwAddress if it alr...
Definition Arp.h:319
EFI_STATUS(EFIAPI * EFI_ARP_ADD)(IN EFI_ARP_PROTOCOL *This, IN BOOLEAN DenyFlag, IN VOID *TargetSwAddress OPTIONAL, IN VOID *TargetHwAddress OPTIONAL, IN UINT32 TimeoutValue, IN BOOLEAN Overwrite)
This function is used to insert entries into the ARP cache.
Definition Arp.h:197
#define VOID
Undeclared type.
Definition Base.h:272
#define OPTIONAL
Passing the datum to the function is optional, and a NULL is passed if the value is not supplied.
Definition Base.h:293
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define EFI_EVENT
Definition efi.h:54
#define IN
Definition mlx_utils.h:28
#define OUT
Definition mlx_utils.h:29
UINT32 RetryCount
The number of retries before a MAC address is resolved.
Definition Arp.h:105
UINT32 RetryTimeOut
The timeout value in 100-ns units that is used to wait for the ARP reply packet or the timeout value ...
Definition Arp.h:112
UINT16 SwAddressType
16-bit protocol type number in host byte order.
Definition Arp.h:79
VOID * StationAddress
The pointer to the first byte of the protocol address to register.
Definition Arp.h:92
UINT8 SwAddressLength
The length in bytes of the station's protocol address to register.
Definition Arp.h:84
UINT32 EntryTimeOut
The timeout value in 100-ns units that is associated with each new dynamic ARP cache entry.
Definition Arp.h:99
UINT8 SwAddressLength
The length of the protocol address.
Definition Arp.h:72
BOOLEAN DenyFlag
Set to TRUE if this entry is a "deny" entry.
Definition Arp.h:46
BOOLEAN StaticFlag
Set to TRUE if this entry will not time out.
Definition Arp.h:52
UINT8 HwAddressLength
The length of the hardware address.
Definition Arp.h:67
UINT32 Size
Length in bytes of this entry.
Definition Arp.h:40
UINT16 HwAddressType
16-bit ARP hardware identifier number.
Definition Arp.h:57
UINT16 SwAddressType
16-bit protocol type number.
Definition Arp.h:62
ARP is used to resolve local network protocol addresses into network hardware addresses.
Definition Arp.h:366
EFI_ARP_FLUSH Flush
Definition Arp.h:371
EFI_ARP_FIND Find
Definition Arp.h:369
EFI_ARP_DELETE Delete
Definition Arp.h:370
EFI_ARP_CONFIGURE Configure
Definition Arp.h:367
EFI_ARP_CANCEL Cancel
Definition Arp.h:373
EFI_ARP_ADD Add
Definition Arp.h:368
EFI_ARP_REQUEST Request
Definition Arp.h:372