TianoCore EDK2 master
Loading...
Searching...
No Matches
Udp6Impl.h
Go to the documentation of this file.
1
10#ifndef _UDP6_IMPL_H_
11#define _UDP6_IMPL_H_
12
13#include <Uefi.h>
14
15#include <Protocol/Ip6.h>
16#include <Protocol/Udp6.h>
17
18#include <Library/IpIoLib.h>
19#include <Library/DebugLib.h>
22#include <Library/BaseLib.h>
23#include <Library/UefiLib.h>
26#include <Library/DpcLib.h>
27#include <Library/PrintLib.h>
28
29#include "Udp6Driver.h"
30
31extern EFI_COMPONENT_NAME2_PROTOCOL gUdp6ComponentName2;
32extern EFI_COMPONENT_NAME_PROTOCOL gUdp6ComponentName;
33extern EFI_UNICODE_STRING_TABLE *gUdp6ControllerNameTable;
34extern EFI_SERVICE_BINDING_PROTOCOL mUdp6ServiceBinding;
35extern EFI_UDP6_PROTOCOL mUdp6Protocol;
36extern UINT16 mUdp6RandomPort;
37
38//
39// Define time out 50 milliseconds
40//
41#define UDP6_TIMEOUT_INTERVAL (50 * TICKS_PER_MS)
42#define UDP6_HEADER_SIZE sizeof (EFI_UDP_HEADER)
43#define UDP6_MAX_DATA_SIZE 65507
44#define UDP6_PORT_KNOWN 1024
45
46#define UDP6_SERVICE_DATA_SIGNATURE SIGNATURE_32 ('U', 'd', 'p', '6')
47#define UDP6_INSTANCE_DATA_SIGNATURE SIGNATURE_32 ('U', 'd', 'p', 'S')
48
49#define UDP6_SERVICE_DATA_FROM_THIS(a) \
50 CR ( \
51 (a), \
52 UDP6_SERVICE_DATA, \
53 ServiceBinding, \
54 UDP6_SERVICE_DATA_SIGNATURE \
55 )
56
57#define UDP6_INSTANCE_DATA_FROM_THIS(a) \
58 CR ( \
59 (a), \
60 UDP6_INSTANCE_DATA, \
61 Udp6Proto, \
62 UDP6_INSTANCE_DATA_SIGNATURE \
63 )
64//
65// Udp6 service contest data
66//
67typedef struct _UDP6_SERVICE_DATA {
68 UINT32 Signature;
69 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
70 EFI_HANDLE ImageHandle;
71 EFI_HANDLE ControllerHandle;
72 LIST_ENTRY ChildrenList;
73 UINTN ChildrenNumber;
74 IP_IO *IpIo;
75 EFI_EVENT TimeoutEvent;
77
78typedef struct _UDP6_INSTANCE_DATA {
79 UINT32 Signature;
80 LIST_ENTRY Link;
81 UDP6_SERVICE_DATA *Udp6Service;
82 EFI_UDP6_PROTOCOL Udp6Proto;
83 EFI_UDP6_CONFIG_DATA ConfigData;
84 EFI_HANDLE ChildHandle;
85 BOOLEAN Configured;
86 BOOLEAN IsNoMapping;
87 NET_MAP TxTokens;
88 NET_MAP RxTokens;
89 NET_MAP McastIps;
90 LIST_ENTRY RcvdDgramQue;
91 LIST_ENTRY DeliveredDgramQue;
92 UINT16 HeadSum;
93 EFI_STATUS IcmpError;
94 IP_IO_IP_INFO *IpInfo;
95 BOOLEAN InDestroy;
97
98typedef struct _UDP6_RXDATA_WRAP {
99 LIST_ENTRY Link;
100 NET_BUF *Packet;
101 UINT32 TimeoutTick;
104
105typedef struct {
106 EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;
107 UINTN NumberOfChildren;
108 EFI_HANDLE *ChildHandleBuffer;
110
117VOID
119 IN OUT UDP6_SERVICE_DATA *Udp6Service
120 );
121
137 IN UDP6_SERVICE_DATA *Udp6Service,
138 IN EFI_HANDLE ImageHandle,
139 IN EFI_HANDLE ControllerHandle
140 );
141
148VOID
150 IN OUT UDP6_INSTANCE_DATA *Instance
151 );
152
160VOID
162 IN UDP6_SERVICE_DATA *Udp6Service,
163 IN OUT UDP6_INSTANCE_DATA *Instance
164 );
165
172VOID
174 IN UDP6_INSTANCE_DATA *Instance
175 );
176
203EFIAPI
205 IN EFI_UDP6_PROTOCOL *This,
206 OUT EFI_UDP6_CONFIG_DATA *Udp6ConfigData OPTIONAL,
207 OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,
208 OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
209 OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
210 );
211
250EFIAPI
252 IN EFI_UDP6_PROTOCOL *This,
253 IN EFI_UDP6_CONFIG_DATA *UdpConfigData OPTIONAL
254 );
255
307EFIAPI
309 IN EFI_UDP6_PROTOCOL *This,
311 );
312
343EFIAPI
345 IN EFI_UDP6_PROTOCOL *This,
347 );
348
373EFIAPI
375 IN EFI_UDP6_PROTOCOL *This,
376 IN EFI_UDP6_COMPLETION_TOKEN *Token OPTIONAL
377 );
378
393EFIAPI
394Udp6Poll (
396 );
397
424EFIAPI
426 IN EFI_UDP6_PROTOCOL *This,
427 IN BOOLEAN JoinFlag,
428 IN EFI_IPv6_ADDRESS *MulticastAddress OPTIONAL
429 );
430
447Udp6Bind (
448 IN LIST_ENTRY *InstanceList,
449 IN EFI_UDP6_CONFIG_DATA *ConfigData
450 );
451
459VOID
461 IN EFI_UDP6_CONFIG_DATA *Udp6ConfigData,
462 IN OUT EFI_IP6_CONFIG_DATA *Ip6ConfigData
463 );
464
479EFIAPI
481 IN NET_MAP *Map,
482 IN NET_MAP_ITEM *Item,
483 IN VOID *Context
484 );
485
498 IN NET_MAP *TokenMap,
500 );
501
514BOOLEAN
516 IN EFI_UDP6_CONFIG_DATA *OldConfigData,
517 IN EFI_UDP6_CONFIG_DATA *NewConfigData
518 );
519
535EFIAPI
537 IN NET_MAP *Map,
538 IN NET_MAP_ITEM *Item,
539 IN VOID *Arg OPTIONAL
540 );
541
573 IN UDP6_INSTANCE_DATA *Instance,
575 );
576
584VOID
585EFIAPI
587 IN VOID *Context
588 );
589
601UINT16
603 IN NET_BUF *Packet,
604 IN UINT16 HeadSum
605 );
606
613VOID
615 IN UDP6_INSTANCE_DATA *Instance
616 );
617
632 IN UDP6_INSTANCE_DATA *Instance,
633 IN EFI_UDP6_COMPLETION_TOKEN *Token OPTIONAL
634 );
635
642VOID
644 IN UDP6_INSTANCE_DATA *Instance
645 );
646
647#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS EFIAPI Udp6Receive(IN EFI_UDP6_PROTOCOL *This, IN EFI_UDP6_COMPLETION_TOKEN *Token)
Definition: Udp6Main.c:688
EFI_STATUS EFIAPI Udp6LeaveGroup(IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Arg OPTIONAL)
Definition: Udp6Impl.c:1074
EFI_STATUS Udp6CreateService(IN UDP6_SERVICE_DATA *Udp6Service, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ControllerHandle)
Definition: Udp6Impl.c:285
EFI_STATUS Udp6RemoveToken(IN NET_MAP *TokenMap, IN EFI_UDP6_COMPLETION_TOKEN *Token)
Definition: Udp6Impl.c:942
VOID Udp6CleanInstance(IN OUT UDP6_INSTANCE_DATA *Instance)
Definition: Udp6Impl.c:507
EFI_STATUS EFIAPI Udp6Configure(IN EFI_UDP6_PROTOCOL *This, IN EFI_UDP6_CONFIG_DATA *UdpConfigData OPTIONAL)
Definition: Udp6Main.c:131
VOID Udp6InstanceDeliverDgram(IN UDP6_INSTANCE_DATA *Instance)
Definition: Udp6Impl.c:1487
EFI_STATUS EFIAPI Udp6Cancel(IN EFI_UDP6_PROTOCOL *This, IN EFI_UDP6_COMPLETION_TOKEN *Token OPTIONAL)
Definition: Udp6Main.c:779
VOID Udp6InitInstance(IN UDP6_SERVICE_DATA *Udp6Service, IN OUT UDP6_INSTANCE_DATA *Instance)
Definition: Udp6Impl.c:465
EFI_STATUS EFIAPI Udp6Poll(IN EFI_UDP6_PROTOCOL *This)
Definition: Udp6Main.c:830
UINT16 Udp6Checksum(IN NET_BUF *Packet, IN UINT16 HeadSum)
Definition: Udp6Impl.c:916
VOID Udp6FlushRcvdDgram(IN UDP6_INSTANCE_DATA *Instance)
Definition: Udp6Impl.c:1180
EFI_STATUS EFIAPI Udp6GetModeData(IN EFI_UDP6_PROTOCOL *This, OUT EFI_UDP6_CONFIG_DATA *Udp6ConfigData OPTIONAL, OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL)
Definition: Udp6Main.c:49
EFI_STATUS Udp6InstanceCancelToken(IN UDP6_INSTANCE_DATA *Instance, IN EFI_UDP6_COMPLETION_TOKEN *Token OPTIONAL)
Definition: Udp6Impl.c:1212
EFI_STATUS Udp6ValidateTxToken(IN UDP6_INSTANCE_DATA *Instance, IN EFI_UDP6_COMPLETION_TOKEN *TxToken)
Definition: Udp6Impl.c:776
EFI_STATUS EFIAPI Udp6Groups(IN EFI_UDP6_PROTOCOL *This, IN BOOLEAN JoinFlag, IN EFI_IPv6_ADDRESS *MulticastAddress OPTIONAL)
Definition: Udp6Main.c:314
EFI_STATUS Udp6Bind(IN LIST_ENTRY *InstanceList, IN EFI_UDP6_CONFIG_DATA *ConfigData)
Definition: Udp6Impl.c:587
VOID Udp6CleanService(IN OUT UDP6_SERVICE_DATA *Udp6Service)
Definition: Udp6Impl.c:380
VOID EFIAPI Udp6NetVectorExtFree(IN VOID *Context)
Definition: Udp6Impl.c:1949
VOID Udp6ReportIcmpError(IN UDP6_INSTANCE_DATA *Instance)
Definition: Udp6Impl.c:1906
EFI_STATUS EFIAPI Udp6Transmit(IN EFI_UDP6_PROTOCOL *This, IN EFI_UDP6_COMPLETION_TOKEN *Token)
Definition: Udp6Main.c:445
BOOLEAN Udp6IsReconfigurable(IN EFI_UDP6_CONFIG_DATA *OldConfigData, IN EFI_UDP6_CONFIG_DATA *NewConfigData)
Definition: Udp6Impl.c:662
VOID Udp6BuildIp6ConfigData(IN EFI_UDP6_CONFIG_DATA *Udp6ConfigData, IN OUT EFI_IP6_CONFIG_DATA *Ip6ConfigData)
Definition: Udp6Impl.c:726
EFI_STATUS EFIAPI Udp6TokenExist(IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Context)
Definition: Udp6Impl.c:881
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33