TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip4If.h
Go to the documentation of this file.
1
9#ifndef __EFI_IP4_IF_H__
10#define __EFI_IP4_IF_H__
11
12#define IP4_FRAME_RX_SIGNATURE SIGNATURE_32 ('I', 'P', 'F', 'R')
13#define IP4_FRAME_TX_SIGNATURE SIGNATURE_32 ('I', 'P', 'F', 'T')
14#define IP4_FRAME_ARP_SIGNATURE SIGNATURE_32 ('I', 'P', 'F', 'A')
15#define IP4_INTERFACE_SIGNATURE SIGNATURE_32 ('I', 'P', 'I', 'F')
16
40typedef
41VOID
43 IN IP4_PROTOCOL *IpInstance OPTIONAL,
44 IN NET_BUF *Packet,
45 IN EFI_STATUS IoStatus,
46 IN UINT32 LinkFlag,
47 IN VOID *Context
48 );
49
56typedef struct {
57 UINT32 Signature;
58 IP4_INTERFACE *Interface;
59
60 IP4_PROTOCOL *IpInstance;
61 IP4_FRAME_CALLBACK CallBack;
62 VOID *Context;
63
66
71typedef struct {
72 UINT32 Signature;
73 LIST_ENTRY Link;
74
75 IP4_INTERFACE *Interface;
76 IP4_SERVICE *IpSb;
77
78 IP4_PROTOCOL *IpInstance;
79 IP4_FRAME_CALLBACK CallBack;
80 NET_BUF *Packet;
81 VOID *Context;
82
83 EFI_MAC_ADDRESS DstMac;
84 EFI_MAC_ADDRESS SrcMac;
85
89
96typedef struct {
97 UINT32 Signature;
98 LIST_ENTRY Link;
99
100 LIST_ENTRY Frames;
101 IP4_INTERFACE *Interface;
102
103 //
104 // ARP requesting staffs
105 //
106 EFI_EVENT OnResolved;
107 IP4_ADDR Ip;
108 EFI_MAC_ADDRESS Mac;
110
121typedef
122BOOLEAN
124 IP4_LINK_TX_TOKEN *Frame,
125 VOID *Context
126 );
127
128//
129// Each IP4 instance has its own station address. All the instances
130// with the same station address share a single interface structure.
131// Each interface has its own ARP child, and shares one MNP child.
132// Notice the special cases that DHCP can configure the interface
133// with 0.0.0.0/0.0.0.0.
134//
136 UINT32 Signature;
137 LIST_ENTRY Link;
138 INTN RefCnt;
139
140 //
141 // IP address and subnet mask of the interface. It also contains
142 // the subnet/net broadcast address for quick access. The fields
143 // are invalid if (Configured == FALSE)
144 //
145 IP4_ADDR Ip;
146 IP4_ADDR SubnetMask;
147 IP4_ADDR SubnetBrdcast;
148 IP4_ADDR NetBrdcast;
149 BOOLEAN Configured;
150
151 //
152 // Handle used to create/destroy ARP child. All the IP children
153 // share one MNP which is owned by IP service binding.
154 //
155 EFI_HANDLE Controller;
156 EFI_HANDLE Image;
157
159 EFI_ARP_PROTOCOL *Arp;
160 EFI_HANDLE ArpHandle;
161
162 //
163 // Queues to keep the frames sent and waiting ARP request.
164 //
165 LIST_ENTRY ArpQues;
166 LIST_ENTRY SentFrames;
167 IP4_LINK_RX_TOKEN *RecvRequest;
168
169 //
170 // The interface's MAC and broadcast MAC address.
171 //
172 EFI_MAC_ADDRESS Mac;
173 EFI_MAC_ADDRESS BroadcastMac;
174 UINT32 HwaddrLen;
175
176 //
177 // All the IP instances that have the same IP/SubnetMask are linked
178 // together through IpInstances. If any of the instance enables
179 // promiscuous receive, PromiscRecv is true.
180 //
181 LIST_ENTRY IpInstances;
182 BOOLEAN PromiscRecv;
183};
184
201 IN EFI_HANDLE Controller,
202 IN EFI_HANDLE ImageHandle
203 );
204
220 IN OUT IP4_INTERFACE *Interface,
221 IN IP4_ADDR IpAddr,
222 IN IP4_ADDR SubnetMask
223 );
224
241 IN IP4_INTERFACE *Interface,
242 IN IP4_PROTOCOL *IpInstance OPTIONAL
243 );
244
270 IN IP4_INTERFACE *Interface,
271 IN IP4_PROTOCOL *IpInstance OPTIONAL,
272 IN NET_BUF *Packet,
273 IN IP4_ADDR NextHop,
274 IN IP4_FRAME_CALLBACK CallBack,
275 IN VOID *Context,
276 IN IP4_SERVICE *IpSb
277 );
278
292VOID
294 IN IP4_INTERFACE *Interface,
295 IN EFI_STATUS IoStatus,
296 IN IP4_FRAME_TO_CANCEL FrameToCancel OPTIONAL,
297 IN VOID *Context
298 );
299
312VOID
314 IN IP4_INTERFACE *Interface
315 );
316
334 IN IP4_INTERFACE *Interface,
335 IN IP4_PROTOCOL *IpInstance OPTIONAL,
336 IN IP4_FRAME_CALLBACK CallBack,
337 IN VOID *Context
338 );
339
340#endif
INT64 INTN
EFI_STATUS Ip4FreeInterface(IN IP4_INTERFACE *Interface, IN IP4_PROTOCOL *IpInstance OPTIONAL)
Definition: Ip4If.c:731
VOID(* IP4_FRAME_CALLBACK)(IN IP4_PROTOCOL *IpInstance OPTIONAL, IN NET_BUF *Packet, IN EFI_STATUS IoStatus, IN UINT32 LinkFlag, IN VOID *Context)
Definition: Ip4If.h:42
BOOLEAN(* IP4_FRAME_TO_CANCEL)(IP4_LINK_TX_TOKEN *Frame, VOID *Context)
Definition: Ip4If.h:123
EFI_STATUS Ip4ReceiveFrame(IN IP4_INTERFACE *Interface, IN IP4_PROTOCOL *IpInstance OPTIONAL, IN IP4_FRAME_CALLBACK CallBack, IN VOID *Context)
Definition: Ip4If.c:1303
IP4_INTERFACE * Ip4CreateInterface(IN EFI_MANAGED_NETWORK_PROTOCOL *Mnp, IN EFI_HANDLE Controller, IN EFI_HANDLE ImageHandle)
Definition: Ip4If.c:477
EFI_STATUS Ip4SetAddress(IN OUT IP4_INTERFACE *Interface, IN IP4_ADDR IpAddr, IN IP4_ADDR SubnetMask)
Definition: Ip4If.c:547
EFI_STATUS Ip4SendFrame(IN IP4_INTERFACE *Interface, IN IP4_PROTOCOL *IpInstance OPTIONAL, IN NET_BUF *Packet, IN IP4_ADDR NextHop, IN IP4_FRAME_CALLBACK CallBack, IN VOID *Context, IN IP4_SERVICE *IpSb)
Definition: Ip4If.c:1052
VOID Ip4CancelFrames(IN IP4_INTERFACE *Interface, IN EFI_STATUS IoStatus, IN IP4_FRAME_TO_CANCEL FrameToCancel OPTIONAL, IN VOID *Context)
Definition: Ip4If.c:425
VOID Ip4CancelReceive(IN IP4_INTERFACE *Interface)
Definition: Ip4If.c:699
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33