]> git.ipfire.org Git - thirdparty/squid.git/blob - src/icmp/IcmpConfig.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / icmp / IcmpConfig.h
1 /*
2 * Copyright (C) 1996-2020 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 03 Configuration Settings */
10
11 #ifndef ICMPCONFIG_H
12 #define ICMPCONFIG_H
13
14 #if USE_ICMP
15
16 #include "cache_cf.h"
17 #include "sbuf/SBuf.h"
18
19 /**
20 * Squid pinger Configuration settings
21 */
22 class IcmpConfig
23 {
24 public:
25 IcmpConfig() : enable(0) {}
26 ~IcmpConfig() {}
27
28 void clear() {enable=0; program.clear();}
29 void parse();
30
31 /** pinger helper application path */
32 SBuf program;
33
34 /** Whether the pinger helper is enabled for use or not */
35 int enable;
36 };
37
38 extern IcmpConfig IcmpCfg;
39
40 /* wrappers for the legacy squid.conf parser */
41 #define dump_icmp(e,n,v) \
42 if (!(v).program.isEmpty()) { \
43 (e)->append((n), strlen((n))); \
44 (e)->append(" ", 1); \
45 (e)->append((v).program.rawContent(), (v).program.length()); \
46 (e)->append("\n", 1); \
47 } else {}
48 #define parse_icmp(v) (v)->parse()
49 #define free_icmp(x) (x)->clear()
50
51 #endif /* USE_ICMP */
52 #endif /* ICMPCONFIG_H */
53