]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/icmp/Icmp.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / icmp / Icmp.h
index 3484acd15ac3697f845850ea9f99473d2faa99d6..8ac94d172ced24f12c00896bd9ed04664907b886 100644 (file)
@@ -1,47 +1,23 @@
 /*
- * DEBUG: section 37    ICMP Routines
- * AUTHOR: Duane Wessels, Amos Jeffries
- *
- * SQUID Web Proxy Cache          http://www.squid-cache.org/
- * ----------------------------------------------------------
- *
- *  Squid is the result of efforts by numerous individuals from
- *  the Internet community; see the CONTRIBUTORS file for full
- *  details.   Many organizations have provided support for Squid's
- *  development; see the SPONSORS file for full details.  Squid is
- *  Copyrighted (C) 2001 by the Regents of the University of
- *  California; see the COPYRIGHT file for full details.  Squid
- *  incorporates software developed and/or copyrighted by other
- *  sources; see the CREDITS file for full details.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
  *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
  */
+
+/* DEBUG: section 37    ICMP Routines */
+
 #ifndef _INCLUDE_ICMP_H
 #define _INCLUDE_ICMP_H
 
-#include "config.h"
 #include "ip/Address.h"
 
-#define PINGER_PAYLOAD_SZ      8192
+#define PINGER_PAYLOAD_SZ   8192
 
 #define MAX_PAYLOAD 256 // WAS: SQUIDHOSTNAMELEN
 #define MAX_PKT4_SZ (MAX_PAYLOAD + sizeof(struct timeval) + sizeof (char) + sizeof(struct icmphdr) + 1)
-#if USE_IPV6
 #define MAX_PKT6_SZ (MAX_PAYLOAD + sizeof(struct timeval) + sizeof (char) + sizeof(struct icmp6_hdr) + 1)
-#endif
 
 #if USE_ICMP
 
@@ -69,11 +45,10 @@ struct icmpEchoData {
     char payload[MAX_PAYLOAD];
 };
 
-SQUIDCEXTERN int icmp_pkts_sent;
+extern int icmp_pkts_sent;
 
 #endif /* USE_ICMP */
 
-
 /**
  * Implements the squid interface to access ICMP operations
  *
@@ -123,13 +98,13 @@ protected:
     /**
      * Translate TTL to a hop distance
      *
-     \param ttl        negative     : n > 33
-     \param ttl        n(0...32)    : 32 >= n >= 1
-     \param ttl        n(33...62)   : 32 >= n >= 1
-     \param ttl        n(63...64)   : 2 >= n >= 1
-     \param ttl        n(65...128)  : 64 >= n >= 1
-     \param ttl        n(129...192) : 64 >= n >= 1
-     \param ttl        n(193...)    : n < 255
+     \param ttl negative     : n > 33
+     \param ttl n(0...32)    : 32 >= n >= 1
+     \param ttl n(33...62)   : 32 >= n >= 1
+     \param ttl n(63...64)   : 2 >= n >= 1
+     \param ttl n(65...128)  : 64 >= n >= 1
+     \param ttl n(129...192) : 64 >= n >= 1
+     \param ttl n(193...)    : n < 255
      *
      \bug BUG? ttl<0 can produce high hop values
      \bug BUG? ttl>255 can produce zero or negative hop values
@@ -137,7 +112,7 @@ protected:
     int ipHops(int ttl);
 
     /// Log the packet.
-    void Log(const Ip::Address &addr, const u_int8_t type, const char* pkt_str, const int rtt, const int hops);
+    void Log(const Ip::Address &addr, const uint8_t type, const char* pkt_str, const int rtt, const int hops);
 
     /* no use wasting memory */
     int icmp_sock;
@@ -146,3 +121,4 @@ protected:
 };
 
 #endif
+