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