]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/Ip6Dxe/Ip6Icmp.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / NetworkPkg / Ip6Dxe / Ip6Icmp.h
CommitLineData
a3bcde70
HT
1/** @file\r
2 Header file for ICMPv6 protocol.\r
3\r
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
5\r
ecf98fbc 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
a3bcde70
HT
7\r
8**/\r
9\r
10#ifndef __EFI_IP6_ICMP_H__\r
11#define __EFI_IP6_ICMP_H__\r
12\r
d1050b9d 13#define ICMP_V6_DEFAULT_CODE 0\r
a3bcde70 14\r
d1050b9d 15#define ICMP_V6_ERROR_MAX 127\r
a3bcde70
HT
16\r
17//\r
18// ICMPv6 message classes, each class of ICMPv6 message shares\r
19// a common message format. INVALID_MESSAGE is only a flag.\r
20//\r
d1050b9d
MK
21#define ICMP_V6_INVALID_MESSAGE 0\r
22#define ICMP_V6_ERROR_MESSAGE 1\r
23#define ICMP_V6_INFORMATION_MESSAGE 2\r
a3bcde70
HT
24\r
25extern EFI_IP6_ICMP_TYPE mIp6SupportedIcmp[];\r
26\r
27/**\r
28 Handle the ICMPv6 packet. First validate the message format,\r
29 then, according to the message types, process it as an informational packet or\r
30 an error packet.\r
31\r
32 @param[in] IpSb The IP service that received the packet.\r
33 @param[in] Head The IP head of the ICMPv6 packet.\r
34 @param[in] Packet The content of the ICMPv6 packet with IP head\r
35 removed.\r
36\r
8d774c74 37 @retval EFI_INVALID_PARAMETER The packet is malformatted.\r
a3bcde70
HT
38 @retval EFI_SUCCESS The ICMPv6 message successfully processed.\r
39 @retval Others Failed to handle the ICMPv6 packet.\r
40\r
41**/\r
42EFI_STATUS\r
43Ip6IcmpHandle (\r
d1050b9d
MK
44 IN IP6_SERVICE *IpSb,\r
45 IN EFI_IP6_HEADER *Head,\r
46 IN NET_BUF *Packet\r
a3bcde70
HT
47 );\r
48\r
49/**\r
50 Check whether the DestinationAddress is an anycast address.\r
51\r
52 @param[in] IpSb The IP service that received the packet.\r
53 @param[in] DestinationAddress Points to the Destination Address of the packet.\r
54\r
55 @retval TRUE The DestinationAddress is anycast address.\r
56 @retval FALSE The DestinationAddress is not anycast address.\r
57\r
58**/\r
59BOOLEAN\r
60Ip6IsAnycast (\r
d1050b9d
MK
61 IN IP6_SERVICE *IpSb,\r
62 IN EFI_IPv6_ADDRESS *DestinationAddress\r
a3bcde70
HT
63 );\r
64\r
65/**\r
66 Generate ICMPv6 error message and send it out to DestinationAddress. Currently\r
67 Destination Unreachable message, Time Exceeded message and Parameter Problem\r
68 message are supported.\r
69\r
70 @param[in] IpSb The IP service that received the packet.\r
71 @param[in] Packet The packet which invoking ICMPv6 error.\r
72 @param[in] SourceAddress If not NULL, points to the SourceAddress.\r
73 Otherwise, the IP layer will select a source address\r
74 according to the DestinationAddress.\r
75 @param[in] DestinationAddress Points to the Destination Address of the ICMPv6\r
76 error message.\r
77 @param[in] Type The type of the ICMPv6 message.\r
78 @param[in] Code The additional level of the ICMPv6 message.\r
79 @param[in] Pointer If not NULL, identifies the octet offset within\r
80 the invoking packet where the error was detected.\r
81\r
8d774c74 82 @retval EFI_INVALID_PARAMETER The packet is malformatted.\r
a3bcde70
HT
83 @retval EFI_OUT_OF_RESOURCES There is no sufficient resource to complete the\r
84 operation.\r
85 @retval EFI_SUCCESS The ICMPv6 message was successfully sent out.\r
86 @retval Others Failed to generate the ICMPv6 packet.\r
87\r
88**/\r
89EFI_STATUS\r
90Ip6SendIcmpError (\r
d1050b9d
MK
91 IN IP6_SERVICE *IpSb,\r
92 IN NET_BUF *Packet,\r
93 IN EFI_IPv6_ADDRESS *SourceAddress OPTIONAL,\r
94 IN EFI_IPv6_ADDRESS *DestinationAddress,\r
95 IN UINT8 Type,\r
96 IN UINT8 Code,\r
97 IN UINT32 *Pointer OPTIONAL\r
a3bcde70
HT
98 );\r
99\r
100#endif\r