]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.h
code scrub fix
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Icmp.h
index 366b02c176305951e1211aec0ac86a4f86554d00..f9db6a3da4fd78f750b48cd9616d6edc4e1a3708 100644 (file)
-/** @file
-
-Copyright (c) 2005 - 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-
-Module Name:
-
-  Ip4Icmp.h
-
-Abstract:
-
-  Header file for ICMP protocol.
-
-
-**/
-
-#ifndef __EFI_IP4_ICMP_H__
-#define __EFI_IP4_ICMP_H__
-
-enum {
-  //
-  // ICMP type definations
-  //
-  ICMP_ECHO_REPLY           = 0,
-  ICMP_DEST_UNREACHABLE     = 3,
-  ICMP_SOURCE_QUENCH        = 4,
-  ICMP_REDIRECT             = 5,
-  ICMP_ECHO_REQUEST         = 8,
-  ICMP_TIME_EXCEEDED        = 11,
-  ICMP_PARAMETER_PROBLEM    = 12,
-  ICMP_TIMESTAMP            = 13,
-  ICMP_INFO_REQUEST         = 15,
-  ICMP_INFO_REPLY           = 16,
-  ICMP_TYPE_MAX             = ICMP_INFO_REPLY,
-
-  ICMP_DEFAULT_CODE         = 0,
-
-  //
-  // ICMP code definations for ICMP_DEST_UNREACHABLE
-  //
-  ICMP_NET_UNREACHABLE      = 0,
-  ICMP_HOST_UNREACHABLE     = 1,
-  ICMP_PROTO_UNREACHABLE    = 2,  // Host may generate
-  ICMP_PORT_UNREACHABLE     = 3,  // Host may generate
-  ICMP_FRAGMENT_FAILED      = 4,
-  ICMP_SOURCEROUTE_FAILED   = 5,  // Host may generate
-  ICMP_NET_UNKNOWN          = 6,
-  ICMP_HOST_UNKNOWN         = 7,
-  ICMP_SOURCE_ISOLATED      = 8,
-  ICMP_NET_PROHIBITED       = 9,
-  ICMP_HOST_PROHIBITED      = 10,
-  ICMP_NET_UNREACHABLE_TOS  = 11,
-  ICMP_HOST_UNREACHABLE_TOS = 12,
-
-  //
-  // ICMP code definations for ICMP_TIME_EXCEEDED
-  //
-  ICMP_TIMEOUT_IN_TRANSIT   = 0,
-  ICMp_TIMEOUT_REASSEMBLE   = 1,  // Host may generate
-
-  //
-  // ICMP code definations for ICMP_TIME_EXCEEDED
-  //
-  ICMP_NET_REDIRECT         = 0,
-  ICMP_HOST_REDIRECT        = 1,
-  ICMP_NET_TOS_REDIRECT     = 2,
-  ICMP_HOST_TOS_REDIRECT    = 3,
-
-  //
-  // ICMP message classes, each class of ICMP message shares
-  // a common message format. INVALID_MESSAGE is only a flag.
-  //
-  ICMP_INVALID_MESSAGE      = 0,
-  ICMP_ERROR_MESSAGE        = 1,
-  ICMP_QUERY_MESSAGE        = 2
-};
-
-typedef struct {
-  UINT8                   IcmpType;
-  UINT8                   IcmpClass;
-} IP4_ICMP_CLASS;
-
-extern IP4_ICMP_CLASS     mIcmpClass[];
-extern EFI_IP4_ICMP_TYPE  mIp4SupportedIcmp[];
-
-EFI_STATUS
-Ip4IcmpHandle (
-  IN IP4_SERVICE          *IpSb,
-  IN IP4_HEAD             *Header,
-  IN NET_BUF              *Packet
-  );
-#endif
+/** @file\r
+  Header file for ICMP protocol.\r
+  \r
+Copyright (c) 2005 - 2006, Intel Corporation.<BR>\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __EFI_IP4_ICMP_H__\r
+#define __EFI_IP4_ICMP_H__\r
+\r
+typedef enum {\r
+  //\r
+  // ICMP type definations\r
+  //\r
+  ICMP_ECHO_REPLY           = 0,\r
+  ICMP_DEST_UNREACHABLE     = 3,\r
+  ICMP_SOURCE_QUENCH        = 4,\r
+  ICMP_REDIRECT             = 5,\r
+  ICMP_ECHO_REQUEST         = 8,\r
+  ICMP_TIME_EXCEEDED        = 11,\r
+  ICMP_PARAMETER_PROBLEM    = 12,\r
+  ICMP_TIMESTAMP            = 13,\r
+  ICMP_INFO_REQUEST         = 15,\r
+  ICMP_INFO_REPLY           = 16,\r
+  ICMP_TYPE_MAX             = ICMP_INFO_REPLY,\r
+\r
+  ICMP_DEFAULT_CODE         = 0,\r
+\r
+  //\r
+  // ICMP code definations for ICMP_DEST_UNREACHABLE\r
+  //\r
+  ICMP_NET_UNREACHABLE      = 0,\r
+  ICMP_HOST_UNREACHABLE     = 1,\r
+  ICMP_PROTO_UNREACHABLE    = 2,  // Host may generate\r
+  ICMP_PORT_UNREACHABLE     = 3,  // Host may generate\r
+  ICMP_FRAGMENT_FAILED      = 4,\r
+  ICMP_SOURCEROUTE_FAILED   = 5,  // Host may generate\r
+  ICMP_NET_UNKNOWN          = 6,\r
+  ICMP_HOST_UNKNOWN         = 7,\r
+  ICMP_SOURCE_ISOLATED      = 8,\r
+  ICMP_NET_PROHIBITED       = 9,\r
+  ICMP_HOST_PROHIBITED      = 10,\r
+  ICMP_NET_UNREACHABLE_TOS  = 11,\r
+  ICMP_HOST_UNREACHABLE_TOS = 12,\r
+\r
+  //\r
+  // ICMP code definations for ICMP_TIME_EXCEEDED\r
+  //\r
+  ICMP_TIMEOUT_IN_TRANSIT   = 0,\r
+  ICMp_TIMEOUT_REASSEMBLE   = 1,  // Host may generate\r
+\r
+  //\r
+  // ICMP code definations for ICMP_TIME_EXCEEDED\r
+  //\r
+  ICMP_NET_REDIRECT         = 0,\r
+  ICMP_HOST_REDIRECT        = 1,\r
+  ICMP_NET_TOS_REDIRECT     = 2,\r
+  ICMP_HOST_TOS_REDIRECT    = 3,\r
+\r
+  //\r
+  // ICMP message classes, each class of ICMP message shares\r
+  // a common message format. INVALID_MESSAGE is only a flag.\r
+  //\r
+  ICMP_INVALID_MESSAGE      = 0,\r
+  ICMP_ERROR_MESSAGE        = 1,\r
+  ICMP_QUERY_MESSAGE        = 2\r
+} ICMP_ENUM_TYPES;\r
+\r
+typedef struct {\r
+  UINT8                   IcmpType;\r
+  UINT8                   IcmpClass;\r
+} IP4_ICMP_CLASS;\r
+\r
+extern IP4_ICMP_CLASS     mIcmpClass[];\r
+extern EFI_IP4_ICMP_TYPE  mIp4SupportedIcmp[];\r
+\r
+/**\r
+  Handle the ICMP packet. First validate the message format,\r
+  then according to the message types, process it as query or\r
+  error packet.\r
+\r
+  @param[in]  IpSb               The IP service that receivd the packet\r
+  @param[in]  Head               The IP head of the ICMP query packet\r
+  @param[in]  Packet             The content of the ICMP query with IP head\r
+                                 removed.\r
+\r
+  @retval EFI_INVALID_PARAMETER  The packet is malformated.\r
+  @retval EFI_SUCCESS            The ICMP message is successfully processed.\r
+  @retval Others                 Failed to handle ICMP packet.\r
+\r
+**/\r
+EFI_STATUS\r
+Ip4IcmpHandle (\r
+  IN IP4_SERVICE            *IpSb,\r
+  IN IP4_HEAD               *Head,\r
+  IN NET_BUF                *Packet\r
+  );\r
+#endif\r