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