3 Copyright (c) 2005 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 #ifndef __EFI_IP4_INPUT_H__
22 #define __EFI_IP4_INPUT_H__
28 IP4_ASSEMLE_HASH_SIZE
= 31,
29 IP4_FRAGMENT_LIFE
= 120,
30 IP4_MAX_PACKET_SIZE
= 65535
34 // Per packet information for input process. LinkFlag specifies whether
35 // the packet is received as Link layer unicast, multicast or broadcast.
36 // The CastType is the IP layer cast type, such as IP multicast or unicast.
37 // Start, End and Length are staffs used to assemble the packets. Start
38 // is the sequence number of the first byte of data in the packet. Length
39 // is the number of bytes of data. End = Start + Length, that is, the
40 // sequence number of last byte + 1. Each assembled packet has a count down
41 // life. If it isn't consumed before Life reaches zero, the packet is released.
54 // Structure used to assemble IP packets.
60 // Identity of one IP4 packet. Each fragment of a packet has
61 // the same (Dst, Src, Id, Protocol).
70 NET_LIST_ENTRY Fragments
; // List of all the fragments of this packet
72 IP4_HEAD
*Head
; // IP head of the first fragment
73 IP4_CLIP_INFO
*Info
; // Per packet info of the first fragment
74 INTN Life
; // Count down life for the packet.
78 // Each Ip service instance has an assemble table to reassemble
79 // the packets before delivery to its children. It is organized
83 NET_LIST_ENTRY Bucket
[IP4_ASSEMLE_HASH_SIZE
];
86 #define IP4_GET_CLIP_INFO(Packet) ((IP4_CLIP_INFO *) ((Packet)->ProtoData))
88 #define IP4_ASSEMBLE_HASH(Dst, Src, Id, Proto) \
89 (((Dst) + (Src) + ((Id) << 16) + (Proto)) % IP4_ASSEMLE_HASH_SIZE)
91 #define IP4_RXDATA_WRAP_SIZE(NumFrag) \
92 (sizeof (IP4_RXDATA_WRAP) + sizeof (EFI_IP4_FRAGMENT_DATA) * ((NumFrag) - 1))
95 Ip4InitAssembleTable (
96 IN IP4_ASSEMBLE_TABLE
*Table
100 Ip4CleanAssembleTable (
101 IN IP4_ASSEMBLE_TABLE
*Table
106 IN IP4_PROTOCOL
*Ip4Instance
,
108 IN EFI_STATUS IoStatus
,
115 IN IP4_SERVICE
*SbInstance
,
121 Ip4InterfaceEnquePacket (
122 IN IP4_SERVICE
*SbInstance
,
125 IN IP4_INTERFACE
*Interface
129 Ip4InstanceDeliverPacket (
130 IN IP4_PROTOCOL
*Ip4Instance
134 Ip4PacketTimerTicking (