TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip6Input.h File Reference

Go to the source code of this file.

Data Structures

struct  IP6_CLIP_INFO
 
struct  IP6_ASSEMBLE_ENTRY
 
struct  IP6_ASSEMBLE_TABLE
 

Macros

#define IP6_MIN_HEADLEN   40
 
#define IP6_MAX_HEADLEN   120
 
#define IP6_MAX_IPSEC_HEADLEN   54
 
#define IP6_ASSEMLE_HASH_SIZE   127
 
#define IP6_FRAGMENT_LIFE   60
 
#define IP6_MAX_PACKET_SIZE   65535
 
#define IP6_GET_CLIP_INFO(Packet)   ((IP6_CLIP_INFO *) ((Packet)->ProtoData))
 
#define IP6_ASSEMBLE_HASH(Dst, Src, Id)    ((*((UINT32 *) (Dst)) + *((UINT32 *) (Src)) + (Id)) % IP6_ASSEMLE_HASH_SIZE)
 
#define IP6_RXDATA_WRAP_SIZE(NumFrag)    (sizeof (IP6_RXDATA_WRAP) + sizeof (EFI_IP6_FRAGMENT_DATA) * ((NumFrag) - 1))
 

Functions

VOID Ip6AcceptFrame (IN NET_BUF *Packet, IN EFI_STATUS IoStatus, IN UINT32 Flag, IN VOID *Context)
 
EFI_STATUS Ip6InstanceDeliverPacket (IN IP6_PROTOCOL *IpInstance)
 
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)
 
VOID Ip6CreateAssembleTable (IN OUT IP6_ASSEMBLE_TABLE *Table)
 
VOID Ip6CleanAssembleTable (IN OUT IP6_ASSEMBLE_TABLE *Table)
 
EFI_STATUS Ip6Demultiplex (IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet)
 
VOID Ip6PacketTimerTicking (IN IP6_SERVICE *IpSb)
 

Detailed Description

IP6 internal functions and definitions to process the incoming packets.

Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Ip6Input.h.

Macro Definition Documentation

◆ IP6_ASSEMBLE_HASH

#define IP6_ASSEMBLE_HASH (   Dst,
  Src,
  Id 
)     ((*((UINT32 *) (Dst)) + *((UINT32 *) (Src)) + (Id)) % IP6_ASSEMLE_HASH_SIZE)

Definition at line 29 of file Ip6Input.h.

◆ IP6_ASSEMLE_HASH_SIZE

#define IP6_ASSEMLE_HASH_SIZE   127

Definition at line 20 of file Ip6Input.h.

◆ IP6_FRAGMENT_LIFE

#define IP6_FRAGMENT_LIFE   60

Lift time in seconds.

Definition at line 24 of file Ip6Input.h.

◆ IP6_GET_CLIP_INFO

#define IP6_GET_CLIP_INFO (   Packet)    ((IP6_CLIP_INFO *) ((Packet)->ProtoData))

Definition at line 27 of file Ip6Input.h.

◆ IP6_MAX_HEADLEN

#define IP6_MAX_HEADLEN   120

Definition at line 14 of file Ip6Input.h.

◆ IP6_MAX_IPSEC_HEADLEN

#define IP6_MAX_IPSEC_HEADLEN   54

8(ESP header) + 16(max IV) + 16(max padding) + 2(ESP tail) + 12(max ICV) = 54

Definition at line 18 of file Ip6Input.h.

◆ IP6_MAX_PACKET_SIZE

#define IP6_MAX_PACKET_SIZE   65535

Definition at line 25 of file Ip6Input.h.

◆ IP6_MIN_HEADLEN

#define IP6_MIN_HEADLEN   40

Definition at line 13 of file Ip6Input.h.

◆ IP6_RXDATA_WRAP_SIZE

#define IP6_RXDATA_WRAP_SIZE (   NumFrag)     (sizeof (IP6_RXDATA_WRAP) + sizeof (EFI_IP6_FRAGMENT_DATA) * ((NumFrag) - 1))

Definition at line 32 of file Ip6Input.h.

Function Documentation

◆ Ip6AcceptFrame()

VOID Ip6AcceptFrame ( IN NET_BUF Packet,
IN EFI_STATUS  IoStatus,
IN UINT32  Flag,
IN VOID *  Context 
)

The IP6 input routine. It is called by the IP6_INTERFACE when an IP6 fragment is received from MNP.

Parameters
[in]PacketThe IP6 packet received.
[in]IoStatusThe return status of receive request.
[in]FlagThe link layer flag for the packet received, such as multicast.
[in]ContextThe IP6 service instance that own the MNP.

The IP6 input routine. It is called by the IP6_INTERFACE when an IP6 fragment is received from MNP.

Parameters
[in]PacketThe IP6 packet received.
[in]IoStatusThe return status of receive request.
[in]FlagThe link layer flag for the packet received, such as multicast.
[in]ContextThe IP6 service instance that owns the MNP.

Definition at line 976 of file Ip6Input.c.

◆ Ip6CleanAssembleTable()

VOID Ip6CleanAssembleTable ( IN OUT IP6_ASSEMBLE_TABLE Table)

Clean up the assemble table: remove all the fragments and assemble entries.

Parameters
[in,out]TableThe assemble table to clean up.

Clean up the assemble table by removing all of the fragments and assemble entries.

Parameters
[in,out]TableThe assemble table to clean up.

Definition at line 1136 of file Ip6Input.c.

◆ Ip6CreateAssembleTable()

VOID Ip6CreateAssembleTable ( IN OUT IP6_ASSEMBLE_TABLE Table)

Initialize an already allocated assemble table. This is generally the assemble table embedded in the IP6 service instance.

Parameters
[in,out]TableThe assemble table to initialize.

Definition at line 1117 of file Ip6Input.c.

◆ Ip6Demultiplex()

EFI_STATUS Ip6Demultiplex ( IN IP6_SERVICE IpSb,
IN EFI_IP6_HEADER Head,
IN NET_BUF Packet 
)

Demultiple the packet. the packet delivery is processed in two passes. The first pass will enqueue a shared copy of the packet to each IP6 child that accepts the packet. The second pass will deliver a non-shared copy of the packet to each IP6 child that has pending receive requests. Data is copied if more than one child wants to consume the packet because each IP child need its own copy of the packet to make changes.

Parameters
[in]IpSbThe IP6 service instance that received the packet.
[in]HeadThe header of the received packet.
[in]PacketThe data of the received packet.
Return values
EFI_NOT_FOUNDNo IP child accepts the packet.
EFI_SUCCESSThe packet is enqueued or delivered to some IP children.

De-multiplex the packet. the packet delivery is processed in two passes. The first pass will enqueue a shared copy of the packet to each IP6 child that accepts the packet. The second pass will deliver a non-shared copy of the packet to each IP6 child that has pending receive requests. Data is copied if more than one child wants to consume the packet, because each IP child needs its own copy of the packet to make changes.

Parameters
[in]IpSbThe IP6 service instance that received the packet.
[in]HeadThe header of the received packet.
[in]PacketThe data of the received packet.
Return values
EFI_NOT_FOUNDNo IP child accepts the packet.
EFI_SUCCESSThe packet is enqueued or delivered to some IP children.

Definition at line 1651 of file Ip6Input.c.

◆ Ip6InstanceDeliverPacket()

EFI_STATUS Ip6InstanceDeliverPacket ( IN IP6_PROTOCOL IpInstance)

Deliver the received packets to upper layer if there are both received requests and enqueued packets. If the enqueued packet is shared, it will duplicate it to a non-shared packet, release the shared packet, then deliver the non-shared packet up.

Parameters
[in]IpInstanceThe IP child to deliver the packet up.
Return values
EFI_OUT_OF_RESOURCESFailed to allocate resources to deliver the packets.
EFI_SUCCESSAll the enqueued packets that can be delivered are delivered up.

Deliver the received packets to the upper layer if there are both received requests and enqueued packets. If the enqueued packet is shared, it will duplicate it to a non-shared packet, release the shared packet, then deliver the non-shared packet up.

Parameters
[in]IpInstanceThe IP child to deliver the packet up.
Return values
EFI_OUT_OF_RESOURCESFailed to allocate resources to deliver the packets.
EFI_SUCCESSAll the enqueued packets that can be delivered are delivered up.

Definition at line 1466 of file Ip6Input.c.

◆ Ip6IpSecProcessPacket()

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 
)

The work function to locate the IPsec protocol to process the inbound or outbound IP packets. The process routine handles the packet with the following actions: bypass the packet, discard the packet, or protect the packet.

Parameters
[in]IpSbThe IP6 service instance.
[in,out]HeadThe caller-supplied IP6 header.
[in,out]LastHeadThe next header field of last IP header.
[in,out]NetbufThe IP6 packet to be processed by IPsec.
[in,out]ExtHdrsThe caller-supplied options.
[in,out]ExtHdrsLenThe length of the option.
[in]DirectionThe directionality in an SPD entry, EfiIPsecInBound, or EfiIPsecOutBound.
[in]ContextThe token's wrap.
Return values
EFI_SUCCESSThe IPsec protocol is not available or disabled.
EFI_SUCCESSThe packet was bypassed, and all buffers remain the same.
EFI_SUCCESSThe packet was protected.
EFI_ACCESS_DENIEDThe packet was discarded.
EFI_OUT_OF_RESOURCESThere are not sufficient resources to complete the operation.
EFI_BUFFER_TOO_SMALLThe number of non-empty blocks is bigger than the number of input data blocks when building a fragment table.

Definition at line 497 of file Ip6Input.c.

◆ Ip6PacketTimerTicking()

VOID Ip6PacketTimerTicking ( IN IP6_SERVICE IpSb)

Timeout the fragmented, enqueued, and transmitted packets.

Parameters
[in]IpSbThe IP6 service instance to timeout.

Timeout the fragments, and the enqueued, and transmitted packets.

Parameters
[in]IpSbThe IP6 service instance to timeout.

Definition at line 1739 of file Ip6Input.c.