]> git.ipfire.org Git - thirdparty/squid.git/blob - src/icmp/Icmp6.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / icmp / Icmp6.h
1 /*
2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 /* DEBUG: section 37 ICMP Routines */
10
11 #ifndef _INCLUDE_ICMPV6_H
12 #define _INCLUDE_ICMPV6_H
13
14 #include "Icmp.h"
15
16 #if HAVE_NETINET_IN_H
17 #include <netinet/in.h>
18 #endif
19 #if HAVE_NETINET_ICMP6_H
20 #include <netinet/icmp6.h>
21 #endif
22 #if HAVE_NETINET_IP6_H
23 #include <netinet/ip6.h>
24 #endif
25
26 /* see RFC 4443 section 2.1 */
27 #ifndef ICMP6_ECHOREQUEST
28 #define ICMP6_ECHOREQUEST 128
29 #endif
30
31 /* see RFC 4443 section 2.1 */
32 #ifndef ICMP6_ECHOREPLY
33 #define ICMP6_ECHOREPLY 129
34 #endif
35
36 /* see RFC 4443 section 2.1 */
37 #ifndef IPPROTO_ICMPV6
38 #define IPPROTO_ICMPV6 58
39 #endif
40
41 /**
42 * Class partially implementing RFC 4443 - ICMPv6 for IP version 6.
43 * Provides ECHO-REQUEST, ECHO-REPLY (secion 4)
44 */
45 class Icmp6 : public Icmp
46 {
47 public:
48 Icmp6();
49 virtual ~Icmp6();
50
51 virtual int Open();
52
53 #if USE_ICMP
54 virtual void SendEcho(Ip::Address &, int, const char*, int);
55 virtual void Recv(void);
56 #endif
57 };
58
59 #if USE_ICMP
60
61 /// pinger helper contains one of these as a global object.
62 extern Icmp6 icmp6;
63
64 #endif /* USE_ICMP && SQUID_HELPER */
65 #endif /* _INCLUDE_ICMPV6_H */
66