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