]>
Commit | Line | Data |
---|---|---|
cc192b50 | 1 | /* |
bbc27441 | 2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors |
cc192b50 | 3 | * |
bbc27441 AJ |
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. | |
cc192b50 | 7 | */ |
bbc27441 AJ |
8 | |
9 | /* DEBUG: section 37 ICMP Routines */ | |
10 | ||
cc192b50 | 11 | #ifndef _INCLUDE_ICMPPINGER_H |
12 | #define _INCLUDE_ICMPPINGER_H | |
b826ffb5 | 13 | #include "Icmp.h" |
cc192b50 | 14 | |
15 | /** | |
16 | * Implements the interface to squid for ICMP operations | |
17 | */ | |
b826ffb5 | 18 | class IcmpPinger : public Icmp |
cc192b50 | 19 | { |
20 | public: | |
b826ffb5 AJ |
21 | IcmpPinger(); |
22 | virtual ~IcmpPinger(); | |
cc192b50 | 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: | |
b826ffb5 | 39 | // unused in IcmpPinger |
b7ac5457 | 40 | virtual void SendEcho(Ip::Address &to, int opcode, const char *payload, int len) {}; |
cc192b50 | 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. | |
d9c252f2 | 54 | extern IcmpPinger control; |
cc192b50 | 55 | |
56 | #endif | |
57 | ||
58 | #endif | |
f53969cc | 59 |