3 Copyright (c) 2005 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 Header file for ICMP protocol.
24 #ifndef __EFI_IP4_ICMP_H__
25 #define __EFI_IP4_ICMP_H__
29 // ICMP type definations
32 ICMP_DEST_UNREACHABLE
= 3,
33 ICMP_SOURCE_QUENCH
= 4,
35 ICMP_ECHO_REQUEST
= 8,
36 ICMP_TIME_EXCEEDED
= 11,
37 ICMP_PARAMETER_PROBLEM
= 12,
39 ICMP_INFO_REQUEST
= 15,
41 ICMP_TYPE_MAX
= ICMP_INFO_REPLY
,
43 ICMP_DEFAULT_CODE
= 0,
46 // ICMP code definations for ICMP_DEST_UNREACHABLE
48 ICMP_NET_UNREACHABLE
= 0,
49 ICMP_HOST_UNREACHABLE
= 1,
50 ICMP_PROTO_UNREACHABLE
= 2, // Host may generate
51 ICMP_PORT_UNREACHABLE
= 3, // Host may generate
52 ICMP_FRAGMENT_FAILED
= 4,
53 ICMP_SOURCEROUTE_FAILED
= 5, // Host may generate
55 ICMP_HOST_UNKNOWN
= 7,
56 ICMP_SOURCE_ISOLATED
= 8,
57 ICMP_NET_PROHIBITED
= 9,
58 ICMP_HOST_PROHIBITED
= 10,
59 ICMP_NET_UNREACHABLE_TOS
= 11,
60 ICMP_HOST_UNREACHABLE_TOS
= 12,
63 // ICMP code definations for ICMP_TIME_EXCEEDED
65 ICMP_TIMEOUT_IN_TRANSIT
= 0,
66 ICMp_TIMEOUT_REASSEMBLE
= 1, // Host may generate
69 // ICMP code definations for ICMP_TIME_EXCEEDED
71 ICMP_NET_REDIRECT
= 0,
72 ICMP_HOST_REDIRECT
= 1,
73 ICMP_NET_TOS_REDIRECT
= 2,
74 ICMP_HOST_TOS_REDIRECT
= 3,
77 // ICMP message classes, each class of ICMP message shares
78 // a common message format. INVALID_MESSAGE is only a flag.
80 ICMP_INVALID_MESSAGE
= 0,
81 ICMP_ERROR_MESSAGE
= 1,
82 ICMP_QUERY_MESSAGE
= 2
90 extern IP4_ICMP_CLASS mIcmpClass
[];
91 extern EFI_IP4_ICMP_TYPE mIp4SupportedIcmp
[];
94 Handle the ICMP packet. First validate the message format,
95 then according to the message types, process it as query or
98 @param IpSb The IP service that receivd the packet
99 @param Head The IP head of the ICMP query packet
100 @param Packet The content of the ICMP query with IP head
103 @retval EFI_INVALID_PARAMETER The packet is malformated.
104 @retval EFI_SUCCESS The ICMP message is successfully processed.
105 @retval Others Failed to handle ICMP packet.
110 IN IP4_SERVICE
*IpSb
,