TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip6Nd.h
Go to the documentation of this file.
1
10#ifndef __EFI_IP6_ND_H__
11#define __EFI_IP6_ND_H__
12
13#define IP6_GET_TICKS(Ms) (((Ms) + IP6_TIMER_INTERVAL_IN_MS - 1) / IP6_TIMER_INTERVAL_IN_MS)
14
15enum {
16 IP6_INF_ROUTER_LIFETIME = 0xFFFF,
17
19 IP6_MAX_RTR_SOLICITATIONS = 3,
20 IP6_RTR_SOLICITATION_INTERVAL = 4000,
21
22 IP6_MIN_RANDOM_FACTOR_SCALED = 1,
23 IP6_MAX_RANDOM_FACTOR_SCALED = 3,
24 IP6_RANDOM_FACTOR_SCALE = 2,
25
26 IP6_MAX_MULTICAST_SOLICIT = 3,
27 IP6_MAX_UNICAST_SOLICIT = 3,
28 IP6_MAX_ANYCAST_DELAY_TIME = 1,
29 IP6_MAX_NEIGHBOR_ADV = 3,
30 IP6_REACHABLE_TIME = 30000,
31 IP6_RETRANS_TIMER = 1000,
32 IP6_DELAY_FIRST_PROBE_TIME = 5000,
33
34 IP6_MIN_LINK_MTU = 1280,
35 IP6_MAX_LINK_MTU = 1500,
36
37 IP6_IS_ROUTER_FLAG = 0x80,
38 IP6_SOLICITED_FLAG = 0x40,
39 IP6_OVERRIDE_FLAG = 0x20,
40
41 IP6_M_ADDR_CONFIG_FLAG = 0x80,
42 IP6_O_CONFIG_FLAG = 0x40,
43
44 IP6_ON_LINK_FLAG = 0x80,
45 IP6_AUTO_CONFIG_FLAG = 0x40,
46
47 IP6_ND_LENGTH = 24,
48 IP6_RA_LENGTH = 16,
49 IP6_REDITECT_LENGTH = 40,
50 IP6_DAD_ENTRY_SIGNATURE = SIGNATURE_32 ('I', 'P', 'D', 'E')
51};
52
53typedef
54VOID
55(*IP6_ARP_CALLBACK) (
56 VOID *Context
57 );
58
59//
60// Per RFC8200 Section 4.2
61//
62// Two of the currently-defined extension headers -- the Hop-by-Hop
63// Options header and the Destination Options header -- carry a variable
64// number of type-length-value (TLV) encoded "options", of the following
65// format:
66//
67// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
68// | Option Type | Opt Data Len | Option Data
69// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
70//
71// Option Type 8-bit identifier of the type of option.
72//
73// Opt Data Len 8-bit unsigned integer. Length of the Option
74// Data field of this option, in octets.
75//
76// Option Data Variable-length field. Option-Type-specific
77// data.
78//
79typedef struct _IP6_OPTION_HEADER {
83 UINT8 Type;
87 UINT8 Length;
92
93STATIC_ASSERT (sizeof (IP6_OPTION_HEADER) == 2, "IP6_OPTION_HEADER is expected to be exactly 2 bytes long.");
94
95#define IP6_NEXT_OPTION_OFFSET(offset, length) (offset + sizeof(IP6_OPTION_HEADER) + length)
97 IP6_NEXT_OPTION_OFFSET (0, 0) == 2,
98 "The next option is minimally the combined size of the option tag and length"
99 );
100
101typedef struct _IP6_ETHE_ADDR_OPTION {
102 UINT8 Type;
103 UINT8 Length;
104 UINT8 EtherAddr[6];
106
107STATIC_ASSERT (sizeof (IP6_ETHER_ADDR_OPTION) == 8, "IP6_ETHER_ADDR_OPTION is expected to be exactly 8 bytes long.");
108
109typedef struct _IP6_MTU_OPTION {
110 UINT8 Type;
111 UINT8 Length;
112 UINT16 Reserved;
113 UINT32 Mtu;
115
116STATIC_ASSERT (sizeof (IP6_MTU_OPTION) == 8, "IP6_MTU_OPTION is expected to be exactly 8 bytes long.");
117
119 UINT8 Type;
120 UINT8 Length;
121 UINT8 PrefixLength;
122 UINT8 Reserved1;
123 UINT32 ValidLifetime;
124 UINT32 PreferredLifetime;
125 UINT32 Reserved2;
126 EFI_IPv6_ADDRESS Prefix;
128
129STATIC_ASSERT (sizeof (IP6_PREFIX_INFO_OPTION) == 32, "IP6_PREFIX_INFO_OPTION is expected to be exactly 32 bytes long.");
130
131typedef
132VOID
133(*IP6_DAD_CALLBACK) (
134 IN BOOLEAN IsDadPassed,
135 IN EFI_IPv6_ADDRESS *TargetAddress,
136 IN VOID *Context
137 );
138
139typedef struct _IP6_DAD_ENTRY {
140 UINT32 Signature;
141 LIST_ENTRY Link;
142 UINT32 MaxTransmit;
143 UINT32 Transmit;
144 UINT32 Receive;
145 UINT32 RetransTick;
146 IP6_ADDRESS_INFO *AddressInfo;
147 EFI_IPv6_ADDRESS Destination;
148 IP6_DAD_CALLBACK Callback;
149 VOID *Context;
151
152typedef struct _IP6_DELAY_JOIN_LIST {
153 LIST_ENTRY Link;
154 UINT32 DelayTime;
155 IP6_INTERFACE *Interface;
156 IP6_ADDRESS_INFO *AddressInfo;
157 IP6_DAD_CALLBACK DadCallback;
158 VOID *Context;
160
161typedef struct _IP6_NEIGHBOR_ENTRY {
162 LIST_ENTRY Link;
163 LIST_ENTRY ArpList;
164 INTN RefCnt;
165 BOOLEAN IsRouter;
166 BOOLEAN ArpFree;
167 BOOLEAN Dynamic;
168 EFI_IPv6_ADDRESS Neighbor;
169 EFI_MAC_ADDRESS LinkAddress;
171 UINT32 Transmit;
172 UINT32 Ticks;
173
174 LIST_ENTRY Frames;
175 IP6_INTERFACE *Interface;
176 IP6_ARP_CALLBACK CallBack;
178
179typedef struct _IP6_DEFAULT_ROUTER {
180 LIST_ENTRY Link;
181 INTN RefCnt;
182 UINT16 Lifetime;
183 EFI_IPv6_ADDRESS Router;
184 IP6_NEIGHBOR_ENTRY *NeighborCache;
186
188 LIST_ENTRY Link;
189 INTN RefCnt;
190 UINT32 ValidLifetime;
191 UINT32 PreferredLifetime;
192 UINT8 PrefixLength;
193 EFI_IPv6_ADDRESS Prefix;
195
210 IN IP6_PROTOCOL *IpInstance,
211 OUT UINT32 *NeighborCount,
212 OUT EFI_IP6_NEIGHBOR_CACHE **NeighborCache
213 );
214
229 IN IP6_PROTOCOL *IpInstance,
230 OUT UINT32 *PrefixCount,
231 OUT EFI_IP6_ADDRESS_INFO **PrefixTable
232 );
233
248 IN IP6_SERVICE *IpSb,
249 IN EFI_IPv6_ADDRESS *Ip6Address,
250 IN UINT16 RouterLifetime
251 );
252
260VOID
262 IN IP6_SERVICE *IpSb,
263 IN IP6_DEFAULT_ROUTER *DefaultRouter
264 );
265
272VOID
274 IN IP6_SERVICE *IpSb
275 );
276
289 IN IP6_SERVICE *IpSb,
290 IN EFI_IPv6_ADDRESS *Ip6Address
291 );
292
301VOID
303 IN BOOLEAN IsDadPassed,
304 IN IP6_INTERFACE *IpIf,
305 IN IP6_DAD_ENTRY *DadEntry
306 );
307
327 IN IP6_INTERFACE *IpIf,
328 IN IP6_ADDRESS_INFO *AddressInfo,
329 IN IP6_DAD_CALLBACK Callback OPTIONAL,
330 IN VOID *Context OPTIONAL
331 );
332
347 IN IP6_SERVICE *IpSb,
348 IN EFI_IPv6_ADDRESS *Target,
349 OUT IP6_INTERFACE **Interface OPTIONAL
350 );
351
372 IN IP6_SERVICE *IpSb,
373 IN BOOLEAN OnLinkOrAuto,
374 IN UINT32 ValidLifetime,
375 IN UINT32 PreferredLifetime,
376 IN UINT8 PrefixLength,
377 IN EFI_IPv6_ADDRESS *Prefix
378 );
379
392VOID
394 IN IP6_SERVICE *IpSb,
395 IN IP6_PREFIX_LIST_ENTRY *PrefixEntry,
396 IN BOOLEAN OnLinkOrAuto,
397 IN BOOLEAN ImmediateDelete
398 );
399
415 IN IP6_SERVICE *IpSb,
416 IN BOOLEAN OnLinkOrAuto,
417 IN UINT8 PrefixLength,
418 IN EFI_IPv6_ADDRESS *Prefix
419 );
420
429VOID
431 IN IP6_SERVICE *IpSb,
432 IN LIST_ENTRY *ListHead
433 );
434
451 IN IP6_SERVICE *IpSb,
452 IN IP6_ARP_CALLBACK CallBack,
453 IN EFI_IPv6_ADDRESS *Ip6Address,
454 IN EFI_MAC_ADDRESS *LinkAddress OPTIONAL
455 );
456
469 IN IP6_SERVICE *IpSb,
470 IN EFI_IPv6_ADDRESS *Ip6Address
471 );
472
496 IN IP6_SERVICE *IpSb,
497 IN IP6_NEIGHBOR_ENTRY *NeighborCache,
498 IN BOOLEAN SendIcmpError,
499 IN BOOLEAN FullFree,
500 IN EFI_STATUS IoStatus,
501 IN IP6_FRAME_TO_CANCEL FrameToCancel OPTIONAL,
502 IN VOID *Context OPTIONAL
503 );
504
531 IN IP6_SERVICE *IpSb,
532 IN EFI_IPv6_ADDRESS *TargetIp6Address,
533 IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL,
534 IN UINT32 Timeout,
535 IN BOOLEAN Override
536 );
537
559 IN IP6_SERVICE *IpSb,
560 IN EFI_IPv6_ADDRESS *TargetIp6Address,
561 IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL,
562 IN UINT32 Timeout,
563 IN BOOLEAN Override
564 );
565
582 IN IP6_SERVICE *IpSb,
583 IN EFI_IP6_HEADER *Head,
584 IN NET_BUF *Packet
585 );
586
602 IN IP6_SERVICE *IpSb,
603 IN EFI_IP6_HEADER *Head,
604 IN NET_BUF *Packet
605 );
606
622 IN IP6_SERVICE *IpSb,
623 IN EFI_IP6_HEADER *Head,
624 IN NET_BUF *Packet
625 );
626
645 IN IP6_SERVICE *IpSb,
646 IN EFI_IP6_HEADER *Head,
647 IN NET_BUF *Packet
648 );
649
669 IN IP6_SERVICE *IpSb,
670 IN IP6_INTERFACE *Interface OPTIONAL,
671 IN EFI_IPv6_ADDRESS *SourceAddress OPTIONAL,
672 IN EFI_IPv6_ADDRESS *DestinationAddress OPTIONAL,
673 IN EFI_MAC_ADDRESS *SourceLinkAddress OPTIONAL
674 );
675
696 IN IP6_SERVICE *IpSb,
697 IN EFI_IPv6_ADDRESS *SourceAddress,
698 IN EFI_IPv6_ADDRESS *DestinationAddress,
699 IN EFI_IPv6_ADDRESS *TargetIp6Address,
700 IN EFI_MAC_ADDRESS *SourceLinkAddress OPTIONAL
701 );
702
728 IN IP6_INTERFACE *Interface,
729 IN EFI_IPv6_ADDRESS *Ip6Addr,
730 IN BOOLEAN IsAnycast,
731 IN UINT8 PrefixLength,
732 IN UINT32 ValidLifetime,
733 IN UINT32 PreferredLifetime,
734 IN IP6_DAD_CALLBACK DadCallback OPTIONAL,
735 IN VOID *Context OPTIONAL
736 );
737
747VOID
748EFIAPI
750 IN EFI_EVENT Event,
751 IN VOID *Context
752 );
753
762VOID
764 IN IP6_SERVICE *IpSb
765 );
766
775VOID
777 IN VOID *Context
778 );
779
788 IN OUT IP6_SERVICE *IpSb
789 );
790
791#endif
INT64 INTN
EFI_IP6_NEIGHBOR_STATE
Definition: Ip6.h:249
IP6_DEFAULT_ROUTER * Ip6CreateDefaultRouter(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Ip6Address, IN UINT16 RouterLifetime)
Definition: Ip6Nd.c:691
EFI_STATUS Ip6ProcessRedirect(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
Definition: Ip6Nd.c:2416
VOID Ip6DestroyDefaultRouter(IN IP6_SERVICE *IpSb, IN IP6_DEFAULT_ROUTER *DefaultRouter)
Definition: Ip6Nd.c:738
EFI_STATUS Ip6SetAddress(IN IP6_INTERFACE *Interface, IN EFI_IPv6_ADDRESS *Ip6Addr, IN BOOLEAN IsAnycast, IN UINT8 PrefixLength, IN UINT32 ValidLifetime, IN UINT32 PreferredLifetime, IN IP6_DAD_CALLBACK DadCallback OPTIONAL, IN VOID *Context OPTIONAL)
Definition: Ip6If.c:75
VOID Ip6OnDADFinished(IN BOOLEAN IsDadPassed, IN IP6_INTERFACE *IpIf, IN IP6_DAD_ENTRY *DadEntry)
Definition: Ip6Nd.c:818
IP6_PREFIX_LIST_ENTRY * Ip6FindPrefixListEntry(IN IP6_SERVICE *IpSb, IN BOOLEAN OnLinkOrAuto, IN UINT8 PrefixLength, IN EFI_IPv6_ADDRESS *Prefix)
Definition: Ip6Nd.c:337
VOID Ip6CleanDefaultRouterList(IN IP6_SERVICE *IpSb)
Definition: Ip6Nd.c:765
@ IP6_MAX_RTR_SOLICITATION_DELAY
1000 milliseconds
Definition: Ip6Nd.h:18
EFI_STATUS Ip6SendNeighborSolicit(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *SourceAddress, IN EFI_IPv6_ADDRESS *DestinationAddress, IN EFI_IPv6_ADDRESS *TargetIp6Address, IN EFI_MAC_ADDRESS *SourceLinkAddress OPTIONAL)
Definition: Ip6Nd.c:1340
VOID Ip6CleanPrefixListTable(IN IP6_SERVICE *IpSb, IN LIST_ENTRY *ListHead)
Definition: Ip6Nd.c:391
EFI_STATUS Ip6UpdateReachableTime(IN OUT IP6_SERVICE *IpSb)
Definition: Ip6Nd.c:23
VOID Ip6DestroyPrefixListEntry(IN IP6_SERVICE *IpSb, IN IP6_PREFIX_LIST_ENTRY *PrefixEntry, IN BOOLEAN OnLinkOrAuto, IN BOOLEAN ImmediateDelete)
Definition: Ip6Nd.c:281
EFI_STATUS Ip6SendRouterSolicit(IN IP6_SERVICE *IpSb, IN IP6_INTERFACE *Interface OPTIONAL, IN EFI_IPv6_ADDRESS *SourceAddress OPTIONAL, IN EFI_IPv6_ADDRESS *DestinationAddress OPTIONAL, IN EFI_MAC_ADDRESS *SourceLinkAddress OPTIONAL)
Definition: Ip6Nd.c:1114
IP6_DEFAULT_ROUTER * Ip6FindDefaultRouter(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Ip6Address)
Definition: Ip6Nd.c:788
IP6_DAD_ENTRY * Ip6FindDADEntry(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Target, OUT IP6_INTERFACE **Interface OPTIONAL)
Definition: Ip6Nd.c:1064
EFI_STATUS Ip6AddNeighbor(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *TargetIp6Address, IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL, IN UINT32 Timeout, IN BOOLEAN Override)
Definition: Ip6Nd.c:2703
EFI_STATUS Ip6ProcessNeighborAdvertise(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
Definition: Ip6Nd.c:1708
VOID Ip6OnArpResolved(IN VOID *Context)
Definition: Ip6Nd.c:416
EFI_STATUS Ip6InitDADProcess(IN IP6_INTERFACE *IpIf, IN IP6_ADDRESS_INFO *AddressInfo, IN IP6_DAD_CALLBACK Callback OPTIONAL, IN VOID *Context OPTIONAL)
Definition: Ip6Nd.c:974
EFI_STATUS Ip6DelNeighbor(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *TargetIp6Address, IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL, IN UINT32 Timeout, IN BOOLEAN Override)
Definition: Ip6Nd.c:2765
EFI_STATUS Ip6ProcessNeighborSolicit(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
Definition: Ip6Nd.c:1476
VOID Ip6NdTimerTicking(IN IP6_SERVICE *IpSb)
Definition: Ip6Nd.c:3124
VOID EFIAPI Ip6NdFasterTimerTicking(IN EFI_EVENT Event, IN VOID *Context)
Definition: Ip6Nd.c:2797
EFI_STATUS Ip6BuildPrefixTable(IN IP6_PROTOCOL *IpInstance, OUT UINT32 *PrefixCount, OUT EFI_IP6_ADDRESS_INFO **PrefixTable)
Definition: Ip6Nd.c:122
EFI_STATUS Ip6ProcessRouterAdvertise(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
Definition: Ip6Nd.c:1943
IP6_PREFIX_LIST_ENTRY * Ip6CreatePrefixListEntry(IN IP6_SERVICE *IpSb, IN BOOLEAN OnLinkOrAuto, IN UINT32 ValidLifetime, IN UINT32 PreferredLifetime, IN UINT8 PrefixLength, IN EFI_IPv6_ADDRESS *Prefix)
Definition: Ip6Nd.c:191
IP6_NEIGHBOR_ENTRY * Ip6CreateNeighborEntry(IN IP6_SERVICE *IpSb, IN IP6_ARP_CALLBACK CallBack, IN EFI_IPv6_ADDRESS *Ip6Address, IN EFI_MAC_ADDRESS *LinkAddress OPTIONAL)
Definition: Ip6Nd.c:505
EFI_STATUS Ip6FreeNeighborEntry(IN IP6_SERVICE *IpSb, IN IP6_NEIGHBOR_ENTRY *NeighborCache, IN BOOLEAN SendIcmpError, IN BOOLEAN FullFree, IN EFI_STATUS IoStatus, IN IP6_FRAME_TO_CANCEL FrameToCancel OPTIONAL, IN VOID *Context OPTIONAL)
Definition: Ip6Nd.c:613
EFI_STATUS Ip6BuildEfiNeighborCache(IN IP6_PROTOCOL *IpInstance, OUT UINT32 *NeighborCount, OUT EFI_IP6_NEIGHBOR_CACHE **NeighborCache)
Definition: Ip6Nd.c:56
IP6_NEIGHBOR_ENTRY * Ip6FindNeighborEntry(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Ip6Address)
Definition: Ip6Nd.c:566
#define STATIC_ASSERT
Definition: Base.h:808
#define IN
Definition: Base.h:279
#define SIGNATURE_32(A, B, C, D)
Definition: Base.h:1310
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
UINT32 DelayTime
in tick per 50 milliseconds
Definition: Ip6Nd.h:154
UINT8 Length
Definition: Ip6Nd.h:87