TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip6If.h
Go to the documentation of this file.
1
10#ifndef __EFI_IP6_IF_H__
11#define __EFI_IP6_IF_H__
12
13#define IP6_LINK_RX_SIGNATURE SIGNATURE_32 ('I', 'P', '6', 'R')
14#define IP6_LINK_TX_SIGNATURE SIGNATURE_32 ('I', 'P', '6', 'T')
15#define IP6_INTERFACE_SIGNATURE SIGNATURE_32 ('I', 'P', '6', 'I')
16#define IP6_ADDR_INFO_SIGNATURE SIGNATURE_32 ('I', 'P', 'A', 'I')
17
18//
19// This prototype is used by both receive and transmission.
20// When receiving Netbuf is allocated by IP6_INTERFACE, and
21// released by IP6. Flag shows whether the frame is received
22// as unicast/multicast/anycast...
23//
24// When transmitting, the Netbuf is from IP6, and provided
25// to the callback as a reference. Flag isn't used.
26//
27// IpInstance can be NULL which means that it is the IP6 driver
28// itself sending the packets. IP6 driver may send packets that
29// don't belong to any instance, such as ICMP errors, ICMP
30// informational packets. IpInstance is used as a tag in
31// this module.
32//
33typedef
34VOID
35(*IP6_FRAME_CALLBACK) (
36 NET_BUF *Packet,
37 EFI_STATUS IoStatus,
38 UINT32 LinkFlag,
39 VOID *Context
40 );
41
42//
43// Each receive request is wrapped in an IP6_LINK_RX_TOKEN.
44// Upon completion, the Callback will be called. Only one
45// receive request is send to MNP. IpInstance is always NULL.
46// Reference MNP's spec for information.
47//
48typedef struct {
49 UINT32 Signature;
50 IP6_FRAME_CALLBACK CallBack;
51 VOID *Context;
54
55//
56// Each transmit request is wrapped in an IP6_LINK_TX_TOKEN.
57// Upon completion, the Callback will be called.
58//
59typedef struct {
60 UINT32 Signature;
61 LIST_ENTRY Link;
62
63 IP6_PROTOCOL *IpInstance;
64 IP6_FRAME_CALLBACK CallBack;
65 NET_BUF *Packet;
66 VOID *Context;
67
68 EFI_MAC_ADDRESS DstMac;
69 EFI_MAC_ADDRESS SrcMac;
70
74
76 UINT32 Signature;
77 LIST_ENTRY Link;
78 EFI_IPv6_ADDRESS Address;
79 BOOLEAN IsAnycast;
80 UINT8 PrefixLength;
81 UINT32 ValidLifetime;
82 UINT32 PreferredLifetime;
83};
84
85//
86// Callback to select which frame to cancel. Caller can cancel a
87// single frame, or all the frame from an IP instance.
88//
89typedef
90BOOLEAN
91(*IP6_FRAME_TO_CANCEL) (
92 IP6_LINK_TX_TOKEN *Frame,
93 VOID *Context
94 );
95
97 UINT32 Signature;
98 LIST_ENTRY Link;
99 INTN RefCnt;
100
101 //
102 // IP address and prefix length of the interface. The fileds
103 // are invalid if (Configured == FALSE)
104 //
105 LIST_ENTRY AddressList;
106 UINT32 AddressCount;
107 BOOLEAN Configured;
108
109 IP6_SERVICE *Service;
110
111 EFI_HANDLE Controller;
112 EFI_HANDLE Image;
113
114 //
115 // Queues to keep the frames sent and waiting ARP request.
116 //
117 LIST_ENTRY ArpQues;
118 LIST_ENTRY SentFrames;
119
120 //
121 // The interface's configuration variables
122 //
123 UINT32 DupAddrDetect;
124 LIST_ENTRY DupAddrDetectList;
125 LIST_ENTRY DelayJoinList;
126
127 //
128 // All the IP instances that have the same IP/SubnetMask are linked
129 // together through IpInstances. If any of the instance enables
130 // promiscuous receive, PromiscRecv is true.
131 //
132 LIST_ENTRY IpInstances;
133 BOOLEAN PromiscRecv;
134};
135
148 IN IP6_SERVICE *IpSb,
149 IN BOOLEAN LinkLocal
150 );
151
164VOID
166 IN IP6_INTERFACE *Interface,
167 IN IP6_PROTOCOL *IpInstance OPTIONAL
168 );
169
177VOID
179 IN IP6_LINK_TX_TOKEN *Token
180 );
181
189VOID
190EFIAPI
192 IN EFI_EVENT Event,
193 IN VOID *Context
194 );
195
209 IN IP6_FRAME_CALLBACK CallBack,
210 IN IP6_SERVICE *IpSb
211 );
212
235 IN IP6_INTERFACE *Interface,
236 IN IP6_PROTOCOL *IpInstance OPTIONAL,
237 IN NET_BUF *Packet,
238 IN EFI_IPv6_ADDRESS *NextHop,
239 IN IP6_FRAME_CALLBACK CallBack,
240 IN VOID *Context
241 );
242
252VOID
253EFIAPI
255 IN EFI_EVENT Event,
256 IN VOID *Context
257 );
258
259#endif
INT64 INTN
EFI_STATUS Ip6ReceiveFrame(IN IP6_FRAME_CALLBACK CallBack, IN IP6_SERVICE *IpSb)
Definition: Ip6If.c:561
IP6_INTERFACE * Ip6CreateInterface(IN IP6_SERVICE *IpSb, IN BOOLEAN LinkLocal)
Definition: Ip6If.c:206
VOID EFIAPI Ip6TimerTicking(IN EFI_EVENT Event, IN VOID *Context)
Definition: Ip6If.c:785
EFI_STATUS Ip6SendFrame(IN IP6_INTERFACE *Interface, IN IP6_PROTOCOL *IpInstance OPTIONAL, IN NET_BUF *Packet, IN EFI_IPv6_ADDRESS *NextHop, IN IP6_FRAME_CALLBACK CallBack, IN VOID *Context)
Definition: Ip6If.c:654
VOID Ip6CleanInterface(IN IP6_INTERFACE *Interface, IN IP6_PROTOCOL *IpInstance OPTIONAL)
Definition: Ip6If.c:297
VOID EFIAPI Ip6OnFrameReceived(IN EFI_EVENT Event, IN VOID *Context)
Definition: Ip6If.c:538
VOID Ip6FreeLinkTxToken(IN IP6_LINK_TX_TOKEN *Token)
Definition: Ip6If.c:432
#define IN
Definition: Base.h:279
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33