TianoCore EDK2 master
Loading...
Searching...
No Matches
UdpIoLib.h
Go to the documentation of this file.
1
10#ifndef _UDP_IO_H_
11#define _UDP_IO_H_
12
13#include <Protocol/Udp4.h>
14#include <Protocol/Udp6.h>
15
16#include <Library/NetLib.h>
17
18typedef struct _UDP_IO UDP_IO;
19
23
24#define UDP_IO_RX_SIGNATURE SIGNATURE_32 ('U', 'D', 'P', 'R')
25#define UDP_IO_TX_SIGNATURE SIGNATURE_32 ('U', 'D', 'P', 'T')
26#define UDP_IO_SIGNATURE SIGNATURE_32 ('U', 'D', 'P', 'I')
27
28#define UDP_IO_UDP4_VERSION 4
29#define UDP_IO_UDP6_VERSION 6
30
34typedef struct {
35 EFI_IP_ADDRESS LocalAddr;
36 UINT16 LocalPort;
37 EFI_IP_ADDRESS RemoteAddr;
38 UINT16 RemotePort;
40
55typedef
56VOID
57(EFIAPI *UDP_IO_CALLBACK)(
58 IN NET_BUF *Packet,
59 IN UDP_END_POINT *EndPoint,
60 IN EFI_STATUS IoStatus,
61 IN VOID *Context
62 );
63
72typedef union {
76
77typedef struct {
78 UINT32 Signature;
79 UDP_IO *UdpIo;
80
81 UDP_IO_CALLBACK CallBack;
82 VOID *Context;
83 UINT32 HeadLen;
84
87
95
96typedef union {
100
101typedef union {
105
106typedef struct {
107 UINT32 Signature;
108 LIST_ENTRY Link;
109 UDP_IO *UdpIo;
110 UDP_IO_CALLBACK CallBack;
111 NET_BUF *Packet;
112 VOID *Context;
113 EFI_IPv4_ADDRESS Gateway;
114 UDP_SESSION_DATA Session;
118
125struct _UDP_IO {
126 UINT32 Signature;
127 LIST_ENTRY Link;
128 INTN RefCnt;
129 UINT8 UdpVersion;
130
131 //
132 // Handle used to create/destroy UDP child
133 //
134 EFI_HANDLE Controller;
135 EFI_HANDLE Image;
136 EFI_HANDLE UdpHandle;
137
139
141 UDP_RX_TOKEN *RecvRequest;
142
143 union {
144 EFI_UDP4_PROTOCOL *Udp4;
145 EFI_UDP6_PROTOCOL *Udp6;
146 } Protocol;
147
148 union {
151 } Config;
152};
153
166typedef
168(EFIAPI *UDP_IO_CONFIG)(
169 IN UDP_IO *UdpIo,
170 IN VOID *Context
171 );
172
183typedef
184BOOLEAN
185(EFIAPI *UDP_IO_TO_CANCEL)(
186 IN UDP_TX_TOKEN *Token,
187 IN VOID *Context
188 );
189
203VOID
204EFIAPI
206 IN UDP_IO *UdpIo,
207 IN EFI_STATUS IoStatus,
208 IN UDP_IO_TO_CANCEL ToCancel OPTIONAL,
209 IN VOID *Context OPTIONAL
210 );
211
234UDP_IO *
235EFIAPI
237 IN EFI_HANDLE Controller,
238 IN EFI_HANDLE ImageHandle,
239 IN UDP_IO_CONFIG Configure,
240 IN UINT8 UdpVersion,
241 IN VOID *Context
242 );
243
258EFIAPI
260 IN UDP_IO *UdpIo
261 );
262
274VOID
275EFIAPI
277 IN UDP_IO *UdpIo
278 );
279
304EFIAPI
306 IN UDP_IO *UdpIo,
307 IN NET_BUF *Packet,
308 IN UDP_END_POINT *EndPoint OPTIONAL,
309 IN EFI_IP_ADDRESS *Gateway OPTIONAL,
310 IN UDP_IO_CALLBACK CallBack,
311 IN VOID *Context
312 );
313
321VOID
322EFIAPI
324 IN UDP_IO *UdpIo,
325 IN NET_BUF *Packet
326 );
327
352EFIAPI
354 IN UDP_IO *UdpIo,
355 IN UDP_IO_CALLBACK CallBack,
356 IN VOID *Context,
357 IN UINT32 HeadLen
358 );
359
360#endif
INT64 INTN
#define IN
Definition: Base.h:279
VOID EFIAPI UdpIoCancelSentDatagram(IN UDP_IO *UdpIo, IN NET_BUF *Packet)
Definition: DxeUdpIoLib.c:1051
EFI_STATUS(EFIAPI * UDP_IO_CONFIG)(IN UDP_IO *UdpIo, IN VOID *Context)
Definition: UdpIoLib.h:168
VOID EFIAPI UdpIoCleanIo(IN UDP_IO *UdpIo)
Definition: DxeUdpIoLib.c:915
VOID EFIAPI UdpIoCancelDgrams(IN UDP_IO *UdpIo, IN EFI_STATUS IoStatus, IN UDP_IO_TO_CANCEL ToCancel OPTIONAL, IN VOID *Context OPTIONAL)
Definition: DxeUdpIoLib.c:765
EFI_STATUS EFIAPI UdpIoRecvDatagram(IN UDP_IO *UdpIo, IN UDP_IO_CALLBACK CallBack, IN VOID *Context, IN UINT32 HeadLen)
Definition: DxeUdpIoLib.c:1084
EFI_STATUS EFIAPI UdpIoSendDatagram(IN UDP_IO *UdpIo, IN NET_BUF *Packet, IN UDP_END_POINT *EndPoint OPTIONAL, IN EFI_IP_ADDRESS *Gateway OPTIONAL, IN UDP_IO_CALLBACK CallBack, IN VOID *Context)
Definition: DxeUdpIoLib.c:971
BOOLEAN(EFIAPI * UDP_IO_TO_CANCEL)(IN UDP_TX_TOKEN *Token, IN VOID *Context)
Definition: UdpIoLib.h:185
EFI_STATUS EFIAPI UdpIoFreeIo(IN UDP_IO *UdpIo)
Definition: DxeUdpIoLib.c:809
VOID(EFIAPI * UDP_IO_CALLBACK)(IN NET_BUF *Packet, IN UDP_END_POINT *EndPoint, IN EFI_STATUS IoStatus, IN VOID *Context)
Definition: UdpIoLib.h:57
UDP_IO *EFIAPI UdpIoCreateIo(IN EFI_HANDLE Controller, IN EFI_HANDLE ImageHandle, IN UDP_IO_CONFIG Configure, IN UINT8 UdpVersion, IN VOID *Context)
Definition: DxeUdpIoLib.c:602
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
LIST_ENTRY SentDatagram
A list of UDP_TX_TOKEN.
Definition: UdpIoLib.h:140