NetworkPkg/Ip6Dxe/Ip6Input.h File Reference


Data Structures

struct  IP6_CLIP_INFO
struct  IP6_ASSEMBLE_ENTRY
struct  IP6_ASSEMBLE_TABLE

Defines

#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.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Define Documentation

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

Referenced by Ip6Reassemble().

#define IP6_ASSEMLE_HASH_SIZE   127

#define IP6_FRAGMENT_LIFE   60

Lift time in seconds.

Referenced by Ip6CreateAssembleEntry().

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

#define IP6_MAX_HEADLEN   120

#define IP6_MAX_IPSEC_HEADLEN   54

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

Referenced by Ip6IpSecProcessPacket().

#define IP6_MAX_PACKET_SIZE   65535

#define IP6_MIN_HEADLEN   40

Referenced by Ip6PreProcessPacket().

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

Referenced by Ip6WrapRxData().


Function Documentation

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] Packet The IP6 packet received.
[in] IoStatus The return status of receive request.
[in] Flag The link layer flag for the packet received, such as multicast.
[in] Context The 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] Packet The IP6 packet received.
[in] IoStatus The return status of receive request.
[in] Flag The link layer flag for the packet received, such as multicast.
[in] Context The IP6 service instance that owns the MNP.

References IP6_GET_CLIP_INFO, IP6_SERVICE_DESTROY, IP6_SERVICE_SIGNATURE, Ip6AcceptFrame(), Ip6Demultiplex(), Ip6IcmpHandle(), Ip6IpSecProcessPacket(), Ip6PreProcessPacket(), Ip6ReceiveFrame(), and _IP6_SERVICE::State.

Referenced by Ip6AcceptFrame(), and Ip6DriverBindingStart().

VOID Ip6CleanAssembleTable ( IN OUT IP6_ASSEMBLE_TABLE Table  ) 

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

Parameters:
[in,out] Table The assemble table to clean up.
Clean up the assemble table by removing all of the fragments and assemble entries.

Parameters:
[in,out] Table The assemble table to clean up.

References IP6_ASSEMLE_HASH_SIZE, and Ip6FreeAssembleEntry().

Referenced by Ip6CleanService().

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] Table The assemble table to initialize.

References IP6_ASSEMLE_HASH_SIZE.

Referenced by Ip6CreateService().

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 enque 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 bacause each IP child need its own copy of the packet to make changes.

Parameters:
[in] IpSb The IP6 service instance that received the packet.
[in] Head The header of the received packet.
[in] Packet The data of the received packet.
Return values:
EFI_NOT_FOUND No IP child accepts the packet.
EFI_SUCCESS The 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] IpSb The IP6 service instance that received the packet.
[in] Head The header of the received packet.
[in] Packet The data of the received packet.
Return values:
EFI_NOT_FOUND No IP child accepts the packet.
EFI_SUCCESS The packet is enqueued or delivered to some IP children.

References _IP6_INTERFACE::Configured, Ip6InterfaceDeliverPacket(), and Ip6InterfaceEnquePacket().

Referenced by Ip6AcceptFrame(), Ip6ProcessIcmpError(), and Ip6ProcessIcmpInformation().

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] IpInstance The IP child to deliver the packet up.
Return values:
EFI_OUT_OF_RESOURCES Failed to allocate resources to deliver the packets.
EFI_SUCCESS All 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] IpInstance The IP child to deliver the packet up.
Return values:
EFI_OUT_OF_RESOURCES Failed to allocate resources to deliver the packets.
EFI_SUCCESS All the enqueued packets that can be delivered are delivered up.

References IP6_GET_CLIP_INFO, Ip6WrapRxData(), IP6_RXDATA_WRAP::Link, and IP6_RXDATA_WRAP::RxData.

Referenced by EfiIp6Receive(), and Ip6InterfaceDeliverPacket().

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] IpSb The IP6 service instance.
[in,out] Head The caller-supplied IP6 header.
[in,out] LastHead The next header field of last IP header.
[in,out] Netbuf The IP6 packet to be processed by IPsec.
[in,out] ExtHdrs The caller-supplied options.
[in,out] ExtHdrsLen The length of the option.
[in] Direction The directionality in an SPD entry, EfiIPsecInBound, or EfiIPsecOutBound.
[in] Context The token's wrap.
Return values:
EFI_SUCCESS The IPsec protocol is not available or disabled.
EFI_SUCCESS The packet was bypassed, and all buffers remain the same.
EFI_SUCCESS The packet was protected.
EFI_ACCESS_DENIED The packet was discarded.
EFI_OUT_OF_RESOURCES There are not suffcient resources to complete the operation.
EFI_BUFFER_TOO_SMALL The number of non-empty blocks is bigger than the number of input data blocks when building a fragment table.

References IP6_GET_CLIP_INFO, IP6_MAX_HEADLEN, IP6_MAX_IPSEC_HEADLEN, Ip6FreeTxToken(), Ip6IpSecFree(), Ip6NtohHead(), IP6_IPSEC_WRAP::IpSecRecycleSignal, IP6_TXTOKEN_WRAP::IpSecRecycleSignal, mIpSec, mIpSec2Installed, IP6_IPSEC_WRAP::Packet, and IP6_TXTOKEN_WRAP::Packet.

Referenced by Ip6AcceptFrame(), and Ip6Output().

VOID Ip6PacketTimerTicking ( IN IP6_SERVICE IpSb  ) 

Timeout the fragmented, enqueued, and transmitted packets.

Parameters:
[in] IpSb The IP6 service instance to timeout.
Timeout the fragments, and the enqueued, and transmitted packets.

Parameters:
[in] IpSb The IP6 service instance to timeout.

References IP6_ASSEMBLE_ENTRY::Head, IP6_ASSEMLE_HASH_SIZE, IP6_GET_CLIP_INFO, Ip6FreeAssembleEntry(), Ip6SendIcmpError(), Ip6SentPacketTicking(), IP6_CLIP_INFO::Life, IP6_ASSEMBLE_ENTRY::Life, IP6_ASSEMBLE_ENTRY::Packet, _IP6_PROTOCOL::Received, and _IP6_PROTOCOL::TxTokens.

Referenced by Ip6TimerTicking().


Generated on Mon Sep 28 08:49:06 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1