TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip4Input.h
Go to the documentation of this file.
1
8#ifndef __EFI_IP4_INPUT_H__
9#define __EFI_IP4_INPUT_H__
10
11#define IP4_MIN_HEADLEN 20
12#define IP4_MAX_HEADLEN 60
16#define IP4_MAX_IPSEC_HEADLEN 54
17
18#define IP4_ASSEMLE_HASH_SIZE 31
19#define IP4_FRAGMENT_LIFE 120
20#define IP4_MAX_PACKET_SIZE 65535
21
32typedef struct {
33 UINTN LinkFlag;
34 INTN CastType;
35 INTN Start;
36 INTN End;
37 INTN Length;
38 UINT32 Life;
39 EFI_STATUS Status;
41
45typedef struct {
46 LIST_ENTRY Link;
47
48 //
49 // Identity of one IP4 packet. Each fragment of a packet has
50 // the same (Dst, Src, Id, Protocol).
51 //
52 IP4_ADDR Dst;
53 IP4_ADDR Src;
54 UINT16 Id;
55 UINT8 Protocol;
56
57 INTN TotalLen;
58 INTN CurLen;
59 LIST_ENTRY Fragments; // List of all the fragments of this packet
60
61 IP4_HEAD *Head; // IP head of the first fragment
62 IP4_CLIP_INFO *Info; // Per packet info of the first fragment
63 INTN Life; // Count down life for the packet.
65
71typedef struct {
72 LIST_ENTRY Bucket[IP4_ASSEMLE_HASH_SIZE];
74
75#define IP4_GET_CLIP_INFO(Packet) ((IP4_CLIP_INFO *) ((Packet)->ProtoData))
76
77#define IP4_ASSEMBLE_HASH(Dst, Src, Id, Proto) \
78 (((Dst) + (Src) + ((Id) << 16) + (Proto)) % IP4_ASSEMLE_HASH_SIZE)
79
80#define IP4_RXDATA_WRAP_SIZE(NumFrag) \
81 (sizeof (IP4_RXDATA_WRAP) + sizeof (EFI_IP4_FRAGMENT_DATA) * ((NumFrag) - 1))
82
90VOID
93 );
94
102VOID
105 );
106
120VOID
122 IN IP4_PROTOCOL *Ip4Instance,
123 IN NET_BUF *Packet,
124 IN EFI_STATUS IoStatus,
125 IN UINT32 Flag,
126 IN VOID *Context
127 );
128
151 IN IP4_SERVICE *IpSb,
152 IN IP4_HEAD *Head,
153 IN NET_BUF *Packet,
154 IN UINT8 *Option,
155 IN UINT32 OptionLen
156 );
157
172INTN
174 IN IP4_SERVICE *IpSb,
175 IN IP4_HEAD *Head,
176 IN NET_BUF *Packet,
177 IN UINT8 *Option,
178 IN UINT32 OptionLen,
179 IN IP4_INTERFACE *IpIf
180 );
181
198 IN IP4_PROTOCOL *IpInstance
199 );
200
207VOID
209 IN IP4_SERVICE *IpSb
210 );
211
237 IN IP4_SERVICE *IpSb,
238 IN OUT IP4_HEAD **Head,
239 IN OUT NET_BUF **Netbuf,
240 IN OUT UINT8 **Options,
241 IN OUT UINT32 *OptionsLen,
242 IN EFI_IPSEC_TRAFFIC_DIR Direction,
243 IN VOID *Context
244 );
245
246#endif
UINT64 UINTN
INT64 INTN
INTN Ip4InterfaceEnquePacket(IN IP4_SERVICE *IpSb, IN IP4_HEAD *Head, IN NET_BUF *Packet, IN UINT8 *Option, IN UINT32 OptionLen, IN IP4_INTERFACE *IpIf)
Definition: Ip4Input.c:1363
EFI_STATUS Ip4InstanceDeliverPacket(IN IP4_PROTOCOL *IpInstance)
Definition: Ip4Input.c:1256
VOID Ip4CleanAssembleTable(IN IP4_ASSEMBLE_TABLE *Table)
Definition: Ip4Input.c:111
VOID Ip4InitAssembleTable(IN OUT IP4_ASSEMBLE_TABLE *Table)
Definition: Ip4Input.c:92
EFI_STATUS Ip4Demultiplex(IN IP4_SERVICE *IpSb, IN IP4_HEAD *Head, IN NET_BUF *Packet, IN UINT8 *Option, IN UINT32 OptionLen)
Definition: Ip4Input.c:1495
EFI_STATUS Ip4IpSecProcessPacket(IN IP4_SERVICE *IpSb, IN OUT IP4_HEAD **Head, IN OUT NET_BUF **Netbuf, IN OUT UINT8 **Options, IN OUT UINT32 *OptionsLen, IN EFI_IPSEC_TRAFFIC_DIR Direction, IN VOID *Context)
Definition: Ip4Input.c:482
VOID Ip4AccpetFrame(IN IP4_PROTOCOL *Ip4Instance, IN NET_BUF *Packet, IN EFI_STATUS IoStatus, IN UINT32 Flag, IN VOID *Context)
Definition: Ip4Input.c:838
VOID Ip4PacketTimerTicking(IN IP4_SERVICE *IpSb)
Definition: Ip4Input.c:1557
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