]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/Ip6Dxe/Ip6Icmp.h
BaseTools: Refactor hash tracking after checking for Sources section
[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
13#define ICMP_V6_DEFAULT_CODE 0\r
14\r
15#define ICMP_V6_ERROR_MAX 127\r
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
21#define ICMP_V6_INVALID_MESSAGE 0\r
22#define ICMP_V6_ERROR_MESSAGE 1\r
23#define ICMP_V6_INFORMATION_MESSAGE 2\r
24\r
25\r
26extern EFI_IP6_ICMP_TYPE mIp6SupportedIcmp[];\r
27\r
28/**\r
29 Handle the ICMPv6 packet. First validate the message format,\r
30 then, according to the message types, process it as an informational packet or\r
31 an error packet.\r
32\r
33 @param[in] IpSb The IP service that received the packet.\r
34 @param[in] Head The IP head of the ICMPv6 packet.\r
35 @param[in] Packet The content of the ICMPv6 packet with IP head\r
36 removed.\r
37\r
38 @retval EFI_INVALID_PARAMETER The packet is malformated.\r
39 @retval EFI_SUCCESS The ICMPv6 message successfully processed.\r
40 @retval Others Failed to handle the ICMPv6 packet.\r
41\r
42**/\r
43EFI_STATUS\r
44Ip6IcmpHandle (\r
45 IN IP6_SERVICE *IpSb,\r
46 IN EFI_IP6_HEADER *Head,\r
47 IN NET_BUF *Packet\r
48 );\r
49\r
50/**\r
51 Check whether the DestinationAddress is an anycast address.\r
52\r
53 @param[in] IpSb The IP service that received the packet.\r
54 @param[in] DestinationAddress Points to the Destination Address of the packet.\r
55\r
56 @retval TRUE The DestinationAddress is anycast address.\r
57 @retval FALSE The DestinationAddress is not anycast address.\r
58\r
59**/\r
60BOOLEAN\r
61Ip6IsAnycast (\r
62 IN IP6_SERVICE *IpSb,\r
63 IN EFI_IPv6_ADDRESS *DestinationAddress\r
64 );\r
65\r
66/**\r
67 Generate ICMPv6 error message and send it out to DestinationAddress. Currently\r
68 Destination Unreachable message, Time Exceeded message and Parameter Problem\r
69 message are supported.\r
70\r
71 @param[in] IpSb The IP service that received the packet.\r
72 @param[in] Packet The packet which invoking ICMPv6 error.\r
73 @param[in] SourceAddress If not NULL, points to the SourceAddress.\r
74 Otherwise, the IP layer will select a source address\r
75 according to the DestinationAddress.\r
76 @param[in] DestinationAddress Points to the Destination Address of the ICMPv6\r
77 error message.\r
78 @param[in] Type The type of the ICMPv6 message.\r
79 @param[in] Code The additional level of the ICMPv6 message.\r
80 @param[in] Pointer If not NULL, identifies the octet offset within\r
81 the invoking packet where the error was detected.\r
82\r
83 @retval EFI_INVALID_PARAMETER The packet is malformated.\r
84 @retval EFI_OUT_OF_RESOURCES There is no sufficient resource to complete the\r
85 operation.\r
86 @retval EFI_SUCCESS The ICMPv6 message was successfully sent out.\r
87 @retval Others Failed to generate the ICMPv6 packet.\r
88\r
89**/\r
90EFI_STATUS\r
91Ip6SendIcmpError (\r
92 IN IP6_SERVICE *IpSb,\r
93 IN NET_BUF *Packet,\r
94 IN EFI_IPv6_ADDRESS *SourceAddress OPTIONAL,\r
95 IN EFI_IPv6_ADDRESS *DestinationAddress,\r
96 IN UINT8 Type,\r
97 IN UINT8 Code,\r
98 IN UINT32 *Pointer OPTIONAL\r
99 );\r
100\r
101#endif\r
102\r