]> git.ipfire.org Git - thirdparty/squid.git/blob - src/icmp/IcmpPinger.h
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / icmp / IcmpPinger.h
1 /*
2 * Copyright (C) 1996-2018 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_ICMPPINGER_H
12 #define _INCLUDE_ICMPPINGER_H
13 #include "Icmp.h"
14
15 /**
16 * Implements the interface to squid for ICMP operations
17 */
18 class IcmpPinger : public Icmp
19 {
20 public:
21 IcmpPinger();
22 virtual ~IcmpPinger();
23
24 /// Start and initiate control channel to squid
25 virtual int Open();
26
27 /// Shutdown pinger helper and control channel
28 virtual void Close();
29
30 #if USE_ICMP
31
32 /// Send ICMP results back to squid.
33 void SendResult(pingerReplyData &preply, int len);
34
35 /// Handle ICMP requests from squid, passing to helpers.
36 virtual void Recv(void);
37
38 private:
39 // unused in IcmpPinger
40 virtual void SendEcho(Ip::Address &to, int opcode, const char *payload, int len) {};
41
42 /**
43 * Control channel(s) to squid.
44 * May be STDIN/STDOUT pipes or an IP socket depending on the OS
45 */
46 int socket_from_squid;
47 int socket_to_squid;
48 #endif /* USE_ICMP */
49 };
50
51 #if USE_ICMP
52
53 /// pinger helper contains one of these as a global object.
54 extern IcmpPinger control;
55
56 #endif
57
58 #endif
59