summaryrefslogtreecommitdiffstats
path: root/configd/src/apps/sentinel/outward-check.h
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-06-01 14:42:21 +0000
committerArne Juul <arnej@verizonmedia.com>2021-06-02 07:38:26 +0000
commit63eadd1f540bfbfc21c4515e95d9fa533589eced (patch)
tree5da9d45cad12eb4acc038ca42be8ae73eec6232c /configd/src/apps/sentinel/outward-check.h
parentc3d3fc8e7aedba5fb5330692ae866bbb2906ecdc (diff)
perform outward connectivity check
* does not abort startup yet, just logs results from check * but requires self-connectivity now
Diffstat (limited to 'configd/src/apps/sentinel/outward-check.h')
-rw-r--r--configd/src/apps/sentinel/outward-check.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/configd/src/apps/sentinel/outward-check.h b/configd/src/apps/sentinel/outward-check.h
new file mode 100644
index 00000000000..563151af47b
--- /dev/null
+++ b/configd/src/apps/sentinel/outward-check.h
@@ -0,0 +1,31 @@
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include "status-callback.h"
+#include "peer-check.h"
+#include <vespa/fnet/frt/supervisor.h>
+
+namespace config::sentinel {
+
+class OutwardCheck : public StatusCallback {
+ bool _wasOk = false;
+ bool _wasBad = false;
+ PeerCheck _check;
+public:
+ OutwardCheck(const std::string &hostname, int portnumber, FRT_Supervisor &orb)
+ : _check(*this, hostname, portnumber, orb)
+ {}
+ virtual ~OutwardCheck();
+ bool ok() const { return _wasOk; }
+ bool bad() const { return _wasBad; }
+ void returnStatus(bool ok) override {
+ if (ok) {
+ _wasBad = false;
+ _wasOk = true;
+ } else {
+ _wasOk = false;
+ _wasBad = true;
+ }
+ }
+};
+
+}