]>
Commit | Line | Data |
---|---|---|
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 | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php.\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __EFI_IP6_ICMP_H__\r | |
17 | #define __EFI_IP6_ICMP_H__\r | |
18 | \r | |
19 | #define ICMP_V6_DEFAULT_CODE 0\r | |
20 | \r | |
21 | #define ICMP_V6_ERROR_MAX 127\r | |
22 | \r | |
23 | //\r | |
24 | // ICMPv6 message classes, each class of ICMPv6 message shares\r | |
25 | // a common message format. INVALID_MESSAGE is only a flag.\r | |
26 | //\r | |
27 | #define ICMP_V6_INVALID_MESSAGE 0\r | |
28 | #define ICMP_V6_ERROR_MESSAGE 1\r | |
29 | #define ICMP_V6_INFORMATION_MESSAGE 2\r | |
30 | \r | |
31 | \r | |
32 | extern EFI_IP6_ICMP_TYPE mIp6SupportedIcmp[];\r | |
33 | \r | |
34 | /**\r | |
35 | Handle the ICMPv6 packet. First validate the message format,\r | |
36 | then, according to the message types, process it as an informational packet or\r | |
37 | an error packet.\r | |
38 | \r | |
39 | @param[in] IpSb The IP service that received the packet.\r | |
40 | @param[in] Head The IP head of the ICMPv6 packet.\r | |
41 | @param[in] Packet The content of the ICMPv6 packet with IP head\r | |
42 | removed.\r | |
43 | \r | |
44 | @retval EFI_INVALID_PARAMETER The packet is malformated.\r | |
45 | @retval EFI_SUCCESS The ICMPv6 message successfully processed.\r | |
46 | @retval Others Failed to handle the ICMPv6 packet.\r | |
47 | \r | |
48 | **/\r | |
49 | EFI_STATUS\r | |
50 | Ip6IcmpHandle (\r | |
51 | IN IP6_SERVICE *IpSb,\r | |
52 | IN EFI_IP6_HEADER *Head,\r | |
53 | IN NET_BUF *Packet\r | |
54 | );\r | |
55 | \r | |
56 | /**\r | |
57 | Check whether the DestinationAddress is an anycast address.\r | |
58 | \r | |
59 | @param[in] IpSb The IP service that received the packet.\r | |
60 | @param[in] DestinationAddress Points to the Destination Address of the packet.\r | |
61 | \r | |
62 | @retval TRUE The DestinationAddress is anycast address.\r | |
63 | @retval FALSE The DestinationAddress is not anycast address.\r | |
64 | \r | |
65 | **/\r | |
66 | BOOLEAN\r | |
67 | Ip6IsAnycast (\r | |
68 | IN IP6_SERVICE *IpSb,\r | |
69 | IN EFI_IPv6_ADDRESS *DestinationAddress\r | |
70 | );\r | |
71 | \r | |
72 | /**\r | |
73 | Generate ICMPv6 error message and send it out to DestinationAddress. Currently\r | |
74 | Destination Unreachable message, Time Exceeded message and Parameter Problem\r | |
75 | message are supported.\r | |
76 | \r | |
77 | @param[in] IpSb The IP service that received the packet.\r | |
78 | @param[in] Packet The packet which invoking ICMPv6 error.\r | |
79 | @param[in] SourceAddress If not NULL, points to the SourceAddress.\r | |
80 | Otherwise, the IP layer will select a source address\r | |
81 | according to the DestinationAddress.\r | |
82 | @param[in] DestinationAddress Points to the Destination Address of the ICMPv6\r | |
83 | error message.\r | |
84 | @param[in] Type The type of the ICMPv6 message.\r | |
85 | @param[in] Code The additional level of the ICMPv6 message.\r | |
86 | @param[in] Pointer If not NULL, identifies the octet offset within\r | |
87 | the invoking packet where the error was detected.\r | |
88 | \r | |
89 | @retval EFI_INVALID_PARAMETER The packet is malformated.\r | |
90 | @retval EFI_OUT_OF_RESOURCES There is no sufficient resource to complete the\r | |
91 | operation.\r | |
92 | @retval EFI_SUCCESS The ICMPv6 message was successfully sent out.\r | |
93 | @retval Others Failed to generate the ICMPv6 packet.\r | |
94 | \r | |
95 | **/\r | |
96 | EFI_STATUS\r | |
97 | Ip6SendIcmpError (\r | |
98 | IN IP6_SERVICE *IpSb,\r | |
99 | IN NET_BUF *Packet,\r | |
100 | IN EFI_IPv6_ADDRESS *SourceAddress OPTIONAL,\r | |
101 | IN EFI_IPv6_ADDRESS *DestinationAddress,\r | |
102 | IN UINT8 Type,\r | |
103 | IN UINT8 Code,\r | |
104 | IN UINT32 *Pointer OPTIONAL\r | |
105 | );\r | |
106 | \r | |
107 | #endif\r | |
108 | \r |