TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip6Common.h
Go to the documentation of this file.
1
10#ifndef __EFI_IP6_COMMON_H__
11#define __EFI_IP6_COMMON_H__
12
13#define IP6_LINK_EQUAL(Mac1, Mac2) (CompareMem ((Mac1), (Mac2), sizeof (EFI_MAC_ADDRESS)) == 0)
14
15//
16// Convert the Microsecond to second. IP transmit/receive time is
17// in the unit of microsecond. IP ticks once per second.
18//
19#define IP6_US_TO_SEC(Us) (((Us) + 999999) / 1000000)
20
21#define IP6_ETHER_PROTO 0x86DD
22
23#define IP6_MAC_LEN 6
24#define IP6_IF_ID_LEN 8
25
26#define IP6_INTERFACE_LOCAL_SCOPE 1
27#define IP6_LINK_LOCAL_SCOPE 2
28#define IP6_SITE_LOCAL_SCOPE 5
29
30#define IP6_INFINIT_LIFETIME 0xFFFFFFFF
31
32#define IP6_HOP_LIMIT 255
33//
34// Make it to 64 since all 54 bits are zero.
35//
36#define IP6_LINK_LOCAL_PREFIX_LENGTH 64
37
38#define IP6_TIMER_INTERVAL_IN_MS 100
39#define IP6_ONE_SECOND_IN_MS 1000
40
41//
42// The packet is received as link level broadcast/multicast/promiscuous.
43//
44#define IP6_LINK_BROADCAST 0x00000001
45#define IP6_LINK_MULTICAST 0x00000002
46#define IP6_LINK_PROMISC 0x00000004
47
48#define IP6_U_BIT 0x02
49
50typedef enum {
51 Ip6Promiscuous = 1,
52 Ip6Unicast,
53 Ip6Multicast,
54 Ip6AnyCast
55} IP6_ADDRESS_TYPE;
56
57typedef struct {
58 EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;
59 EFI_IPv6_ADDRESS *Address;
61
62typedef struct _IP6_INTERFACE IP6_INTERFACE;
63typedef struct _IP6_PROTOCOL IP6_PROTOCOL;
64typedef struct _IP6_SERVICE IP6_SERVICE;
66
85 IN IP6_SERVICE *IpSb,
86 OUT UINT32 *AddressCount,
87 OUT EFI_IP6_ADDRESS_INFO **AddressList OPTIONAL
88 );
89
108 IN BOOLEAN Router,
109 IN UINT8 Scope,
110 OUT EFI_IPv6_ADDRESS *Ip6Addr
111 );
112
124UINT8 *
126 IN OUT IP6_SERVICE *IpSb
127 );
128
143 IN OUT IP6_SERVICE *IpSb
144 );
145
156VOID
158 IN EFI_IPv6_ADDRESS *Ip6Addr,
159 OUT EFI_IPv6_ADDRESS *MulticastAddr
160 );
161
171BOOLEAN
174 );
175
191BOOLEAN
193 IN IP6_SERVICE *IpSb,
194 IN EFI_IPv6_ADDRESS *Address,
195 OUT IP6_INTERFACE **Interface OPTIONAL,
196 OUT IP6_ADDRESS_INFO **AddressInfo OPTIONAL
197 );
198
209BOOLEAN
211 IN IP6_SERVICE *IpSb,
212 IN EFI_MAC_ADDRESS *LinkAddress
213 );
214
223VOID
225 OUT EFI_IPv6_ADDRESS *Dest,
226 IN EFI_IPv6_ADDRESS *Src,
227 IN UINT8 PrefixLength
228 );
229
237VOID
239 IN OUT IP6_INTERFACE *IpIf,
240 IN IP6_ADDRESS_INFO *AddrInfo
241 );
242
268 IN IP6_SERVICE *IpSb OPTIONAL,
269 IN OUT LIST_ENTRY *AddressList,
270 IN OUT UINT32 *AddressCount,
271 IN EFI_IPv6_ADDRESS *Prefix OPTIONAL,
272 IN UINT8 PrefixLength
273 );
274
292 IN EFI_IPv6_ADDRESS *Multicast,
294 );
295
308 IN OUT EFI_IP6_HEADER *Head
309 );
310
311#endif
VOID Ip6CreateSNMulticastAddr(IN EFI_IPv6_ADDRESS *Ip6Addr, OUT EFI_IPv6_ADDRESS *MulticastAddr)
Definition: Ip6Common.c:291
EFI_STATUS Ip6GetMulticastMac(IN EFI_MANAGED_NETWORK_PROTOCOL *Mnp, IN EFI_IPv6_ADDRESS *Multicast, OUT EFI_MAC_ADDRESS *Mac)
Definition: Ip6Common.c:635
EFI_STATUS Ip6SetToAllNodeMulticast(IN BOOLEAN Router, IN UINT8 Scope, OUT EFI_IPv6_ADDRESS *Ip6Addr)
Definition: Ip6Common.c:103
EFI_IP6_HEADER * Ip6NtohHead(IN OUT EFI_IP6_HEADER *Head)
Definition: Ip6Common.c:659
BOOLEAN Ip6IsSNMulticastAddr(IN EFI_IPv6_ADDRESS *Ip6)
Definition: Ip6Common.c:471
EFI_STATUS Ip6RemoveAddr(IN IP6_SERVICE *IpSb OPTIONAL, IN OUT LIST_ENTRY *AddressList, IN OUT UINT32 *AddressCount, IN EFI_IPv6_ADDRESS *Prefix OPTIONAL, IN UINT8 PrefixLength)
Definition: Ip6Common.c:411
VOID Ip6AddAddr(IN OUT IP6_INTERFACE *IpIf, IN IP6_ADDRESS_INFO *AddrInfo)
Definition: Ip6Common.c:316
BOOLEAN Ip6IsOneOfSetAddress(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Address, OUT IP6_INTERFACE **Interface OPTIONAL, OUT IP6_ADDRESS_INFO **AddressInfo OPTIONAL)
Definition: Ip6Common.c:504
UINT8 * Ip6CreateInterfaceID(IN OUT IP6_SERVICE *IpSb)
Definition: Ip6Common.c:142
BOOLEAN Ip6IsValidLinkAddress(IN IP6_SERVICE *IpSb, IN EFI_MAC_ADDRESS *LinkAddress)
Definition: Ip6Common.c:565
EFI_IPv6_ADDRESS * Ip6CreateLinkLocalAddr(IN OUT IP6_SERVICE *IpSb)
Definition: Ip6Common.c:200
EFI_STATUS Ip6BuildEfiAddressList(IN IP6_SERVICE *IpSb, OUT UINT32 *AddressCount, OUT EFI_IP6_ADDRESS_INFO **AddressList OPTIONAL)
Definition: Ip6Common.c:29
VOID Ip6CopyAddressByPrefix(OUT EFI_IPv6_ADDRESS *Dest, IN EFI_IPv6_ADDRESS *Src, IN UINT8 PrefixLength)
Definition: Ip6Common.c:593
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29