]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.h
BaseTools:Change the path of the file that Binary Cache
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Icmp.h
1 /** @file
2 Header file for ICMP protocol.
3
4 Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef __EFI_IP4_ICMP_H__
10 #define __EFI_IP4_ICMP_H__
11
12 //
13 // ICMP type definations
14 //
15 #define ICMP_ECHO_REPLY 0
16 #define ICMP_DEST_UNREACHABLE 3
17 #define ICMP_SOURCE_QUENCH 4
18 #define ICMP_REDIRECT 5
19 #define ICMP_ECHO_REQUEST 8
20 #define ICMP_TIME_EXCEEDED 11
21 #define ICMP_PARAMETER_PROBLEM 12
22 #define ICMP_TIMESTAMP 13
23 #define ICMP_INFO_REQUEST 15
24 #define ICMP_INFO_REPLY 16
25 #define ICMP_TYPE_MAX ICMP_INFO_REPLY
26
27 #define ICMP_DEFAULT_CODE 0
28
29 //
30 // ICMP code definations for ICMP_DEST_UNREACHABLE
31 //
32 #define ICMP_NET_UNREACHABLE 0
33 #define ICMP_HOST_UNREACHABLE 1
34 #define ICMP_PROTO_UNREACHABLE 2 // Host may generate
35 #define ICMP_PORT_UNREACHABLE 3 // Host may generate
36 #define ICMP_FRAGMENT_FAILED 4
37 #define ICMP_SOURCEROUTE_FAILED 5 // Host may generate
38 #define ICMP_NET_UNKNOWN 6
39 #define ICMP_HOST_UNKNOWN 7
40 #define ICMP_SOURCE_ISOLATED 8
41 #define ICMP_NET_PROHIBITED 9
42 #define ICMP_HOST_PROHIBITED 10
43 #define ICMP_NET_UNREACHABLE_TOS 11
44 #define ICMP_HOST_UNREACHABLE_TOS 12
45
46 //
47 // ICMP code definations for ICMP_TIME_EXCEEDED
48 //
49 #define ICMP_TIMEOUT_IN_TRANSIT 0
50 #define ICMP_TIMEOUT_REASSEMBLE 1 // Host may generate
51
52 //
53 // ICMP code definations for ICMP_TIME_EXCEEDED
54 //
55 #define ICMP_NET_REDIRECT 0
56 #define ICMP_HOST_REDIRECT 1
57 #define ICMP_NET_TOS_REDIRECT 2
58 #define ICMP_HOST_TOS_REDIRECT 3
59
60 //
61 // ICMP message classes, each class of ICMP message shares
62 // a common message format. INVALID_MESSAGE is only a flag.
63 //
64 #define ICMP_INVALID_MESSAGE 0
65 #define ICMP_ERROR_MESSAGE 1
66 #define ICMP_QUERY_MESSAGE 2
67
68 typedef struct {
69 UINT8 IcmpType;
70 UINT8 IcmpClass;
71 } IP4_ICMP_CLASS;
72
73 extern IP4_ICMP_CLASS mIcmpClass[];
74 extern EFI_IP4_ICMP_TYPE mIp4SupportedIcmp[];
75
76 /**
77 Handle the ICMP packet. First validate the message format,
78 then according to the message types, process it as query or
79 error packet.
80
81 @param[in] IpSb The IP4 service that receivd the packet.
82 @param[in] Head The IP4 head of the ICMP query packet.
83 @param[in] Packet The content of the ICMP query with IP4 head
84 removed.
85
86 @retval EFI_INVALID_PARAMETER The packet is malformated.
87 @retval EFI_SUCCESS The ICMP message is successfully processed.
88 @retval Others Failed to handle ICMP packet.
89
90 **/
91 EFI_STATUS
92 Ip4IcmpHandle (
93 IN IP4_SERVICE *IpSb,
94 IN IP4_HEAD *Head,
95 IN NET_BUF *Packet
96 );
97 #endif