]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Arp.h
Fix doxygen issue:
[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, 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 /**
82 Inserts an entry to the ARP cache.
83
84 @param This A pointer to the EFI_ARP_PROTOCOL instance.
85 @param DenyFlag Set to TRUE if this entry is a "deny" entry. Set to FALSE if this
86 entry is a "normal" entry.
87 @param TargetSwAddress Pointer to a protocol address to add (or deny). May be set to
88 NULL if DenyFlag is TRUE.
89 @param TargetHwAddress Pointer to a hardware address to add (or deny). May be set to
90 NULL if DenyFlag is TRUE.
91 @param TimeoutValue Time in 100-ns units that this entry will remain in the ARP
92 cache. A value of zero means that the entry is permanent. A
93 nonzero value will override the one given by Configure() if
94 the entry to be added is dynamic entry.
95 @param Overwrite If TRUE, the matching cache entry will be overwritten with the
96 supplied parameters. If FALSE, EFI_ACCESS_DENIED
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 @retval EFI_OUT_OF_RESOURCES The new ARP cache entry could not be allocated.
101 @retval EFI_ACCESS_DENIED The ARP cache entry already exists and Overwrite is not true.
102 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
103
104 **/
105 typedef
106 EFI_STATUS
107 (EFIAPI *EFI_ARP_ADD)(
108 IN EFI_ARP_PROTOCOL *This,
109 IN BOOLEAN DenyFlag,
110 IN VOID *TargetSwAddress OPTIONAL,
111 IN VOID *TargetHwAddress OPTIONAL,
112 IN UINT32 TimeoutValue,
113 IN BOOLEAN Overwrite
114 )
115 ;
116
117 /**
118 Locates one or more entries in the ARP cache.
119
120 @param This A pointer to the EFI_ARP_PROTOCOL instance.
121 @param BySwAddress Set to TRUE to look for matching software protocol addresses.
122 Set to FALSE to look for matching hardware protocol addresses.
123 @param AddressBuffer Pointer to address buffer. Set to NULL to match all addresses.
124 @param EntryLength The size of an entry in the entries buffer. To keep the
125 EFI_ARP_FIND_DATA structure properly aligned, this field
126 may be longer than sizeof(EFI_ARP_FIND_DATA) plus
127 the length of the software and hardware addresses.
128 @param EntryCount The number of ARP cache entries that are found by the specified criteria.
129 @param Entries Pointer to the buffer that will receive the ARP cache entries.
130 @param Refresh Set to TRUE to refresh the timeout value of the matching ARP
131 cache entry.
132
133 @retval EFI_SUCCESS The requested ARP cache entries were copied into the buffer.
134 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
135 @retval EFI_NOT_FOUND No matching entries were found.
136 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
137
138 **/
139 typedef
140 EFI_STATUS
141 (EFIAPI *EFI_ARP_FIND)(
142 IN EFI_ARP_PROTOCOL *This,
143 IN BOOLEAN BySwAddress,
144 IN VOID *AddressBuffer OPTIONAL,
145 OUT UINT32 *EntryLength OPTIONAL,
146 OUT UINT32 *EntryCount OPTIONAL,
147 OUT EFI_ARP_FIND_DATA **Entries OPTIONAL,
148 IN BOOLEAN Refresh
149 )
150 ;
151
152
153 /**
154 Removes entries from the ARP cache.
155
156 @param This A pointer to the EFI_ARP_PROTOCOL instance.
157 @param BySwAddress Set to TRUE to delete matching protocol addresses.
158 Set to FALSE to delete matching hardware addresses.
159 @param AddressBuffer Pointer to the address buffer that is used as a key to look for the
160 cache entry. Set to NULL to delete all entries.
161
162 @retval EFI_SUCCESS The entry was removed from the ARP cache.
163 @retval EFI_INVALID_PARAMETER This is NULL.
164 @retval EFI_NOT_FOUND The specified deletion key was not found.
165 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
166
167 **/
168 typedef
169 EFI_STATUS
170 (EFIAPI *EFI_ARP_DELETE)(
171 IN EFI_ARP_PROTOCOL *This,
172 IN BOOLEAN BySwAddress,
173 IN VOID *AddressBuffer OPTIONAL
174 )
175 ;
176
177 /**
178 Removes all dynamic ARP cache entries that were added by this interface.
179
180 @param This A pointer to the EFI_ARP_PROTOCOL instance.
181
182 @retval EFI_SUCCESS The cache has been flushed.
183 @retval EFI_INVALID_PARAMETER This is NULL.
184 @retval EFI_NOT_FOUND There are no matching dynamic cache entries.
185 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
186
187 **/
188 typedef
189 EFI_STATUS
190 (EFIAPI *EFI_ARP_FLUSH)(
191 IN EFI_ARP_PROTOCOL *This
192 )
193 ;
194
195 /**
196 Starts an ARP request session.
197
198 @param This A pointer to the EFI_ARP_PROTOCOL instance.
199 @param TargetSwAddress Pointer to the protocol address to resolve.
200 @param ResolvedEvent Pointer to the event that will be signaled when the address is
201 resolved or some error occurs.
202 @param TargetHwAddress Pointer to the buffer for the resolved hardware address in
203 network byte order. The buffer must be large enough to hold the
204 resulting hardware address. TargetHwAddress must not be
205 NULL.
206
207 @retval EFI_SUCCESS The data was copied from the ARP cache into the
208 TargetHwAddress buffer.
209 @retval EFI_INVALID_PARAMETER This or TargetHwAddress is NULL.
210 @retval EFI_ACCESS_DENIED The requested address is not present in the normal ARP cache but
211 is present in the deny address list. Outgoing traffic to that address is
212 forbidden.
213 @retval EFI_NOT_STARTED The ARP driver instance has not been configured.
214 @retval EFI_NOT_READY The request has been started and is not finished.
215 @retval EFI_UNSUPPORTED The requested conversion is not supported in this implementation or
216 configuration.
217
218 **/
219 typedef
220 EFI_STATUS
221 (EFIAPI *EFI_ARP_REQUEST)(
222 IN EFI_ARP_PROTOCOL *This,
223 IN VOID *TargetSwAddress OPTIONAL,
224 IN EFI_EVENT ResolvedEvent OPTIONAL,
225 OUT VOID *TargetHwAddress
226 )
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 struct _EFI_ARP_PROTOCOL {
255 EFI_ARP_CONFIGURE Configure;
256 EFI_ARP_ADD Add;
257 EFI_ARP_FIND Find;
258 EFI_ARP_DELETE Delete;
259 EFI_ARP_FLUSH Flush;
260 EFI_ARP_REQUEST Request;
261 EFI_ARP_CANCEL Cancel;
262 };
263
264
265 extern EFI_GUID gEfiArpServiceBindingProtocolGuid;
266 extern EFI_GUID gEfiArpProtocolGuid;
267
268 #endif