]> git.ipfire.org Git - thirdparty/squid.git/blame - src/icmp/IcmpSquid.h
Maintenance: automate header guards 2/3 (#1655)
[thirdparty/squid.git] / src / icmp / IcmpSquid.h
CommitLineData
cc192b50 1/*
b8ae064d 2 * Copyright (C) 1996-2023 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
ff9d9458
FC
11#ifndef SQUID_SRC_ICMP_ICMPSQUID_H
12#define SQUID_SRC_ICMP_ICMPSQUID_H
cc192b50 13
b826ffb5 14#include "Icmp.h"
cc192b50 15
16/**
17 * Implements a non-blocking pseudo-ICMP engine for squid internally.
18 *
19 * Rather than doing all the work itself it passes each request off to
20 * an external pinger helper and returns results form that helper to squid.
21 *
22 * Provides ECHO-REQUEST, ECHO-REPLY in a protocol-neutral manner.
23 */
b826ffb5 24class IcmpSquid : public Icmp
cc192b50 25{
26public:
b826ffb5 27 IcmpSquid();
337b9aa4 28 ~IcmpSquid() override;
cc192b50 29
337b9aa4
AR
30 int Open() override;
31 void Close() override;
cc192b50 32
b7ac5457 33 void DomainPing(Ip::Address &to, const char *domain);
cc192b50 34
35#if USE_ICMP
337b9aa4
AR
36 void SendEcho(Ip::Address &to, int opcode, const char* payload=nullptr, int len=0) override;
37 void Recv(void) override;
cc192b50 38#endif
39};
40
41// global engine within squid.
d9c252f2 42extern IcmpSquid icmpEngine;
cc192b50 43
ff9d9458 44#endif /* SQUID_SRC_ICMP_ICMPSQUID_H */
f53969cc 45