TianoCore EDK2 master
|
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) |
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.
#define IP6_ASSEMBLE_HASH | ( | Dst, | |
Src, | |||
Id | |||
) | ((*((UINT32 *) (Dst)) + *((UINT32 *) (Src)) + (Id)) % IP6_ASSEMLE_HASH_SIZE) |
Definition at line 29 of file Ip6Input.h.
#define IP6_ASSEMLE_HASH_SIZE 127 |
Definition at line 20 of file Ip6Input.h.
#define IP6_FRAGMENT_LIFE 60 |
Lift time in seconds.
Definition at line 24 of file Ip6Input.h.
#define IP6_GET_CLIP_INFO | ( | Packet | ) | ((IP6_CLIP_INFO *) ((Packet)->ProtoData)) |
Definition at line 27 of file Ip6Input.h.
#define IP6_MAX_HEADLEN 120 |
Definition at line 14 of file Ip6Input.h.
#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.
#define IP6_MAX_PACKET_SIZE 65535 |
Definition at line 25 of file Ip6Input.h.
#define IP6_MIN_HEADLEN 40 |
Definition at line 13 of file Ip6Input.h.
#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.
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.
[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.
[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. |
Definition at line 976 of file Ip6Input.c.
VOID Ip6CleanAssembleTable | ( | IN OUT IP6_ASSEMBLE_TABLE * | Table | ) |
Clean up the assemble table: remove all the fragments and assemble entries.
[in,out] | Table | The assemble table to clean up. |
Clean up the assemble table by removing all of the fragments and assemble entries.
[in,out] | Table | The assemble table to clean up. |
Definition at line 1136 of file Ip6Input.c.
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.
[in,out] | Table | The assemble table to initialize. |
Definition at line 1117 of file Ip6Input.c.
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.
[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. |
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.
[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. |
EFI_NOT_FOUND | No IP child accepts the packet. |
EFI_SUCCESS | The packet is enqueued or delivered to some IP children. |
Definition at line 1651 of file Ip6Input.c.
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.
[in] | IpInstance | The IP child to deliver the packet up. |
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.
[in] | IpInstance | The IP child to deliver the packet up. |
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. |
Definition at line 1466 of file Ip6Input.c.
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.
[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. |
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 sufficient 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. |
Definition at line 497 of file Ip6Input.c.
VOID Ip6PacketTimerTicking | ( | IN IP6_SERVICE * | IpSb | ) |
Timeout the fragmented, enqueued, and transmitted packets.
[in] | IpSb | The IP6 service instance to timeout. |
Timeout the fragments, and the enqueued, and transmitted packets.
[in] | IpSb | The IP6 service instance to timeout. |
Definition at line 1739 of file Ip6Input.c.