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