2 Header file for ICMP protocol.
4 Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __EFI_IP4_ICMP_H__
16 #define __EFI_IP4_ICMP_H__
19 // ICMP type definations
21 #define ICMP_ECHO_REPLY 0
22 #define ICMP_DEST_UNREACHABLE 3
23 #define ICMP_SOURCE_QUENCH 4
24 #define ICMP_REDIRECT 5
25 #define ICMP_ECHO_REQUEST 8
26 #define ICMP_TIME_EXCEEDED 11
27 #define ICMP_PARAMETER_PROBLEM 12
28 #define ICMP_TIMESTAMP 13
29 #define ICMP_INFO_REQUEST 15
30 #define ICMP_INFO_REPLY 16
31 #define ICMP_TYPE_MAX ICMP_INFO_REPLY
33 #define ICMP_DEFAULT_CODE 0
36 // ICMP code definations for ICMP_DEST_UNREACHABLE
38 #define ICMP_NET_UNREACHABLE 0
39 #define ICMP_HOST_UNREACHABLE 1
40 #define ICMP_PROTO_UNREACHABLE 2 // Host may generate
41 #define ICMP_PORT_UNREACHABLE 3 // Host may generate
42 #define ICMP_FRAGMENT_FAILED 4
43 #define ICMP_SOURCEROUTE_FAILED 5 // Host may generate
44 #define ICMP_NET_UNKNOWN 6
45 #define ICMP_HOST_UNKNOWN 7
46 #define ICMP_SOURCE_ISOLATED 8
47 #define ICMP_NET_PROHIBITED 9
48 #define ICMP_HOST_PROHIBITED 10
49 #define ICMP_NET_UNREACHABLE_TOS 11
50 #define ICMP_HOST_UNREACHABLE_TOS 12
53 // ICMP code definations for ICMP_TIME_EXCEEDED
55 #define ICMP_TIMEOUT_IN_TRANSIT 0
56 #define ICMP_TIMEOUT_REASSEMBLE 1 // Host may generate
59 // ICMP code definations for ICMP_TIME_EXCEEDED
61 #define ICMP_NET_REDIRECT 0
62 #define ICMP_HOST_REDIRECT 1
63 #define ICMP_NET_TOS_REDIRECT 2
64 #define ICMP_HOST_TOS_REDIRECT 3
67 // ICMP message classes, each class of ICMP message shares
68 // a common message format. INVALID_MESSAGE is only a flag.
70 #define ICMP_INVALID_MESSAGE 0
71 #define ICMP_ERROR_MESSAGE 1
72 #define ICMP_QUERY_MESSAGE 2
79 extern IP4_ICMP_CLASS mIcmpClass
[];
80 extern EFI_IP4_ICMP_TYPE mIp4SupportedIcmp
[];
83 Handle the ICMP packet. First validate the message format,
84 then according to the message types, process it as query or
87 @param[in] IpSb The IP service that receivd the packet
88 @param[in] Head The IP head of the ICMP query packet
89 @param[in] Packet The content of the ICMP query with IP head
92 @retval EFI_INVALID_PARAMETER The packet is malformated.
93 @retval EFI_SUCCESS The ICMP message is successfully processed.
94 @retval Others Failed to handle ICMP packet.