]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.h
code scrub fix
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Icmp.h
1 /** @file
2 Header file for ICMP protocol.
3
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
9
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.
12
13 **/
14
15 #ifndef __EFI_IP4_ICMP_H__
16 #define __EFI_IP4_ICMP_H__
17
18 typedef enum {
19 //
20 // ICMP type definations
21 //
22 ICMP_ECHO_REPLY = 0,
23 ICMP_DEST_UNREACHABLE = 3,
24 ICMP_SOURCE_QUENCH = 4,
25 ICMP_REDIRECT = 5,
26 ICMP_ECHO_REQUEST = 8,
27 ICMP_TIME_EXCEEDED = 11,
28 ICMP_PARAMETER_PROBLEM = 12,
29 ICMP_TIMESTAMP = 13,
30 ICMP_INFO_REQUEST = 15,
31 ICMP_INFO_REPLY = 16,
32 ICMP_TYPE_MAX = ICMP_INFO_REPLY,
33
34 ICMP_DEFAULT_CODE = 0,
35
36 //
37 // ICMP code definations for ICMP_DEST_UNREACHABLE
38 //
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
45 ICMP_NET_UNKNOWN = 6,
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,
52
53 //
54 // ICMP code definations for ICMP_TIME_EXCEEDED
55 //
56 ICMP_TIMEOUT_IN_TRANSIT = 0,
57 ICMp_TIMEOUT_REASSEMBLE = 1, // Host may generate
58
59 //
60 // ICMP code definations for ICMP_TIME_EXCEEDED
61 //
62 ICMP_NET_REDIRECT = 0,
63 ICMP_HOST_REDIRECT = 1,
64 ICMP_NET_TOS_REDIRECT = 2,
65 ICMP_HOST_TOS_REDIRECT = 3,
66
67 //
68 // ICMP message classes, each class of ICMP message shares
69 // a common message format. INVALID_MESSAGE is only a flag.
70 //
71 ICMP_INVALID_MESSAGE = 0,
72 ICMP_ERROR_MESSAGE = 1,
73 ICMP_QUERY_MESSAGE = 2
74 } ICMP_ENUM_TYPES;
75
76 typedef struct {
77 UINT8 IcmpType;
78 UINT8 IcmpClass;
79 } IP4_ICMP_CLASS;
80
81 extern IP4_ICMP_CLASS mIcmpClass[];
82 extern EFI_IP4_ICMP_TYPE mIp4SupportedIcmp[];
83
84 /**
85 Handle the ICMP packet. First validate the message format,
86 then according to the message types, process it as query or
87 error packet.
88
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
92 removed.
93
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.
97
98 **/
99 EFI_STATUS
100 Ip4IcmpHandle (
101 IN IP4_SERVICE *IpSb,
102 IN IP4_HEAD *Head,
103 IN NET_BUF *Packet
104 );
105 #endif