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