]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Arp.h
Code Scrub for Protocol and Ppi Definition
[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
78 )\r
79; \r
80\r
81/**\r
82 Inserts an entry to the ARP cache.\r
83\r
84 @param This A pointer to the EFI_ARP_PROTOCOL instance. \r
85 @param DenyFlag Set to TRUE if this entry is a "deny" entry. Set to FALSE if this\r
86 entry is a "normal" entry.\r
87 @param TargetSwAddress Pointer to a protocol address to add (or deny). May be set to\r
88 NULL if DenyFlag is TRUE.\r
89 @param TargetHwAddress Pointer to a hardware address to add (or deny). May be set to\r
90 NULL if DenyFlag is TRUE.\r
91 @param TimeoutValue Time in 100-ns units that this entry will remain in the ARP\r
92 cache. A value of zero means that the entry is permanent. A\r
93 nonzero value will override the one given by Configure() if\r
94 the entry to be added is dynamic entry.\r
95 @param Overwrite If TRUE, the matching cache entry will be overwritten with the\r
4ca9b6c4
LG
96 supplied parameters. If FALSE, EFI_ACCESS_DENIED is returned \r
97 if the corresponding cache entry already exists.\r
d1f95000 98\r
99 @retval EFI_SUCCESS The entry has been added or updated.\r
100 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
4ca9b6c4
LG
101 This is NULL. DenyFlag is FALSE and TargetHwAddress is NULL.\r
102 DenyFlag is FALSE and TargetSwAddress is NULL. TargetHwAddress is NULL and TargetSwAddress is NULL. \r
103 Both TargetSwAddress and TargetHwAddress are not NULL when DenyFlag is TRUE.\r
d1f95000 104 @retval EFI_OUT_OF_RESOURCES The new ARP cache entry could not be allocated.\r
105 @retval EFI_ACCESS_DENIED The ARP cache entry already exists and Overwrite is not true.\r
106 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r
107\r
108**/\r
109typedef\r
110EFI_STATUS\r
8b13229b 111(EFIAPI *EFI_ARP_ADD)(\r
d1f95000 112 IN EFI_ARP_PROTOCOL *This,\r
113 IN BOOLEAN DenyFlag,\r
114 IN VOID *TargetSwAddress OPTIONAL,\r
115 IN VOID *TargetHwAddress OPTIONAL,\r
116 IN UINT32 TimeoutValue,\r
117 IN BOOLEAN Overwrite\r
118 )\r
119; \r
120\r
121/**\r
122 Locates one or more entries in the ARP cache.\r
123\r
124 @param This A pointer to the EFI_ARP_PROTOCOL instance.\r
125 @param BySwAddress Set to TRUE to look for matching software protocol addresses.\r
126 Set to FALSE to look for matching hardware protocol addresses.\r
127 @param AddressBuffer Pointer to address buffer. Set to NULL to match all addresses.\r
128 @param EntryLength The size of an entry in the entries buffer. To keep the\r
129 EFI_ARP_FIND_DATA structure properly aligned, this field\r
130 may be longer than sizeof(EFI_ARP_FIND_DATA) plus\r
131 the length of the software and hardware addresses.\r
132 @param EntryCount The number of ARP cache entries that are found by the specified criteria.\r
133 @param Entries Pointer to the buffer that will receive the ARP cache entries.\r
134 @param Refresh Set to TRUE to refresh the timeout value of the matching ARP\r
135 cache entry.\r
136\r
137 @retval EFI_SUCCESS The requested ARP cache entries were copied into the buffer.\r
138 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
4ca9b6c4
LG
139 This is NULL. Both EntryCount and EntryLength are NULL, \r
140 when Refresh is FALSE.\r
d1f95000 141 @retval EFI_NOT_FOUND No matching entries were found.\r
142 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r
143\r
144**/\r
145typedef \r
146EFI_STATUS\r
8b13229b 147(EFIAPI *EFI_ARP_FIND)(\r
d1f95000 148 IN EFI_ARP_PROTOCOL *This,\r
149 IN BOOLEAN BySwAddress,\r
150 IN VOID *AddressBuffer OPTIONAL,\r
151 OUT UINT32 *EntryLength OPTIONAL,\r
152 OUT UINT32 *EntryCount OPTIONAL,\r
153 OUT EFI_ARP_FIND_DATA **Entries OPTIONAL,\r
154 IN BOOLEAN Refresh\r
155 )\r
156; \r
157\r
158\r
159/**\r
160 Removes entries from the ARP cache.\r
161\r
162 @param This A pointer to the EFI_ARP_PROTOCOL instance.\r
163 @param BySwAddress Set to TRUE to delete matching protocol addresses.\r
164 Set to FALSE to delete matching hardware addresses.\r
165 @param AddressBuffer Pointer to the address buffer that is used as a key to look for the\r
166 cache entry. Set to NULL to delete all entries.\r
167\r
168 @retval EFI_SUCCESS The entry was removed from the ARP cache.\r
169 @retval EFI_INVALID_PARAMETER This is NULL.\r
170 @retval EFI_NOT_FOUND The specified deletion key was not found.\r
171 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r
172\r
173**/\r
174typedef\r
175EFI_STATUS\r
8b13229b 176(EFIAPI *EFI_ARP_DELETE)(\r
d1f95000 177 IN EFI_ARP_PROTOCOL *This,\r
178 IN BOOLEAN BySwAddress,\r
179 IN VOID *AddressBuffer OPTIONAL\r
180 )\r
181; \r
182\r
183/**\r
184 Removes all dynamic ARP cache entries that were added by this interface.\r
185\r
4ca9b6c4 186 @param This A pointer to the EFI_ARP_PROTOCOL instance.\r
d1f95000 187 \r
188 @retval EFI_SUCCESS The cache has been flushed.\r
189 @retval EFI_INVALID_PARAMETER This is NULL.\r
190 @retval EFI_NOT_FOUND There are no matching dynamic cache entries.\r
191 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r
192\r
193**/\r
194typedef\r
195EFI_STATUS\r
8b13229b 196(EFIAPI *EFI_ARP_FLUSH)(\r
d1f95000 197 IN EFI_ARP_PROTOCOL *This\r
198 )\r
199; \r
200\r
201/**\r
202 Starts an ARP request session.\r
203\r
204 @param This A pointer to the EFI_ARP_PROTOCOL instance.\r
205 @param TargetSwAddress Pointer to the protocol address to resolve.\r
206 @param ResolvedEvent Pointer to the event that will be signaled when the address is\r
207 resolved or some error occurs.\r
208 @param TargetHwAddress Pointer to the buffer for the resolved hardware address in\r
209 network byte order. The buffer must be large enough to hold the\r
210 resulting hardware address. TargetHwAddress must not be\r
211 NULL.\r
212\r
213 @retval EFI_SUCCESS The data was copied from the ARP cache into the\r
214 TargetHwAddress buffer.\r
215 @retval EFI_INVALID_PARAMETER This or TargetHwAddress is NULL.\r
216 @retval EFI_ACCESS_DENIED The requested address is not present in the normal ARP cache but\r
217 is present in the deny address list. Outgoing traffic to that address is\r
218 forbidden.\r
219 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r
220 @retval EFI_NOT_READY The request has been started and is not finished.\r
221 @retval EFI_UNSUPPORTED The requested conversion is not supported in this implementation or\r
222 configuration.\r
223\r
224**/\r
225typedef\r
226EFI_STATUS\r
8b13229b 227(EFIAPI *EFI_ARP_REQUEST)(\r
d1f95000 228 IN EFI_ARP_PROTOCOL *This, \r
229 IN VOID *TargetSwAddress OPTIONAL,\r
230 IN EFI_EVENT ResolvedEvent OPTIONAL,\r
231 OUT VOID *TargetHwAddress \r
232 )\r
233; \r
234\r
235/**\r
236 Cancels an ARP request session.\r
237\r
238 @param This A pointer to the EFI_ARP_PROTOCOL instance.\r
239 @param TargetSwAddress Pointer to the protocol address in previous request session.\r
240 @param ResolvedEvent Pointer to the event that is used as the notification event in\r
241 previous request session.\r
242\r
243 @retval EFI_SUCCESS The pending request session(s) is/are aborted and corresponding\r
244 event(s) is/are signaled.\r
245 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
246 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r
247 @retval EFI_NOT_FOUND The request is not issued by\r
248 EFI_ARP_PROTOCOL.Request().\r
249\r
250**/\r
251typedef\r
252EFI_STATUS\r
8b13229b 253(EFIAPI *EFI_ARP_CANCEL)(\r
d1f95000 254 IN EFI_ARP_PROTOCOL *This, \r
255 IN VOID *TargetSwAddress OPTIONAL,\r
256 IN EFI_EVENT ResolvedEvent OPTIONAL\r
257 )\r
258; \r
259\r
4ca9b6c4
LG
260/**\r
261 @par Protocol Description:\r
262 ARP is used to resolve local network protocol addresses into \r
263 network hardware addresses.\r
264\r
265 @param Configure\r
266 Adds a new station address (protocol type and network address) to the ARP cache.\r
267 \r
268 @param Add\r
269 Manually inserts an entry to the ARP cache for administrative purpose.\r
270\r
271 @param Find\r
272 Locates one or more entries in the ARP cache.\r
273\r
274 @param Delete\r
275 Removes an entry from the ARP cache.\r
276 \r
277 @param Flush\r
278 Removes all dynamic ARP cache entries of a specified protocol type.\r
279 \r
280 @param Request\r
281 Starts an ARP request session.\r
282 \r
283 @param Cancel\r
284 Abort previous ARP request session.\r
285\r
286**/\r
d1f95000 287struct _EFI_ARP_PROTOCOL {\r
288 EFI_ARP_CONFIGURE Configure;\r
289 EFI_ARP_ADD Add;\r
290 EFI_ARP_FIND Find;\r
291 EFI_ARP_DELETE Delete;\r
292 EFI_ARP_FLUSH Flush;\r
293 EFI_ARP_REQUEST Request;\r
294 EFI_ARP_CANCEL Cancel;\r
295};\r
296\r
297\r
298extern EFI_GUID gEfiArpServiceBindingProtocolGuid;\r
299extern EFI_GUID gEfiArpProtocolGuid;\r
300\r
301#endif\r