summaryrefslogtreecommitdiff
path: root/usr.sbin/hoststated/hoststated.h
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-02-07 15:17:47 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-02-07 15:17:47 +0000
commit3740f5b5e7e90adcd0be6513ddd3f8684cacde34 (patch)
tree7272f01760dc854689b773c8a27f5a0186cb8448 /usr.sbin/hoststated/hoststated.h
parentfe851fcc379376cc9a46baa630ec734083adbc3f (diff)
add new "log (updates|all)" configuration option to log state
notifications after completed host checks. either only log the "updates" to new states or log "all" state notifications, even if the state didn't change. the log messages will be reported to syslog or to stderr if the daemon is running in foreground mode. ok claudio@ pyr@
Diffstat (limited to 'usr.sbin/hoststated/hoststated.h')
-rw-r--r--usr.sbin/hoststated/hoststated.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/usr.sbin/hoststated/hoststated.h b/usr.sbin/hoststated/hoststated.h
index 5599e1cf569..4d6b450e7d6 100644
--- a/usr.sbin/hoststated/hoststated.h
+++ b/usr.sbin/hoststated/hoststated.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hoststated.h,v 1.23 2007/02/07 13:39:58 reyk Exp $ */
+/* $OpenBSD: hoststated.h,v 1.24 2007/02/07 15:17:46 reyk Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -185,9 +185,11 @@ struct host {
};
TAILQ_HEAD(hostlist, host);
-#define HOST_DOWN -1
-#define HOST_UNKNOWN 0
-#define HOST_UP 1
+enum host_status {
+ HOST_DOWN = -1,
+ HOST_UNKNOWN = 0,
+ HOST_UP = 1
+};
struct table {
objid_t id;
@@ -209,12 +211,14 @@ struct table {
};
TAILQ_HEAD(tablelist, table);
-#define CHECK_NOCHECK 0
-#define CHECK_ICMP 1
-#define CHECK_TCP 2
-#define CHECK_HTTP_CODE 3
-#define CHECK_HTTP_DIGEST 4
-#define CHECK_SEND_EXPECT 5
+enum table_check {
+ CHECK_NOCHECK = 0,
+ CHECK_ICMP = 1,
+ CHECK_TCP = 2,
+ CHECK_HTTP_CODE = 3,
+ CHECK_HTTP_DIGEST = 4,
+ CHECK_SEND_EXPECT = 5
+};
struct service {
objid_t id;
@@ -257,8 +261,11 @@ struct hoststated {
struct ctl_icmp_event icmp6_recv;
};
-#define HOSTSTATED_OPT_VERBOSE 0x01
-#define HOSTSTATED_OPT_NOACTION 0x04
+#define HOSTSTATED_OPT_VERBOSE 0x01
+#define HOSTSTATED_OPT_NOACTION 0x04
+#define HOSTSTATED_OPT_LOGUPDATE 0x08
+#define HOSTSTATED_OPT_LOGNOTIFY 0x10
+#define HOSTSTATED_OPT_LOGALL 0x18
/* initially control.h */
struct {
@@ -304,6 +311,8 @@ void log_info(const char *, ...);
void log_debug(const char *, ...);
void fatal(const char *);
void fatalx(const char *);
+const char *host_status(enum host_status);
+const char *table_check(enum table_check);
/* buffer.c */
struct buf *buf_open(size_t);