2 Header file for ICMP protocol.
4 Copyright (c) 2005 - 2006, Intel Corporation.<BR>
5 All rights reserved. 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__
20 // ICMP type definations
23 ICMP_DEST_UNREACHABLE
= 3,
24 ICMP_SOURCE_QUENCH
= 4,
26 ICMP_ECHO_REQUEST
= 8,
27 ICMP_TIME_EXCEEDED
= 11,
28 ICMP_PARAMETER_PROBLEM
= 12,
30 ICMP_INFO_REQUEST
= 15,
32 ICMP_TYPE_MAX
= ICMP_INFO_REPLY
,
34 ICMP_DEFAULT_CODE
= 0,
37 // ICMP code definations for ICMP_DEST_UNREACHABLE
39 ICMP_NET_UNREACHABLE
= 0,
40 ICMP_HOST_UNREACHABLE
= 1,
41 ICMP_PROTO_UNREACHABLE
= 2, // Host may generate
42 ICMP_PORT_UNREACHABLE
= 3, // Host may generate
43 ICMP_FRAGMENT_FAILED
= 4,
44 ICMP_SOURCEROUTE_FAILED
= 5, // Host may generate
46 ICMP_HOST_UNKNOWN
= 7,
47 ICMP_SOURCE_ISOLATED
= 8,
48 ICMP_NET_PROHIBITED
= 9,
49 ICMP_HOST_PROHIBITED
= 10,
50 ICMP_NET_UNREACHABLE_TOS
= 11,
51 ICMP_HOST_UNREACHABLE_TOS
= 12,
54 // ICMP code definations for ICMP_TIME_EXCEEDED
56 ICMP_TIMEOUT_IN_TRANSIT
= 0,
57 ICMp_TIMEOUT_REASSEMBLE
= 1, // Host may generate
60 // ICMP code definations for ICMP_TIME_EXCEEDED
62 ICMP_NET_REDIRECT
= 0,
63 ICMP_HOST_REDIRECT
= 1,
64 ICMP_NET_TOS_REDIRECT
= 2,
65 ICMP_HOST_TOS_REDIRECT
= 3,
68 // ICMP message classes, each class of ICMP message shares
69 // a common message format. INVALID_MESSAGE is only a flag.
71 ICMP_INVALID_MESSAGE
= 0,
72 ICMP_ERROR_MESSAGE
= 1,
73 ICMP_QUERY_MESSAGE
= 2
81 extern IP4_ICMP_CLASS mIcmpClass
[];
82 extern EFI_IP4_ICMP_TYPE mIp4SupportedIcmp
[];
85 Handle the ICMP packet. First validate the message format,
86 then according to the message types, process it as query or
89 @param[in] IpSb The IP service that receivd the packet
90 @param[in] Head The IP head of the ICMP query packet
91 @param[in] Packet The content of the ICMP query with IP head
94 @retval EFI_INVALID_PARAMETER The packet is malformated.
95 @retval EFI_SUCCESS The ICMP message is successfully processed.
96 @retval Others Failed to handle ICMP packet.
101 IN IP4_SERVICE
*IpSb
,