]>
Commit | Line | Data |
---|---|---|
a3bcde70 HT |
1 | /** @file\r |
2 | Definition of Neighbor Discovery support routines.\r | |
3 | \r | |
75dce340 | 4 | Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r |
a3bcde70 HT |
5 | \r |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php.\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __EFI_IP6_ND_H__\r | |
17 | #define __EFI_IP6_ND_H__\r | |
18 | \r | |
19 | #define IP6_GET_TICKS(Ms) (((Ms) + IP6_TIMER_INTERVAL_IN_MS - 1) / IP6_TIMER_INTERVAL_IN_MS)\r | |
20 | \r | |
21 | enum {\r | |
22 | IP6_INF_ROUTER_LIFETIME = 0xFFFF,\r | |
23 | \r | |
24 | IP6_MAX_RTR_SOLICITATION_DELAY = 1000, ///< 1000 milliseconds\r | |
25 | IP6_MAX_RTR_SOLICITATIONS = 3,\r | |
26 | IP6_RTR_SOLICITATION_INTERVAL = 4000,\r | |
27 | \r | |
28 | IP6_MIN_RANDOM_FACTOR_SCALED = 1,\r | |
29 | IP6_MAX_RANDOM_FACTOR_SCALED = 3,\r | |
30 | IP6_RANDOM_FACTOR_SCALE = 2,\r | |
31 | \r | |
32 | IP6_MAX_MULTICAST_SOLICIT = 3,\r | |
33 | IP6_MAX_UNICAST_SOLICIT = 3,\r | |
34 | IP6_MAX_ANYCAST_DELAY_TIME = 1,\r | |
35 | IP6_MAX_NEIGHBOR_ADV = 3,\r | |
36 | IP6_REACHABLE_TIME = 30000,\r | |
37 | IP6_RETRANS_TIMER = 1000,\r | |
38 | IP6_DELAY_FIRST_PROBE_TIME = 5000,\r | |
39 | \r | |
40 | IP6_MIN_LINK_MTU = 1280,\r | |
41 | IP6_MAX_LINK_MTU = 1500,\r | |
42 | \r | |
43 | IP6_IS_ROUTER_FLAG = 0x80,\r | |
44 | IP6_SOLICITED_FLAG = 0x40,\r | |
45 | IP6_OVERRIDE_FLAG = 0x20,\r | |
46 | \r | |
47 | IP6_M_ADDR_CONFIG_FLAG = 0x80,\r | |
48 | IP6_O_CONFIG_FLAG = 0x40,\r | |
49 | \r | |
50 | IP6_ON_LINK_FLAG = 0x80,\r | |
51 | IP6_AUTO_CONFIG_FLAG = 0x40,\r | |
52 | \r | |
53 | IP6_ND_LENGTH = 24,\r | |
54 | IP6_RA_LENGTH = 16,\r | |
55 | IP6_REDITECT_LENGTH = 40,\r | |
56 | IP6_DAD_ENTRY_SIGNATURE = SIGNATURE_32 ('I', 'P', 'D', 'E')\r | |
57 | };\r | |
58 | \r | |
59 | typedef\r | |
60 | VOID\r | |
61 | (*IP6_ARP_CALLBACK) (\r | |
62 | VOID *Context\r | |
63 | );\r | |
64 | \r | |
65 | typedef struct _IP6_ETHE_ADDR_OPTION {\r | |
66 | UINT8 Type;\r | |
67 | UINT8 Length;\r | |
68 | UINT8 EtherAddr[6];\r | |
69 | } IP6_ETHER_ADDR_OPTION;\r | |
70 | \r | |
71 | typedef struct _IP6_MTU_OPTION {\r | |
72 | UINT8 Type;\r | |
73 | UINT8 Length;\r | |
74 | UINT16 Reserved;\r | |
75 | UINT32 Mtu;\r | |
76 | } IP6_MTU_OPTION;\r | |
77 | \r | |
78 | typedef struct _IP6_PREFIX_INFO_OPTION {\r | |
79 | UINT8 Type;\r | |
80 | UINT8 Length;\r | |
81 | UINT8 PrefixLength;\r | |
82 | UINT8 Reserved1;\r | |
83 | UINT32 ValidLifetime;\r | |
84 | UINT32 PreferredLifetime;\r | |
85 | UINT32 Reserved2;\r | |
86 | EFI_IPv6_ADDRESS Prefix;\r | |
87 | } IP6_PREFIX_INFO_OPTION;\r | |
88 | \r | |
89 | typedef\r | |
90 | VOID\r | |
91 | (*IP6_DAD_CALLBACK) (\r | |
92 | IN BOOLEAN IsDadPassed,\r | |
93 | IN EFI_IPv6_ADDRESS *TargetAddress,\r | |
94 | IN VOID *Context\r | |
95 | );\r | |
96 | \r | |
97 | typedef struct _IP6_DAD_ENTRY {\r | |
98 | UINT32 Signature;\r | |
99 | LIST_ENTRY Link;\r | |
100 | UINT32 MaxTransmit;\r | |
101 | UINT32 Transmit;\r | |
102 | UINT32 Receive;\r | |
103 | UINT32 RetransTick;\r | |
104 | IP6_ADDRESS_INFO *AddressInfo;\r | |
105 | EFI_IPv6_ADDRESS Destination;\r | |
106 | IP6_DAD_CALLBACK Callback;\r | |
107 | VOID *Context;\r | |
108 | } IP6_DAD_ENTRY;\r | |
109 | \r | |
110 | typedef struct _IP6_DELAY_JOIN_LIST {\r | |
111 | LIST_ENTRY Link;\r | |
112 | UINT32 DelayTime; ///< in tick per 50 milliseconds\r | |
113 | IP6_INTERFACE *Interface;\r | |
114 | IP6_ADDRESS_INFO *AddressInfo;\r | |
115 | IP6_DAD_CALLBACK DadCallback;\r | |
116 | VOID *Context;\r | |
117 | } IP6_DELAY_JOIN_LIST;\r | |
118 | \r | |
119 | typedef struct _IP6_NEIGHBOR_ENTRY {\r | |
120 | LIST_ENTRY Link;\r | |
121 | LIST_ENTRY ArpList;\r | |
122 | INTN RefCnt;\r | |
123 | BOOLEAN IsRouter;\r | |
124 | BOOLEAN ArpFree;\r | |
125 | BOOLEAN Dynamic;\r | |
126 | EFI_IPv6_ADDRESS Neighbor;\r | |
127 | EFI_MAC_ADDRESS LinkAddress;\r | |
128 | EFI_IP6_NEIGHBOR_STATE State;\r | |
129 | UINT32 Transmit;\r | |
130 | UINT32 Ticks;\r | |
131 | \r | |
132 | LIST_ENTRY Frames;\r | |
133 | IP6_INTERFACE *Interface;\r | |
134 | IP6_ARP_CALLBACK CallBack;\r | |
135 | } IP6_NEIGHBOR_ENTRY;\r | |
136 | \r | |
137 | typedef struct _IP6_DEFAULT_ROUTER {\r | |
138 | LIST_ENTRY Link;\r | |
139 | INTN RefCnt;\r | |
140 | UINT16 Lifetime;\r | |
141 | EFI_IPv6_ADDRESS Router;\r | |
142 | IP6_NEIGHBOR_ENTRY *NeighborCache;\r | |
143 | } IP6_DEFAULT_ROUTER;\r | |
144 | \r | |
145 | typedef struct _IP6_PREFIX_LIST_ENTRY {\r | |
146 | LIST_ENTRY Link;\r | |
147 | INTN RefCnt;\r | |
148 | UINT32 ValidLifetime;\r | |
149 | UINT32 PreferredLifetime;\r | |
150 | UINT8 PrefixLength;\r | |
151 | EFI_IPv6_ADDRESS Prefix;\r | |
152 | } IP6_PREFIX_LIST_ENTRY;\r | |
153 | \r | |
154 | /**\r | |
155 | Build a array of EFI_IP6_NEIGHBOR_CACHE to be returned to the caller. The number\r | |
156 | of EFI_IP6_NEIGHBOR_CACHE is also returned.\r | |
157 | \r | |
158 | @param[in] IpInstance The pointer to IP6_PROTOCOL instance.\r | |
159 | @param[out] NeighborCount The number of returned neighbor cache entries.\r | |
160 | @param[out] NeighborCache The pointer to the array of EFI_IP6_NEIGHBOR_CACHE.\r | |
161 | \r | |
162 | @retval EFI_SUCCESS The EFI_IP6_NEIGHBOR_CACHE successfully built.\r | |
163 | @retval EFI_OUT_OF_RESOURCES Failed to allocate the memory for the route table.\r | |
164 | \r | |
165 | **/\r | |
166 | EFI_STATUS\r | |
167 | Ip6BuildEfiNeighborCache (\r | |
168 | IN IP6_PROTOCOL *IpInstance,\r | |
169 | OUT UINT32 *NeighborCount,\r | |
170 | OUT EFI_IP6_NEIGHBOR_CACHE **NeighborCache\r | |
171 | );\r | |
172 | \r | |
173 | /**\r | |
174 | Build a array of EFI_IP6_ADDRESS_INFO to be returned to the caller. The number\r | |
175 | of prefix entries is also returned.\r | |
176 | \r | |
177 | @param[in] IpInstance The pointer to IP6_PROTOCOL instance.\r | |
178 | @param[out] PrefixCount The number of returned prefix entries.\r | |
179 | @param[out] PrefixTable The pointer to the array of PrefixTable.\r | |
180 | \r | |
181 | @retval EFI_SUCCESS The prefix table successfully built.\r | |
182 | @retval EFI_OUT_OF_RESOURCES Failed to allocate the memory for the prefix table.\r | |
183 | \r | |
184 | **/\r | |
185 | EFI_STATUS\r | |
186 | Ip6BuildPrefixTable (\r | |
187 | IN IP6_PROTOCOL *IpInstance,\r | |
188 | OUT UINT32 *PrefixCount,\r | |
189 | OUT EFI_IP6_ADDRESS_INFO **PrefixTable\r | |
190 | );\r | |
191 | \r | |
192 | /**\r | |
193 | Allocate and initialize an IP6 default router entry.\r | |
194 | \r | |
195 | @param[in] IpSb The pointer to the IP6_SERVICE instance.\r | |
196 | @param[in] Ip6Address The IPv6 address of the default router.\r | |
197 | @param[in] RouterLifetime The lifetime associated with the default\r | |
198 | router, in units of seconds.\r | |
199 | \r | |
200 | @return NULL if it failed to allocate memory for the default router node.\r | |
201 | Otherwise, point to the created default router node.\r | |
202 | \r | |
203 | **/\r | |
204 | IP6_DEFAULT_ROUTER *\r | |
205 | Ip6CreateDefaultRouter (\r | |
206 | IN IP6_SERVICE *IpSb,\r | |
207 | IN EFI_IPv6_ADDRESS *Ip6Address,\r | |
208 | IN UINT16 RouterLifetime\r | |
209 | );\r | |
210 | \r | |
211 | /**\r | |
212 | Destroy an IP6 default router entry.\r | |
213 | \r | |
214 | @param[in] IpSb The pointer to the IP6_SERVICE instance.\r | |
215 | @param[in] DefaultRouter The to be destroyed IP6_DEFAULT_ROUTER.\r | |
216 | \r | |
217 | **/\r | |
218 | VOID\r | |
219 | Ip6DestroyDefaultRouter (\r | |
220 | IN IP6_SERVICE *IpSb,\r | |
221 | IN IP6_DEFAULT_ROUTER *DefaultRouter\r | |
222 | );\r | |
223 | \r | |
224 | /**\r | |
225 | Clean an IP6 default router list.\r | |
226 | \r | |
227 | @param[in] IpSb The pointer to the IP6_SERVICE instance.\r | |
a3bcde70 HT |
228 | \r |
229 | **/\r | |
230 | VOID\r | |
231 | Ip6CleanDefaultRouterList (\r | |
232 | IN IP6_SERVICE *IpSb\r | |
233 | );\r | |
234 | \r | |
235 | /**\r | |
236 | Search a default router node from an IP6 default router list.\r | |
237 | \r | |
238 | @param[in] IpSb The pointer to the IP6_SERVICE instance.\r | |
239 | @param[in] Ip6Address The IPv6 address of the to be searched default router node.\r | |
240 | \r | |
241 | @return NULL if it failed to find the matching default router node.\r | |
242 | Otherwise, point to the found default router node.\r | |
243 | \r | |
244 | **/\r | |
245 | IP6_DEFAULT_ROUTER *\r | |
246 | Ip6FindDefaultRouter (\r | |
247 | IN IP6_SERVICE *IpSb,\r | |
248 | IN EFI_IPv6_ADDRESS *Ip6Address\r | |
249 | );\r | |
250 | \r | |
251 | /**\r | |
252 | The function to be called after DAD (Duplicate Address Detection) is performed.\r | |
253 | \r | |
254 | @param[in] IsDadPassed If TRUE, the DAD operation succeed. Otherwise, the DAD operation failed.\r | |
255 | @param[in] IpIf Points to the IP6_INTERFACE.\r | |
256 | @param[in] DadEntry The DAD entry which already performed DAD.\r | |
257 | \r | |
258 | **/\r | |
259 | VOID\r | |
260 | Ip6OnDADFinished (\r | |
261 | IN BOOLEAN IsDadPassed,\r | |
262 | IN IP6_INTERFACE *IpIf,\r | |
263 | IN IP6_DAD_ENTRY *DadEntry\r | |
264 | );\r | |
265 | \r | |
266 | /**\r | |
267 | Create a DAD (Duplicate Address Detection) entry and queue it to be performed.\r | |
268 | \r | |
269 | @param[in] IpIf Points to the IP6_INTERFACE.\r | |
270 | @param[in] AddressInfo The address information which needs DAD performed.\r | |
271 | @param[in] Callback The callback routine that will be called after DAD\r | |
272 | is performed. This is an optional parameter that\r | |
273 | may be NULL.\r | |
274 | @param[in] Context The opaque parameter for a DAD callback routine.\r | |
275 | This is an optional parameter that may be NULL.\r | |
276 | \r | |
277 | @retval EFI_SUCCESS The DAD entry was created and queued.\r | |
278 | @retval EFI_OUT_OF_RESOURCES Failed to allocate the memory to complete the\r | |
279 | operation.\r | |
280 | \r | |
281 | \r | |
282 | **/\r | |
283 | EFI_STATUS\r | |
284 | Ip6InitDADProcess (\r | |
285 | IN IP6_INTERFACE *IpIf,\r | |
286 | IN IP6_ADDRESS_INFO *AddressInfo,\r | |
287 | IN IP6_DAD_CALLBACK Callback OPTIONAL,\r | |
288 | IN VOID *Context OPTIONAL\r | |
289 | );\r | |
290 | \r | |
291 | /**\r | |
292 | Search IP6_DAD_ENTRY from the Duplicate Address Detection List.\r | |
293 | \r | |
294 | @param[in] IpSb The pointer to the IP6_SERVICE instance.\r | |
295 | @param[in] Target The address information which needs DAD performed .\r | |
296 | @param[out] Interface If not NULL, output the IP6 interface that configures\r | |
297 | the tentative address.\r | |
298 | \r | |
299 | @return NULL if failed to find the matching DAD entry.\r | |
300 | Otherwise, point to the found DAD entry.\r | |
301 | \r | |
302 | **/\r | |
303 | IP6_DAD_ENTRY *\r | |
304 | Ip6FindDADEntry (\r | |
305 | IN IP6_SERVICE *IpSb,\r | |
306 | IN EFI_IPv6_ADDRESS *Target,\r | |
307 | OUT IP6_INTERFACE **Interface OPTIONAL\r | |
308 | );\r | |
309 | \r | |
310 | /**\r | |
311 | Allocate and initialize a IP6 prefix list entry.\r | |
312 | \r | |
313 | @param[in] IpSb The pointer to IP6_SERVICE instance.\r | |
314 | @param[in] OnLinkOrAuto If TRUE, the entry is created for the on link prefix list.\r | |
315 | Otherwise, it is created for the autoconfiguration prefix list.\r | |
316 | @param[in] ValidLifetime The length of time in seconds that the prefix\r | |
317 | is valid for the purpose of on-link determination.\r | |
318 | @param[in] PreferredLifetime The length of time in seconds that addresses\r | |
319 | generated from the prefix via stateless address\r | |
320 | autoconfiguration remain preferred.\r | |
321 | @param[in] PrefixLength The prefix length of the Prefix.\r | |
322 | @param[in] Prefix The prefix address.\r | |
323 | \r | |
324 | @return NULL if it failed to allocate memory for the prefix node. Otherwise, point\r | |
325 | to the created or existing prefix list entry.\r | |
326 | \r | |
327 | **/\r | |
328 | IP6_PREFIX_LIST_ENTRY *\r | |
329 | Ip6CreatePrefixListEntry (\r | |
330 | IN IP6_SERVICE *IpSb,\r | |
331 | IN BOOLEAN OnLinkOrAuto,\r | |
332 | IN UINT32 ValidLifetime,\r | |
333 | IN UINT32 PreferredLifetime,\r | |
334 | IN UINT8 PrefixLength,\r | |
335 | IN EFI_IPv6_ADDRESS *Prefix\r | |
336 | );\r | |
337 | \r | |
338 | /**\r | |
75dce340 | 339 | Destroy a IP6 prefix list entry.\r |
a3bcde70 HT |
340 | \r |
341 | @param[in] IpSb The pointer to IP6_SERVICE instance.\r | |
342 | @param[in] PrefixEntry The to be destroyed prefix list entry.\r | |
343 | @param[in] OnLinkOrAuto If TRUE, the entry is removed from on link prefix list.\r | |
344 | Otherwise remove from autoconfiguration prefix list.\r | |
345 | @param[in] ImmediateDelete If TRUE, remove the entry directly.\r | |
346 | Otherwise, check the reference count to see whether\r | |
347 | it should be removed.\r | |
348 | \r | |
349 | **/\r | |
350 | VOID\r | |
351 | Ip6DestroyPrefixListEntry (\r | |
352 | IN IP6_SERVICE *IpSb,\r | |
353 | IN IP6_PREFIX_LIST_ENTRY *PrefixEntry,\r | |
354 | IN BOOLEAN OnLinkOrAuto,\r | |
355 | IN BOOLEAN ImmediateDelete\r | |
356 | );\r | |
357 | \r | |
358 | /**\r | |
359 | Search the list array to find an IP6 prefix list entry.\r | |
360 | \r | |
361 | @param[in] IpSb The pointer to IP6_SERVICE instance.\r | |
362 | @param[in] OnLinkOrAuto If TRUE, the search the link prefix list,\r | |
363 | Otherwise search the autoconfiguration prefix list.\r | |
364 | @param[in] PrefixLength The prefix length of the Prefix\r | |
365 | @param[in] Prefix The prefix address.\r | |
366 | \r | |
367 | @return NULL if cannot find the IP6 prefix list entry. Otherwise, return the\r | |
368 | pointer to the IP6 prefix list entry.\r | |
369 | \r | |
370 | **/\r | |
371 | IP6_PREFIX_LIST_ENTRY *\r | |
372 | Ip6FindPrefixListEntry (\r | |
373 | IN IP6_SERVICE *IpSb,\r | |
374 | IN BOOLEAN OnLinkOrAuto,\r | |
375 | IN UINT8 PrefixLength,\r | |
376 | IN EFI_IPv6_ADDRESS *Prefix\r | |
377 | );\r | |
378 | \r | |
379 | /**\r | |
380 | Release the resource in prefix list table, and destroy the list entry and\r | |
381 | corresponding addresses or route entries.\r | |
382 | \r | |
383 | @param[in] IpSb The pointer to the IP6_SERVICE instance.\r | |
384 | @param[in] ListHead The list entry head of the prefix list table.\r | |
385 | \r | |
386 | **/\r | |
387 | VOID\r | |
388 | Ip6CleanPrefixListTable (\r | |
389 | IN IP6_SERVICE *IpSb,\r | |
390 | IN LIST_ENTRY *ListHead\r | |
391 | );\r | |
392 | \r | |
393 | /**\r | |
394 | Allocate and initialize an IP6 neighbor cache entry.\r | |
395 | \r | |
396 | @param[in] IpSb The pointer to the IP6_SERVICE instance.\r | |
397 | @param[in] CallBack The callback function to be called when\r | |
398 | address resolution is finished.\r | |
399 | @param[in] Ip6Address Points to the IPv6 address of the neighbor.\r | |
400 | @param[in] LinkAddress Points to the MAC address of the neighbor.\r | |
401 | Ignored if NULL.\r | |
402 | \r | |
403 | @return NULL if failed to allocate memory for the neighbor cache entry.\r | |
404 | Otherwise, point to the created neighbor cache entry.\r | |
405 | \r | |
406 | **/\r | |
407 | IP6_NEIGHBOR_ENTRY *\r | |
408 | Ip6CreateNeighborEntry (\r | |
409 | IN IP6_SERVICE *IpSb,\r | |
410 | IN IP6_ARP_CALLBACK CallBack,\r | |
411 | IN EFI_IPv6_ADDRESS *Ip6Address,\r | |
412 | IN EFI_MAC_ADDRESS *LinkAddress OPTIONAL\r | |
413 | );\r | |
414 | \r | |
415 | /**\r | |
416 | Search a IP6 neighbor cache entry.\r | |
417 | \r | |
418 | @param[in] IpSb The pointer to the IP6_SERVICE instance.\r | |
419 | @param[in] Ip6Address Points to the IPv6 address of the neighbor.\r | |
420 | \r | |
421 | @return NULL if it failed to find the matching neighbor cache entry.\r | |
422 | Otherwise, point to the found neighbor cache entry.\r | |
423 | \r | |
424 | **/\r | |
425 | IP6_NEIGHBOR_ENTRY *\r | |
426 | Ip6FindNeighborEntry (\r | |
427 | IN IP6_SERVICE *IpSb,\r | |
428 | IN EFI_IPv6_ADDRESS *Ip6Address\r | |
429 | );\r | |
430 | \r | |
431 | /**\r | |
432 | Free a IP6 neighbor cache entry and remove all the frames on the address\r | |
433 | resolution queue that pass the FrameToCancel. That is, either FrameToCancel\r | |
434 | is NULL, or it returns true for the frame.\r | |
435 | \r | |
436 | @param[in] IpSb The pointer to the IP6_SERVICE instance.\r | |
437 | @param[in] NeighborCache The to be free neighbor cache entry.\r | |
438 | @param[in] SendIcmpError If TRUE, send out ICMP error.\r | |
439 | @param[in] FullFree If TRUE, remove the neighbor cache entry.\r | |
440 | Otherwise remove the pending frames.\r | |
441 | @param[in] IoStatus The status returned to the cancelled frames'\r | |
442 | callback function.\r | |
443 | @param[in] FrameToCancel Function to select which frame to cancel.\r | |
444 | This is an optional parameter that may be NULL.\r | |
445 | @param[in] Context Opaque parameter to the FrameToCancel.\r | |
446 | Ignored if FrameToCancel is NULL.\r | |
447 | \r | |
448 | @retval EFI_INVALID_PARAMETER The input parameter is invalid.\r | |
449 | @retval EFI_SUCCESS The operation finished successfully.\r | |
450 | \r | |
451 | **/\r | |
452 | EFI_STATUS\r | |
453 | Ip6FreeNeighborEntry (\r | |
454 | IN IP6_SERVICE *IpSb,\r | |
455 | IN IP6_NEIGHBOR_ENTRY *NeighborCache,\r | |
456 | IN BOOLEAN SendIcmpError,\r | |
457 | IN BOOLEAN FullFree,\r | |
458 | IN EFI_STATUS IoStatus,\r | |
459 | IN IP6_FRAME_TO_CANCEL FrameToCancel OPTIONAL,\r | |
460 | IN VOID *Context OPTIONAL\r | |
461 | );\r | |
462 | \r | |
463 | /**\r | |
464 | Add Neighbor cache entries. It is a work function for EfiIp6Neighbors().\r | |
465 | \r | |
466 | @param[in] IpSb The IP6 service binding instance.\r | |
467 | @param[in] TargetIp6Address Pointer to Target IPv6 address.\r | |
468 | @param[in] TargetLinkAddress Pointer to link-layer address of the target. Ignored if NULL.\r | |
469 | @param[in] Timeout Time in 100-ns units that this entry will remain in the neighbor\r | |
470 | cache. It will be deleted after Timeout. A value of zero means that\r | |
471 | the entry is permanent. A non-zero value means that the entry is\r | |
472 | dynamic.\r | |
473 | @param[in] Override If TRUE, the cached link-layer address of the matching entry will\r | |
474 | be overridden and updated; if FALSE, and if a\r | |
475 | corresponding cache entry already existed, EFI_ACCESS_DENIED\r | |
476 | will be returned.\r | |
477 | \r | |
478 | @retval EFI_SUCCESS The neighbor cache entry has been added.\r | |
479 | @retval EFI_OUT_OF_RESOURCES Could not add the entry to the neighbor cache\r | |
480 | due to insufficient resources.\r | |
481 | @retval EFI_NOT_FOUND TargetLinkAddress is NULL.\r | |
482 | @retval EFI_ACCESS_DENIED The to-be-added entry is already defined in the neighbor cache,\r | |
483 | and that entry is tagged as un-overridden (when DeleteFlag\r | |
484 | is FALSE).\r | |
485 | \r | |
486 | **/\r | |
487 | EFI_STATUS\r | |
488 | Ip6AddNeighbor (\r | |
489 | IN IP6_SERVICE *IpSb,\r | |
490 | IN EFI_IPv6_ADDRESS *TargetIp6Address,\r | |
491 | IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL,\r | |
492 | IN UINT32 Timeout,\r | |
493 | IN BOOLEAN Override\r | |
494 | );\r | |
495 | \r | |
496 | /**\r | |
497 | Delete or update Neighbor cache entries. It is a work function for EfiIp6Neighbors().\r | |
498 | \r | |
499 | @param[in] IpSb The IP6 service binding instance.\r | |
500 | @param[in] TargetIp6Address Pointer to Target IPv6 address.\r | |
501 | @param[in] TargetLinkAddress Pointer to link-layer address of the target. Ignored if NULL.\r | |
502 | @param[in] Timeout Time in 100-ns units that this entry will remain in the neighbor\r | |
503 | cache. It will be deleted after Timeout. A value of zero means that\r | |
504 | the entry is permanent. A non-zero value means that the entry is\r | |
505 | dynamic.\r | |
506 | @param[in] Override If TRUE, the cached link-layer address of the matching entry will\r | |
507 | be overridden and updated; if FALSE, and if a\r | |
508 | corresponding cache entry already existed, EFI_ACCESS_DENIED\r | |
509 | will be returned.\r | |
510 | \r | |
511 | @retval EFI_SUCCESS The neighbor cache entry has been updated or deleted.\r | |
512 | @retval EFI_NOT_FOUND This entry is not in the neighbor cache.\r | |
513 | \r | |
514 | **/\r | |
515 | EFI_STATUS\r | |
516 | Ip6DelNeighbor (\r | |
517 | IN IP6_SERVICE *IpSb,\r | |
518 | IN EFI_IPv6_ADDRESS *TargetIp6Address,\r | |
519 | IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL,\r | |
520 | IN UINT32 Timeout,\r | |
521 | IN BOOLEAN Override\r | |
522 | );\r | |
523 | \r | |
524 | /**\r | |
525 | Process the Neighbor Solicitation message. The message may be sent for Duplicate\r | |
526 | Address Detection or Address Resolution.\r | |
527 | \r | |
528 | @param[in] IpSb The IP service that received the packet.\r | |
529 | @param[in] Head The IP head of the message.\r | |
530 | @param[in] Packet The content of the message with IP head removed.\r | |
531 | \r | |
532 | @retval EFI_SUCCESS The packet processed successfully.\r | |
533 | @retval EFI_INVALID_PARAMETER The packet is invalid.\r | |
534 | @retval EFI_ICMP_ERROR The packet indicates that DAD is failed.\r | |
535 | @retval Others Failed to process the packet.\r | |
536 | \r | |
537 | **/\r | |
538 | EFI_STATUS\r | |
539 | Ip6ProcessNeighborSolicit (\r | |
540 | IN IP6_SERVICE *IpSb,\r | |
541 | IN EFI_IP6_HEADER *Head,\r | |
542 | IN NET_BUF *Packet\r | |
543 | );\r | |
544 | \r | |
545 | /**\r | |
546 | Process the Neighbor Advertisement message.\r | |
547 | \r | |
548 | @param[in] IpSb The IP service that received the packet.\r | |
549 | @param[in] Head The IP head of the message.\r | |
550 | @param[in] Packet The content of the message with IP head removed.\r | |
551 | \r | |
552 | @retval EFI_SUCCESS The packet processed successfully.\r | |
553 | @retval EFI_INVALID_PARAMETER The packet is invalid.\r | |
554 | @retval EFI_ICMP_ERROR The packet indicates that DAD is failed.\r | |
555 | @retval Others Failed to process the packet.\r | |
556 | \r | |
557 | **/\r | |
558 | EFI_STATUS\r | |
559 | Ip6ProcessNeighborAdvertise (\r | |
560 | IN IP6_SERVICE *IpSb,\r | |
561 | IN EFI_IP6_HEADER *Head,\r | |
562 | IN NET_BUF *Packet\r | |
563 | );\r | |
564 | \r | |
565 | /**\r | |
566 | Process the Router Advertisement message according to RFC4861.\r | |
567 | \r | |
568 | @param[in] IpSb The IP service that received the packet.\r | |
569 | @param[in] Head The IP head of the message.\r | |
570 | @param[in] Packet The content of the message with the IP head removed.\r | |
571 | \r | |
572 | @retval EFI_SUCCESS The packet processed successfully.\r | |
573 | @retval EFI_INVALID_PARAMETER The packet is invalid.\r | |
574 | @retval EFI_OUT_OF_RESOURCES Insufficient resources to complete the operation.\r | |
575 | @retval Others Failed to process the packet.\r | |
576 | \r | |
577 | **/\r | |
578 | EFI_STATUS\r | |
579 | Ip6ProcessRouterAdvertise (\r | |
580 | IN IP6_SERVICE *IpSb,\r | |
581 | IN EFI_IP6_HEADER *Head,\r | |
582 | IN NET_BUF *Packet\r | |
583 | );\r | |
584 | \r | |
585 | /**\r | |
586 | Process the ICMPv6 redirect message. Find the instance, then update\r | |
587 | its route cache.\r | |
588 | \r | |
589 | @param[in] IpSb The IP6 service binding instance that received\r | |
590 | the packet.\r | |
591 | @param[in] Head The IP head of the received ICMPv6 packet.\r | |
592 | @param[in] Packet The content of the ICMPv6 redirect packet with\r | |
593 | the IP head removed.\r | |
594 | \r | |
595 | @retval EFI_INVALID_PARAMETER The parameter is invalid.\r | |
596 | @retval EFI_OUT_OF_RESOURCES Insuffcient resources to complete the\r | |
597 | operation.\r | |
598 | @retval EFI_SUCCESS Successfully updated the route caches.\r | |
599 | \r | |
600 | **/\r | |
601 | EFI_STATUS\r | |
602 | Ip6ProcessRedirect (\r | |
603 | IN IP6_SERVICE *IpSb,\r | |
604 | IN EFI_IP6_HEADER *Head,\r | |
605 | IN NET_BUF *Packet\r | |
606 | );\r | |
607 | \r | |
608 | /**\r | |
609 | Generate router solicit message and send it out to Destination Address or\r | |
610 | All Router Link Local scope multicast address.\r | |
611 | \r | |
612 | @param[in] IpSb The IP service to send the packet.\r | |
613 | @param[in] Interface If not NULL, points to the IP6 interface to send\r | |
614 | the packet.\r | |
615 | @param[in] SourceAddress If not NULL, the source address of the message.\r | |
616 | @param[in] DestinationAddress If not NULL, the destination address of the message.\r | |
617 | @param[in] SourceLinkAddress If not NULL, the MAC address of the source.\r | |
618 | A source link-layer address option will be appended\r | |
619 | to the message.\r | |
620 | \r | |
621 | @retval EFI_OUT_OF_RESOURCES Insufficient resources to complete the operation.\r | |
622 | @retval EFI_SUCCESS The router solicit message was successfully sent.\r | |
623 | \r | |
624 | **/\r | |
625 | EFI_STATUS\r | |
626 | Ip6SendRouterSolicit (\r | |
627 | IN IP6_SERVICE *IpSb,\r | |
628 | IN IP6_INTERFACE *Interface OPTIONAL,\r | |
629 | IN EFI_IPv6_ADDRESS *SourceAddress OPTIONAL,\r | |
630 | IN EFI_IPv6_ADDRESS *DestinationAddress OPTIONAL,\r | |
631 | IN EFI_MAC_ADDRESS *SourceLinkAddress OPTIONAL\r | |
632 | );\r | |
633 | \r | |
634 | /**\r | |
635 | Generate the Neighbor Solicitation message and send it to the Destination Address.\r | |
636 | \r | |
637 | @param[in] IpSb The IP service to send the packet\r | |
638 | @param[in] SourceAddress The source address of the message.\r | |
639 | @param[in] DestinationAddress The destination address of the message.\r | |
640 | @param[in] TargetIp6Address The IP address of the target of the solicitation.\r | |
641 | It must not be a multicast address.\r | |
642 | @param[in] SourceLinkAddress The MAC address for the sender. If not NULL,\r | |
643 | a source link-layer address option will be appended\r | |
644 | to the message.\r | |
645 | \r | |
646 | @retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r | |
647 | @retval EFI_OUT_OF_RESOURCES Insufficient resources to complete the\r | |
648 | operation.\r | |
649 | @retval EFI_SUCCESS The Neighbor Advertise message was successfully sent.\r | |
650 | \r | |
651 | **/\r | |
652 | EFI_STATUS\r | |
653 | Ip6SendNeighborSolicit (\r | |
654 | IN IP6_SERVICE *IpSb,\r | |
655 | IN EFI_IPv6_ADDRESS *SourceAddress,\r | |
656 | IN EFI_IPv6_ADDRESS *DestinationAddress,\r | |
657 | IN EFI_IPv6_ADDRESS *TargetIp6Address,\r | |
658 | IN EFI_MAC_ADDRESS *SourceLinkAddress OPTIONAL\r | |
659 | );\r | |
660 | \r | |
661 | /**\r | |
662 | Set the interface's address. This will trigger the DAD process for the\r | |
663 | address to set. To set an already set address, the lifetimes wil be\r | |
664 | updated to the new value passed in.\r | |
665 | \r | |
666 | @param[in] Interface The interface to set the address.\r | |
667 | @param[in] Ip6Addr The interface's to be assigned IPv6 address.\r | |
668 | @param[in] IsAnycast If TRUE, the unicast IPv6 address is anycast.\r | |
669 | Otherwise, it is not anycast.\r | |
670 | @param[in] PrefixLength The prefix length of the Ip6Addr.\r | |
671 | @param[in] ValidLifetime The valid lifetime for this address.\r | |
672 | @param[in] PreferredLifetime The preferred lifetime for this address.\r | |
673 | @param[in] DadCallback The caller's callback to trigger when DAD finishes.\r | |
674 | This is an optional parameter that may be NULL.\r | |
675 | @param[in] Context The context that will be passed to DadCallback.\r | |
676 | This is an optional parameter that may be NULL.\r | |
677 | \r | |
678 | @retval EFI_SUCCESS The interface is scheduled to be configured with\r | |
679 | the specified address.\r | |
680 | @retval EFI_OUT_OF_RESOURCES Failed to set the interface's address due to\r | |
681 | lack of resources.\r | |
682 | \r | |
683 | **/\r | |
684 | EFI_STATUS\r | |
685 | Ip6SetAddress (\r | |
686 | IN IP6_INTERFACE *Interface,\r | |
687 | IN EFI_IPv6_ADDRESS *Ip6Addr,\r | |
688 | IN BOOLEAN IsAnycast,\r | |
689 | IN UINT8 PrefixLength,\r | |
690 | IN UINT32 ValidLifetime,\r | |
691 | IN UINT32 PreferredLifetime,\r | |
692 | IN IP6_DAD_CALLBACK DadCallback OPTIONAL,\r | |
693 | IN VOID *Context OPTIONAL\r | |
694 | );\r | |
695 | \r | |
696 | /**\r | |
697 | The heartbeat timer of ND module in IP6_TIMER_INTERVAL_IN_MS milliseconds.\r | |
698 | This time routine handles DAD module and neighbor state transition.\r | |
699 | It is also responsible for sending out router solicitations.\r | |
700 | \r | |
701 | @param[in] Event The IP6 service instance's heartbeat timer.\r | |
702 | @param[in] Context The IP6 service instance.\r | |
703 | \r | |
704 | **/\r | |
705 | VOID\r | |
706 | EFIAPI\r | |
707 | Ip6NdFasterTimerTicking (\r | |
708 | IN EFI_EVENT Event,\r | |
709 | IN VOID *Context\r | |
710 | );\r | |
711 | \r | |
712 | /**\r | |
713 | The heartbeat timer of ND module in 1 second. This time routine handles following\r | |
714 | things: 1) maitain default router list; 2) maintain prefix options;\r | |
715 | 3) maintain route caches.\r | |
716 | \r | |
717 | @param[in] IpSb The IP6 service binding instance.\r | |
718 | \r | |
719 | **/\r | |
720 | VOID\r | |
721 | Ip6NdTimerTicking (\r | |
722 | IN IP6_SERVICE *IpSb\r | |
723 | );\r | |
724 | \r | |
725 | /**\r | |
726 | Callback function when address resolution is finished. It will cancel\r | |
727 | all the queued frames if the address resolution failed, or transmit them\r | |
728 | if the request succeeded.\r | |
729 | \r | |
730 | @param[in] Context The context of the callback, a pointer to IP6_NEIGHBOR_ENTRY.\r | |
731 | \r | |
732 | **/\r | |
733 | VOID\r | |
734 | Ip6OnArpResolved (\r | |
735 | IN VOID *Context\r | |
736 | );\r | |
737 | \r | |
738 | /**\r | |
739 | Update the ReachableTime in IP6 service binding instance data, in milliseconds.\r | |
740 | \r | |
741 | @param[in, out] IpSb Points to the IP6_SERVICE.\r | |
742 | \r | |
743 | **/\r | |
744 | VOID\r | |
745 | Ip6UpdateReachableTime (\r | |
746 | IN OUT IP6_SERVICE *IpSb\r | |
747 | );\r | |
748 | \r | |
749 | #endif\r |