TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip6Input.h
Go to the documentation of this file.
1
10#ifndef __EFI_IP6_INPUT_H__
11#define __EFI_IP6_INPUT_H__
12
13#define IP6_MIN_HEADLEN 40
14#define IP6_MAX_HEADLEN 120
18#define IP6_MAX_IPSEC_HEADLEN 54
19
20#define IP6_ASSEMLE_HASH_SIZE 127
24#define IP6_FRAGMENT_LIFE 60
25#define IP6_MAX_PACKET_SIZE 65535
26
27#define IP6_GET_CLIP_INFO(Packet) ((IP6_CLIP_INFO *) ((Packet)->ProtoData))
28
29#define IP6_ASSEMBLE_HASH(Dst, Src, Id) \
30 ((*((UINT32 *) (Dst)) + *((UINT32 *) (Src)) + (Id)) % IP6_ASSEMLE_HASH_SIZE)
31
32#define IP6_RXDATA_WRAP_SIZE(NumFrag) \
33 (sizeof (IP6_RXDATA_WRAP) + sizeof (EFI_IP6_FRAGMENT_DATA) * ((NumFrag) - 1))
34
35//
36// Per packet information for input process. LinkFlag specifies whether
37// the packet is received as Link layer unicast, multicast or broadcast.
38// The CastType is the IP layer cast type, such as IP multicast or unicast.
39// Start, End and Length are staffs used to assemble the packets. Start
40// is the sequence number of the first byte of data in the packet. Length
41// is the number of bytes of data. End = Start + Length, that is, the
42// sequence number of last byte + 1. Each assembled packet has a count down
43// life. If it isn't consumed before Life reaches zero, the packet is released.
44//
45typedef struct {
46 UINT32 LinkFlag;
47 INT32 CastType;
48 INT32 Start;
49 INT32 End;
50 INT32 Length;
51 UINT32 Life;
52 EFI_STATUS Status;
53 UINT32 Id;
54 UINT16 HeadLen;
55 UINT8 NextHeader;
56 UINT8 LastFrag;
57 UINT32 FormerNextHeader;
59
60//
61// Structure used to assemble IP packets.
62//
63typedef struct {
64 LIST_ENTRY Link;
65 LIST_ENTRY Fragments; // List of all the fragments of this packet
66
67 //
68 // Identity of one IP6 packet. Each fragment of a packet has
69 // the same (Dst, Src, Id).
70 //
73 UINT32 Id;
74
75 UINT32 TotalLen;
76 UINT32 CurLen;
77 UINT32 Life; // Count down life for the packet.
78
79 EFI_IP6_HEADER *Head; // IP head of the first fragment
80 IP6_CLIP_INFO *Info; // Per packet information of the first fragment
81 NET_BUF *Packet; // The first fragment of the packet
83
84//
85// Each Ip service instance has an assemble table to reassemble
86// the packets before delivery to its children. It is organized
87// as hash table.
88//
89typedef struct {
90 LIST_ENTRY Bucket[IP6_ASSEMLE_HASH_SIZE];
92
104VOID
106 IN NET_BUF *Packet,
107 IN EFI_STATUS IoStatus,
108 IN UINT32 Flag,
109 IN VOID *Context
110 );
111
128 IN IP6_PROTOCOL *IpInstance
129 );
130
157 IN IP6_SERVICE *IpSb,
158 IN OUT EFI_IP6_HEADER **Head,
159 IN OUT UINT8 *LastHead,
160 IN OUT NET_BUF **Netbuf,
161 IN OUT UINT8 **ExtHdrs,
162 IN OUT UINT32 *ExtHdrsLen,
163 IN EFI_IPSEC_TRAFFIC_DIR Direction,
164 IN VOID *Context
165 );
166
174VOID
177 );
178
186VOID
189 );
190
211 IN IP6_SERVICE *IpSb,
212 IN EFI_IP6_HEADER *Head,
213 IN NET_BUF *Packet
214 );
215
222VOID
224 IN IP6_SERVICE *IpSb
225 );
226
227#endif
EFI_STATUS Ip6InstanceDeliverPacket(IN IP6_PROTOCOL *IpInstance)
Definition: Ip6Input.c:1466
VOID Ip6CleanAssembleTable(IN OUT IP6_ASSEMBLE_TABLE *Table)
Definition: Ip6Input.c:1136
VOID Ip6AcceptFrame(IN NET_BUF *Packet, IN EFI_STATUS IoStatus, IN UINT32 Flag, IN VOID *Context)
Definition: Ip6Input.c:976
EFI_STATUS Ip6Demultiplex(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
Definition: Ip6Input.c:1651
EFI_STATUS Ip6IpSecProcessPacket(IN IP6_SERVICE *IpSb, IN OUT EFI_IP6_HEADER **Head, IN OUT UINT8 *LastHead, IN OUT NET_BUF **Netbuf, IN OUT UINT8 **ExtHdrs, IN OUT UINT32 *ExtHdrsLen, IN EFI_IPSEC_TRAFFIC_DIR Direction, IN VOID *Context)
Definition: Ip6Input.c:497
VOID Ip6CreateAssembleTable(IN OUT IP6_ASSEMBLE_TABLE *Table)
Definition: Ip6Input.c:1117
VOID Ip6PacketTimerTicking(IN IP6_SERVICE *IpSb)
Definition: Ip6Input.c:1739
EFI_IPSEC_TRAFFIC_DIR
Definition: IpSecConfig.h:129
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29