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