\r
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
\r
- This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php.\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
#ifndef __EFI_IP6_INPUT_H__\r
#define __EFI_IP6_INPUT_H__\r
\r
-#define IP6_MIN_HEADLEN 40\r
-#define IP6_MAX_HEADLEN 120\r
+#define IP6_MIN_HEADLEN 40\r
+#define IP6_MAX_HEADLEN 120\r
///\r
/// 8(ESP header) + 16(max IV) + 16(max padding) + 2(ESP tail) + 12(max ICV) = 54\r
///\r
-#define IP6_MAX_IPSEC_HEADLEN 54\r
-\r
+#define IP6_MAX_IPSEC_HEADLEN 54\r
\r
-#define IP6_ASSEMLE_HASH_SIZE 127\r
+#define IP6_ASSEMLE_HASH_SIZE 127\r
///\r
/// Lift time in seconds.\r
///\r
-#define IP6_FRAGMENT_LIFE 60\r
-#define IP6_MAX_PACKET_SIZE 65535\r
-\r
+#define IP6_FRAGMENT_LIFE 60\r
+#define IP6_MAX_PACKET_SIZE 65535\r
\r
-#define IP6_GET_CLIP_INFO(Packet) ((IP6_CLIP_INFO *) ((Packet)->ProtoData))\r
+#define IP6_GET_CLIP_INFO(Packet) ((IP6_CLIP_INFO *) ((Packet)->ProtoData))\r
\r
#define IP6_ASSEMBLE_HASH(Dst, Src, Id) \\r
((*((UINT32 *) (Dst)) + *((UINT32 *) (Src)) + (Id)) % IP6_ASSEMLE_HASH_SIZE)\r
// life. If it isn't consumed before Life reaches zero, the packet is released.\r
//\r
typedef struct {\r
- UINT32 LinkFlag;\r
- INT32 CastType;\r
- INT32 Start;\r
- INT32 End;\r
- INT32 Length;\r
- UINT32 Life;\r
- EFI_STATUS Status;\r
- UINT32 Id;\r
- UINT16 HeadLen;\r
- UINT8 NextHeader;\r
- UINT8 LastFrag;\r
- UINT32 FormerNextHeader;\r
+ UINT32 LinkFlag;\r
+ INT32 CastType;\r
+ INT32 Start;\r
+ INT32 End;\r
+ INT32 Length;\r
+ UINT32 Life;\r
+ EFI_STATUS Status;\r
+ UINT32 Id;\r
+ UINT16 HeadLen;\r
+ UINT8 NextHeader;\r
+ UINT8 LastFrag;\r
+ UINT32 FormerNextHeader;\r
} IP6_CLIP_INFO;\r
\r
//\r
// Structure used to assemble IP packets.\r
//\r
typedef struct {\r
- LIST_ENTRY Link;\r
- LIST_ENTRY Fragments; // List of all the fragments of this packet\r
+ LIST_ENTRY Link;\r
+ LIST_ENTRY Fragments; // List of all the fragments of this packet\r
\r
//\r
// Identity of one IP6 packet. Each fragment of a packet has\r
// the same (Dst, Src, Id).\r
//\r
- EFI_IPv6_ADDRESS Dst;\r
- EFI_IPv6_ADDRESS Src;\r
- UINT32 Id;\r
+ EFI_IPv6_ADDRESS Dst;\r
+ EFI_IPv6_ADDRESS Src;\r
+ UINT32 Id;\r
\r
- UINT32 TotalLen;\r
- UINT32 CurLen;\r
- UINT32 Life; // Count down life for the packet.\r
+ UINT32 TotalLen;\r
+ UINT32 CurLen;\r
+ UINT32 Life; // Count down life for the packet.\r
\r
- EFI_IP6_HEADER *Head; // IP head of the first fragment\r
- IP6_CLIP_INFO *Info; // Per packet information of the first fragment\r
- NET_BUF *Packet; // The first fragment of the packet\r
+ EFI_IP6_HEADER *Head; // IP head of the first fragment\r
+ IP6_CLIP_INFO *Info; // Per packet information of the first fragment\r
+ NET_BUF *Packet; // The first fragment of the packet\r
} IP6_ASSEMBLE_ENTRY;\r
\r
//\r
// as hash table.\r
//\r
typedef struct {\r
- LIST_ENTRY Bucket[IP6_ASSEMLE_HASH_SIZE];\r
+ LIST_ENTRY Bucket[IP6_ASSEMLE_HASH_SIZE];\r
} IP6_ASSEMBLE_TABLE;\r
\r
/**\r
**/\r
VOID\r
Ip6AcceptFrame (\r
- IN NET_BUF *Packet,\r
- IN EFI_STATUS IoStatus,\r
- IN UINT32 Flag,\r
- IN VOID *Context\r
+ IN NET_BUF *Packet,\r
+ IN EFI_STATUS IoStatus,\r
+ IN UINT32 Flag,\r
+ IN VOID *Context\r
);\r
\r
/**\r
**/\r
EFI_STATUS\r
Ip6InstanceDeliverPacket (\r
- IN IP6_PROTOCOL *IpInstance\r
+ IN IP6_PROTOCOL *IpInstance\r
);\r
\r
/**\r
@retval EFI_SUCCESS The packet was bypassed, and all buffers remain the same.\r
@retval EFI_SUCCESS The packet was protected.\r
@retval EFI_ACCESS_DENIED The packet was discarded.\r
- @retval EFI_OUT_OF_RESOURCES There are not suffcient resources to complete the operation.\r
+ @retval EFI_OUT_OF_RESOURCES There are not sufficient resources to complete the operation.\r
@retval EFI_BUFFER_TOO_SMALL The number of non-empty blocks is bigger than the\r
number of input data blocks when building a fragment table.\r
\r
**/\r
VOID\r
Ip6CreateAssembleTable (\r
- IN OUT IP6_ASSEMBLE_TABLE *Table\r
+ IN OUT IP6_ASSEMBLE_TABLE *Table\r
);\r
\r
/**\r
**/\r
VOID\r
Ip6CleanAssembleTable (\r
- IN OUT IP6_ASSEMBLE_TABLE *Table\r
+ IN OUT IP6_ASSEMBLE_TABLE *Table\r
);\r
\r
/**\r
Demultiple the packet. the packet delivery is processed in two\r
- passes. The first pass will enque a shared copy of the packet\r
+ passes. The first pass will enqueue a shared copy of the packet\r
to each IP6 child that accepts the packet. The second pass will\r
deliver a non-shared copy of the packet to each IP6 child that\r
has pending receive requests. Data is copied if more than one\r
- child wants to consume the packet bacause each IP child need\r
+ child wants to consume the packet because each IP child need\r
its own copy of the packet to make changes.\r
\r
@param[in] IpSb The IP6 service instance that received the packet.\r
**/\r
EFI_STATUS\r
Ip6Demultiplex (\r
- IN IP6_SERVICE *IpSb,\r
- IN EFI_IP6_HEADER *Head,\r
- IN NET_BUF *Packet\r
+ IN IP6_SERVICE *IpSb,\r
+ IN EFI_IP6_HEADER *Head,\r
+ IN NET_BUF *Packet\r
);\r
\r
/**\r
**/\r
VOID\r
Ip6PacketTimerTicking (\r
- IN IP6_SERVICE *IpSb\r
+ IN IP6_SERVICE *IpSb\r
);\r
\r
#endif\r