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