diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-01-09 13:50:12 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-01-09 13:50:12 +0000 |
commit | e7a846275cccd81c533417c7c5aec5490dca4077 (patch) | |
tree | c70864a568813aeaba55b410a62e079aba71606d /usr.sbin | |
parent | bf19965ce7a408698b9a3f578cc2d7641fec1ec6 (diff) |
Finish renaming hostated to hoststated.
Note to testers: the user the daemon changes its id to is now _hoststated,
don't forget to update master.passwd.
ok reyk@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/hoststatectl/hoststatectl.8 | 16 | ||||
-rw-r--r-- | usr.sbin/hoststatectl/hoststatectl.c | 10 | ||||
-rw-r--r-- | usr.sbin/hoststated/control.c | 16 | ||||
-rw-r--r-- | usr.sbin/hoststated/hce.c | 10 | ||||
-rw-r--r-- | usr.sbin/hoststated/hoststated.8 | 26 | ||||
-rw-r--r-- | usr.sbin/hoststated/hoststated.c | 26 | ||||
-rw-r--r-- | usr.sbin/hoststated/hoststated.conf.5 | 26 | ||||
-rw-r--r-- | usr.sbin/hoststated/hoststated.h | 90 | ||||
-rw-r--r-- | usr.sbin/hoststated/parse.y | 8 | ||||
-rw-r--r-- | usr.sbin/hoststated/pfe.c | 10 | ||||
-rw-r--r-- | usr.sbin/hoststated/pfe_filter.c | 40 | ||||
-rw-r--r-- | usr.sbin/relayctl/relayctl.8 | 16 | ||||
-rw-r--r-- | usr.sbin/relayctl/relayctl.c | 10 | ||||
-rw-r--r-- | usr.sbin/relayd/control.c | 16 | ||||
-rw-r--r-- | usr.sbin/relayd/hce.c | 10 | ||||
-rw-r--r-- | usr.sbin/relayd/parse.y | 8 | ||||
-rw-r--r-- | usr.sbin/relayd/pfe.c | 10 | ||||
-rw-r--r-- | usr.sbin/relayd/pfe_filter.c | 40 | ||||
-rw-r--r-- | usr.sbin/relayd/relayd.8 | 26 | ||||
-rw-r--r-- | usr.sbin/relayd/relayd.c | 26 | ||||
-rw-r--r-- | usr.sbin/relayd/relayd.conf.5 | 26 | ||||
-rw-r--r-- | usr.sbin/relayd/relayd.h | 90 |
22 files changed, 278 insertions, 278 deletions
diff --git a/usr.sbin/hoststatectl/hoststatectl.8 b/usr.sbin/hoststatectl/hoststatectl.8 index d6292831ca4..cf9ec96a120 100644 --- a/usr.sbin/hoststatectl/hoststatectl.8 +++ b/usr.sbin/hoststatectl/hoststatectl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: hoststatectl.8,v 1.5 2006/12/19 14:44:38 jmc Exp $ +.\" $OpenBSD: hoststatectl.8,v 1.6 2007/01/09 13:50:10 pyr Exp $ .\" .\" Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> .\" @@ -15,10 +15,10 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd November 1, 2006 -.Dt HOSTATECTL 8 +.Dt HOSTSTATECTL 8 .Os .Sh NAME -.Nm hostatectl +.Nm hoststatectl .Nd control the host status daemon .Sh SYNOPSIS .Nm @@ -28,7 +28,7 @@ The .Nm program controls the -.Xr hostated 8 +.Xr hoststated 8 daemon. .Pp The following commands are available: @@ -68,10 +68,10 @@ Start doing checks for all hosts that aren't individually disabled again. .El .Sh FILES -.Bl -tag -width "/var/run/hostated.sockXX" -compact -.It /var/run/hostated.sock +.Bl -tag -width "/var/run/hoststated.sockXX" -compact +.It /var/run/hoststated.sock Unix-domain socket used for communication with -.Xr hostated 8 . +.Xr hoststated 8 . .El .Sh SEE ALSO -.Xr hostated 8 +.Xr hoststated 8 diff --git a/usr.sbin/hoststatectl/hoststatectl.c b/usr.sbin/hoststatectl/hoststatectl.c index 90ad447aa22..5119d4e6898 100644 --- a/usr.sbin/hoststatectl/hoststatectl.c +++ b/usr.sbin/hoststatectl/hoststatectl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hoststatectl.c,v 1.7 2007/01/09 00:45:32 deraadt Exp $ */ +/* $OpenBSD: hoststatectl.c,v 1.8 2007/01/09 13:50:10 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -57,7 +57,7 @@ usage(void) exit(1); } -/* dummy function so that hostatectl does not need libevent */ +/* dummy function so that hoststatectl does not need libevent */ void imsg_event_add(struct imsgbuf *i) { @@ -78,15 +78,15 @@ main(int argc, char *argv[]) if ((res = parse(argc - 1, argv + 1)) == NULL) exit(1); - /* connect to hostated control socket */ + /* connect to hoststated control socket */ if ((ctl_sock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) err(1, "socket"); bzero(&sun, sizeof(sun)); sun.sun_family = AF_UNIX; - strlcpy(sun.sun_path, HOSTATED_SOCKET, sizeof(sun.sun_path)); + strlcpy(sun.sun_path, HOSTSTATED_SOCKET, sizeof(sun.sun_path)); if (connect(ctl_sock, (struct sockaddr *)&sun, sizeof(sun)) == -1) - err(1, "connect: %s", HOSTATED_SOCKET); + err(1, "connect: %s", HOSTSTATED_SOCKET); if ((ibuf = malloc(sizeof(struct imsgbuf))) == NULL) err(1, NULL); diff --git a/usr.sbin/hoststated/control.c b/usr.sbin/hoststated/control.c index c2392cd15dc..e16f8f55879 100644 --- a/usr.sbin/hoststated/control.c +++ b/usr.sbin/hoststated/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.7 2007/01/09 00:45:32 deraadt Exp $ */ +/* $OpenBSD: control.c,v 1.8 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -57,28 +57,28 @@ control_init(void) bzero(&sun, sizeof(sun)); sun.sun_family = AF_UNIX; - strlcpy(sun.sun_path, HOSTATED_SOCKET, sizeof(sun.sun_path)); + strlcpy(sun.sun_path, HOSTSTATED_SOCKET, sizeof(sun.sun_path)); - if (unlink(HOSTATED_SOCKET) == -1) + if (unlink(HOSTSTATED_SOCKET) == -1) if (errno != ENOENT) { - log_warn("control_init: unlink %s", HOSTATED_SOCKET); + log_warn("control_init: unlink %s", HOSTSTATED_SOCKET); close(fd); return (-1); } old_umask = umask(S_IXUSR|S_IXGRP|S_IWOTH|S_IROTH|S_IXOTH); if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) { - log_warn("control_init: bind: %s", HOSTATED_SOCKET); + log_warn("control_init: bind: %s", HOSTSTATED_SOCKET); close(fd); umask(old_umask); return (-1); } umask(old_umask); - if (chmod(HOSTATED_SOCKET, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) == -1) { + if (chmod(HOSTSTATED_SOCKET, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) == -1) { log_warn("control_init: chmod"); close(fd); - (void)unlink(HOSTATED_SOCKET); + (void)unlink(HOSTSTATED_SOCKET); return (-1); } @@ -108,7 +108,7 @@ void control_cleanup(void) { - unlink(HOSTATED_SOCKET); + unlink(HOSTSTATED_SOCKET); } /* ARGSUSED */ diff --git a/usr.sbin/hoststated/hce.c b/usr.sbin/hoststated/hce.c index 308a8d7166b..c951b5ba8bb 100644 --- a/usr.sbin/hoststated/hce.c +++ b/usr.sbin/hoststated/hce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hce.c,v 1.8 2007/01/09 00:45:32 deraadt Exp $ */ +/* $OpenBSD: hce.c,v 1.9 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -45,7 +45,7 @@ void hce_dispatch_parent(int, short, void *); void hce_launch_checks(int, short, void *); int hce_checks_done(void); -static struct hostated *env = NULL; +static struct hoststated *env = NULL; struct imsgbuf *ibuf_pfe; struct imsgbuf *ibuf_main; @@ -62,7 +62,7 @@ hce_sig_handler(int sig, short event, void *arg) } pid_t -hce(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], +hce(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], int pipe_pfe2hce[2]) { pid_t pid; @@ -88,7 +88,7 @@ hce(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], if ((env->icmp6_sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) err(1, "socket"); - if ((pw = getpwnam(HOSTATED_USER)) == NULL) + if ((pw = getpwnam(HOSTSTATED_USER)) == NULL) fatal("hce: getpwnam"); if (chroot(pw->pw_dir) == -1) @@ -97,7 +97,7 @@ hce(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], fatal("hce: chdir(\"/\")"); setproctitle("host check engine"); - hostated_process = PROC_HCE; + hoststated_process = PROC_HCE; if (setgroups(1, &pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || diff --git a/usr.sbin/hoststated/hoststated.8 b/usr.sbin/hoststated/hoststated.8 index 3bea663ae17..f7d0f271aa2 100644 --- a/usr.sbin/hoststated/hoststated.8 +++ b/usr.sbin/hoststated/hoststated.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: hoststated.8,v 1.4 2006/12/18 19:48:04 jmc Exp $ +.\" $OpenBSD: hoststated.8,v 1.5 2007/01/09 13:50:11 pyr Exp $ .\" .\" Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> .\" @@ -15,10 +15,10 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd November 1, 2006 -.Dt HOSTATED 8 +.Dt HOSTSTATED 8 .Os .Sh NAME -.Nm hostated +.Nm hoststated .Nd Host Status daemon .Sh SYNOPSIS .Nm @@ -40,7 +40,7 @@ to install rulesets through the anchor, the following line is required in the NAT section of .Xr pf.conf 5 : .Bd -literal -offset indent -rdr-anchor "hostated/*" +rdr-anchor "hoststated/*" .Ed .Pp .Nm @@ -55,11 +55,11 @@ Additionally a table can be backed up i.e. its content will be swapped by the content of another table when it is empty. This can be used to serve static content when a dynamic service goes down. See -.Xr hostated.conf 5 +.Xr hoststated.conf 5 for a more detailed explanation of how to configure .Nm . .Pp -.Xr hostatectl 8 +.Xr hoststatectl 8 can be used to enable or disable hosts, tables, and services as well as showing the current status of each object. .Pp @@ -74,7 +74,7 @@ will run in the foreground and log to .It Fl f Ar file Specify an alternative configuration file. The default is -.Pa /etc/hostated.conf . +.Pa /etc/hoststated.conf . .It Fl n Configtest mode. Only check the configuration file for validity. @@ -82,15 +82,15 @@ Only check the configuration file for validity. Produce more verbose output. .El .Sh FILES -.Bl -tag -width "/var/run/hostated.sockXX" -compact -.It /etc/hostated.conf +.Bl -tag -width "/var/run/hoststated.sockXX" -compact +.It /etc/hoststated.conf Default .Nm configuration file. -.It /var/run/hostated.sock +.It /var/run/hoststated.sock Unix-domain socket used for communication with -.Xr hostatectl 8 . +.Xr hoststatectl 8 . .El .Sh SEE ALSO -.Xr hostated.conf 5 , -.Xr hostatectl 8 +.Xr hoststated.conf 5 , +.Xr hoststatectl 8 diff --git a/usr.sbin/hoststated/hoststated.c b/usr.sbin/hoststated/hoststated.c index 98fc0d99784..cbb72231380 100644 --- a/usr.sbin/hoststated/hoststated.c +++ b/usr.sbin/hoststated/hoststated.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hoststated.c,v 1.8 2007/01/09 02:32:58 reyk Exp $ */ +/* $OpenBSD: hoststated.c,v 1.9 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -98,7 +98,7 @@ main(int argc, char *argv[]) int c; int debug; u_int32_t opts; - struct hostated env; + struct hoststated env; const char *conffile; struct event ev_sigint; struct event ev_sigterm; @@ -116,13 +116,13 @@ main(int argc, char *argv[]) debug = 1; break; case 'n': - opts |= HOSTATED_OPT_NOACTION; + opts |= HOSTSTATED_OPT_NOACTION; break; case 'f': conffile = optarg; break; case 'v': - opts |= HOSTATED_OPT_VERBOSE; + opts |= HOSTSTATED_OPT_VERBOSE; break; default: usage(); @@ -134,7 +134,7 @@ main(int argc, char *argv[]) if (parse_config(&env, conffile, opts)) exit(1); - if (env.opts & HOSTATED_OPT_NOACTION) { + if (env.opts & HOSTSTATED_OPT_NOACTION) { fprintf(stderr, "configuration OK\n"); exit(0); } @@ -142,8 +142,8 @@ main(int argc, char *argv[]) if (geteuid()) errx(1, "need root privileges"); - if (getpwnam(HOSTATED_USER) == NULL) - errx(1, "unknown user %s", HOSTATED_USER); + if (getpwnam(HOSTSTATED_USER) == NULL) + errx(1, "unknown user %s", HOSTSTATED_USER); if (!debug) daemon(1, 0); @@ -342,7 +342,7 @@ main_dispatch_hce(int fd, short event, void * ptr) } struct host * -host_find(struct hostated *env, objid_t id) +host_find(struct hoststated *env, objid_t id) { struct table *table; struct host *host; @@ -355,7 +355,7 @@ host_find(struct hostated *env, objid_t id) } struct table * -table_find(struct hostated *env, objid_t id) +table_find(struct hoststated *env, objid_t id) { struct table *table; @@ -366,7 +366,7 @@ table_find(struct hostated *env, objid_t id) } struct service * -service_find(struct hostated *env, objid_t id) +service_find(struct hoststated *env, objid_t id) { struct service *service; @@ -377,7 +377,7 @@ service_find(struct hostated *env, objid_t id) } struct host * -host_findbyname(struct hostated *env, const char *name) +host_findbyname(struct hoststated *env, const char *name) { struct table *table; struct host *host; @@ -390,7 +390,7 @@ host_findbyname(struct hostated *env, const char *name) } struct table * -table_findbyname(struct hostated *env, const char *name) +table_findbyname(struct hoststated *env, const char *name) { struct table *table; @@ -401,7 +401,7 @@ table_findbyname(struct hostated *env, const char *name) } struct service * -service_findbyname(struct hostated *env, const char *name) +service_findbyname(struct hoststated *env, const char *name) { struct service *service; diff --git a/usr.sbin/hoststated/hoststated.conf.5 b/usr.sbin/hoststated/hoststated.conf.5 index 7d739ef3e52..21d0c796322 100644 --- a/usr.sbin/hoststated/hoststated.conf.5 +++ b/usr.sbin/hoststated/hoststated.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: hoststated.conf.5,v 1.12 2007/01/08 20:46:18 reyk Exp $ +.\" $OpenBSD: hoststated.conf.5,v 1.13 2007/01/09 13:50:11 pyr Exp $ .\" .\" Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> .\" @@ -15,15 +15,15 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd November 1, 2006 -.Dt HOSTATED.CONF 5 +.Dt HOSTSTATED.CONF 5 .Os .Sh NAME -.Nm hostated.conf +.Nm hoststated.conf .Nd Host Status daemon configuration file .Sh DESCRIPTION .Nm is the configuration file for the Host Status Daemon, -.Xr hostated 8 . +.Xr hoststated 8 . .Sh SECTIONS .Nm is divided into four main sections: @@ -33,7 +33,7 @@ User-defined variables may be defined and used later, simplifying the configuration file. .It Sy Global Configuration Global settings for -.Xr hostated 8 . +.Xr hoststated 8 . .It Sy Tables Table definitions describe the content of a .Xr pf 4 @@ -150,7 +150,7 @@ Use a simple TCP connect to check that hosts are up. .It Ic disable Start the table disabled \(en no hosts will be checked in this table. The table can be later enabled through -.Xr hostatectl 8 . +.Xr hoststatectl 8 . .It Ic host Ar address Add the host whose address is .Ar address @@ -182,7 +182,7 @@ are seen as down or disabled. .It Ic disable Set the service initially disabled. It can be later enabled through -.Xr hostatectl 8 . +.Xr hoststatectl 8 . .It Ic sticky-address This has the same effect than specifying sticky-address for a rdr rule in @@ -246,19 +246,19 @@ service www { virtual ip www.example.com port 8080 interface trunk0 virtual ip www6.example.com port 80 interface trunk0 - tag HOSTATED + tag HOSTSTATED table phphosts backup table sorryhost } .Ed .Sh FILES -.Bl -tag -width "/etc/hostated.conf" -compact -.It Pa /etc/hostated.conf -.Xr hostated 8 +.Bl -tag -width "/etc/hoststated.conf" -compact +.It Pa /etc/hoststated.conf +.Xr hoststated 8 configuration file .It Pa /etc/services Service name database .El .Sh SEE ALSO -.Xr hostatectl 8 , -.Xr hostated 8 +.Xr hoststatectl 8 , +.Xr hoststated 8 diff --git a/usr.sbin/hoststated/hoststated.h b/usr.sbin/hoststated/hoststated.h index 8f1137e6be1..0102c4a1566 100644 --- a/usr.sbin/hoststated/hoststated.h +++ b/usr.sbin/hoststated/hoststated.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hoststated.h,v 1.12 2007/01/09 03:32:56 reyk Exp $ */ +/* $OpenBSD: hoststated.h,v 1.13 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -17,20 +17,20 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define CONF_FILE "/etc/hostated.conf" -#define HOSTATED_SOCKET "/var/run/hostated.sock" -#define PF_SOCKET "/dev/pf" -#define HOSTATED_USER "_hostated" -#define HOSTATED_ANCHOR "hostated" -#define CHECK_TIMEOUT 200 -#define CHECK_INTERVAL 10 -#define EMPTY_TABLE UINT_MAX -#define EMPTY_ID UINT_MAX -#define TABLE_NAME_SIZE 32 -#define TAG_NAME_SIZE 64 -#define SRV_NAME_SIZE 64 -#define MAX_NAME_SIZE 64 -#define SRV_MAX_VIRTS 16 +#define CONF_FILE "/etc/hoststated.conf" +#define HOSTSTATED_SOCKET "/var/run/hoststated.sock" +#define PF_SOCKET "/dev/pf" +#define HOSTSTATED_USER "_hoststated" +#define HOSTSTATED_ANCHOR "hoststated" +#define CHECK_TIMEOUT 200 +#define CHECK_INTERVAL 10 +#define EMPTY_TABLE UINT_MAX +#define EMPTY_ID UINT_MAX +#define TABLE_NAME_SIZE 32 +#define TAG_NAME_SIZE 64 +#define SRV_NAME_SIZE 64 +#define MAX_NAME_SIZE 64 +#define SRV_MAX_VIRTS 16 #define SMALL_READ_BUF_SIZE 1024 #define READ_BUF_SIZE 65535 @@ -74,13 +74,13 @@ struct imsgbuf { enum imsg_type { IMSG_NONE, - IMSG_CTL_OK, /* answer to hostatectl requests */ + IMSG_CTL_OK, /* answer to hoststatectl requests */ IMSG_CTL_FAIL, IMSG_CTL_END, IMSG_CTL_SERVICE, IMSG_CTL_TABLE, IMSG_CTL_HOST, - IMSG_CTL_SHOW_SUM, /* hostatectl requests */ + IMSG_CTL_SHOW_SUM, /* hoststatectl requests */ IMSG_CTL_SERVICE_ENABLE, IMSG_CTL_SERVICE_DISABLE, IMSG_CTL_TABLE_ENABLE, @@ -125,14 +125,14 @@ struct ctl_id { }; struct ctl_icmp_event { - struct hostated *env; - int icmp_sock; - int icmp6_sock; - int has_icmp4; - int has_icmp6; - int last_up; - struct event ev; - struct timeval tv_start; + struct hoststated *env; + int icmp_sock; + int icmp6_sock; + int has_icmp4; + int has_icmp6; + int last_up; + struct event ev; + struct timeval tv_start; }; struct ctl_tcp_event { @@ -223,9 +223,9 @@ enum { PROC_MAIN, PROC_PFE, PROC_HCE -} hostated_process; +} hoststated_process; -struct hostated { +struct hoststated { u_int8_t opts; struct pfdata *pf; int icmp_sock; @@ -241,8 +241,8 @@ struct hostated { struct ctl_icmp_event cie; }; -#define HOSTATED_OPT_VERBOSE 0x01 -#define HOSTATED_OPT_NOACTION 0x04 +#define HOSTSTATED_OPT_VERBOSE 0x01 +#define HOSTSTATED_OPT_NOACTION 0x04 /* initially control.h */ struct { @@ -275,7 +275,7 @@ void session_socket_blockmode(int, enum blockmodes); extern struct ctl_connlist ctl_conns; /* parse.y */ -int parse_config(struct hostated *, const char *, int); +int parse_config(struct hoststated *, const char *, int); /* log.c */ void log_init(int); @@ -312,7 +312,7 @@ void imsg_free(struct imsg *); void imsg_event_add(struct imsgbuf *); /* needs to be provided externally */ /* pfe.c */ -pid_t pfe(struct hostated *, int [2], int [2], int [2]); +pid_t pfe(struct hoststated *, int [2], int [2], int [2]); void show(struct ctl_conn *); int enable_service(struct ctl_conn *, struct ctl_id *); int enable_table(struct ctl_conn *, struct ctl_id *); @@ -322,15 +322,15 @@ int disable_table(struct ctl_conn *, struct ctl_id *); int disable_host(struct ctl_conn *, struct ctl_id *); /* pfe_filter.c */ -void init_filter(struct hostated *); -void init_tables(struct hostated *); -void flush_table(struct hostated *, struct service *); -void sync_table(struct hostated *, struct service *, struct table *); -void sync_ruleset(struct hostated *, struct service *, int); -void flush_rulesets(struct hostated *); +void init_filter(struct hoststated *); +void init_tables(struct hoststated *); +void flush_table(struct hoststated *, struct service *); +void sync_table(struct hoststated *, struct service *, struct table *); +void sync_ruleset(struct hoststated *, struct service *, int); +void flush_rulesets(struct hoststated *); /* hce.c */ -pid_t hce(struct hostated *, int [2], int [2], int [2]); +pid_t hce(struct hoststated *, int [2], int [2], int [2]); void hce_notify_done(struct host *, const char *); /* check_icmp.c */ @@ -346,10 +346,10 @@ void send_http_request(struct ctl_tcp_event *); /* check_send_expect.c */ void start_send_expect(struct ctl_tcp_event *); -/* hostated.c */ -struct host *host_find(struct hostated *, objid_t); -struct table *table_find(struct hostated *, objid_t); -struct service *service_find(struct hostated *, objid_t); -struct host *host_findbyname(struct hostated *, const char *); -struct table *table_findbyname(struct hostated *, const char *); -struct service *service_findbyname(struct hostated *, const char *); +/* hoststated.c */ +struct host *host_find(struct hoststated *, objid_t); +struct table *table_find(struct hoststated *, objid_t); +struct service *service_find(struct hoststated *, objid_t); +struct host *host_findbyname(struct hoststated *, const char *); +struct table *table_findbyname(struct hoststated *, const char *); +struct service *service_findbyname(struct hoststated *, const char *); diff --git a/usr.sbin/hoststated/parse.y b/usr.sbin/hoststated/parse.y index 66c0e120541..e3428244243 100644 --- a/usr.sbin/hoststated/parse.y +++ b/usr.sbin/hoststated/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.14 2007/01/09 00:45:32 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.15 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -43,7 +43,7 @@ #include "hoststated.h" -struct hostated *conf = NULL; +struct hoststated *conf = NULL; static FILE *fin = NULL; static int lineno = 1; static int errors = 0; @@ -742,7 +742,7 @@ top: } int -parse_config(struct hostated *x_conf, const char *filename, int opts) +parse_config(struct hoststated *x_conf, const char *filename, int opts) { struct sym *sym, *next; @@ -775,7 +775,7 @@ parse_config(struct hostated *x_conf, const char *filename, int opts) /* Free macros and check which have not been used. */ for (sym = TAILQ_FIRST(&symhead); sym != NULL; sym = next) { next = TAILQ_NEXT(sym, entries); - if ((conf->opts & HOSTATED_OPT_VERBOSE) && !sym->used) + if ((conf->opts & HOSTSTATED_OPT_VERBOSE) && !sym->used) fprintf(stderr, "warning: macro '%s' not " "used\n", sym->nam); if (!sym->persist) { diff --git a/usr.sbin/hoststated/pfe.c b/usr.sbin/hoststated/pfe.c index 1ee1c529937..4c14a2b6a2f 100644 --- a/usr.sbin/hoststated/pfe.c +++ b/usr.sbin/hoststated/pfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfe.c,v 1.6 2007/01/09 00:45:32 deraadt Exp $ */ +/* $OpenBSD: pfe.c,v 1.7 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -40,7 +40,7 @@ void pfe_dispatch_parent(int, short, void *); void pfe_sync(void); -static struct hostated *env = NULL; +static struct hoststated *env = NULL; struct imsgbuf *ibuf_main; struct imsgbuf *ibuf_hce; @@ -58,7 +58,7 @@ pfe_sig_handler(int sig, short event, void *arg) } pid_t -pfe(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], +pfe(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], int pipe_pfe2hce[2]) { pid_t pid; @@ -83,7 +83,7 @@ pfe(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], init_filter(env); init_tables(env); - if ((pw = getpwnam(HOSTATED_USER)) == NULL) + if ((pw = getpwnam(HOSTSTATED_USER)) == NULL) fatal("pfe: getpwnam"); if (chroot(pw->pw_dir) == -1) @@ -92,7 +92,7 @@ pfe(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], fatal("pfe: chdir(\"/\")"); setproctitle("pf update engine"); - hostated_process = PROC_PFE; + hoststated_process = PROC_PFE; if (setgroups(1, &pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || diff --git a/usr.sbin/hoststated/pfe_filter.c b/usr.sbin/hoststated/pfe_filter.c index 50fe7456ad9..18e0af927e3 100644 --- a/usr.sbin/hoststated/pfe_filter.c +++ b/usr.sbin/hoststated/pfe_filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfe_filter.c,v 1.8 2007/01/09 00:45:32 deraadt Exp $ */ +/* $OpenBSD: pfe_filter.c,v 1.9 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -44,12 +44,12 @@ struct pfdata { struct pfioc_trans_e pfte; }; -int transaction_init(struct hostated *, const char *); -int transaction_commit(struct hostated *); -void kill_tables(struct hostated *); +int transaction_init(struct hoststated *, const char *); +int transaction_commit(struct hoststated *); +void kill_tables(struct hoststated *); void -init_filter(struct hostated *env) +init_filter(struct hoststated *env) { struct pf_status status; @@ -65,7 +65,7 @@ init_filter(struct hostated *env) } void -init_tables(struct hostated *env) +init_tables(struct hoststated *env) { int i; struct service *service; @@ -77,7 +77,7 @@ init_tables(struct hostated *env) i = 0; TAILQ_FOREACH(service, &env->services, entry) { - (void)strlcpy(tables[i].pfrt_anchor, HOSTATED_ANCHOR "/", + (void)strlcpy(tables[i].pfrt_anchor, HOSTSTATED_ANCHOR "/", sizeof(tables[i].pfrt_anchor)); (void)strlcat(tables[i].pfrt_anchor, service->name, sizeof(tables[i].pfrt_anchor)); @@ -111,13 +111,13 @@ init_tables(struct hostated *env) } void -kill_tables(struct hostated *env) { +kill_tables(struct hoststated *env) { struct pfioc_table io; struct service *service; memset(&io, 0, sizeof(io)); TAILQ_FOREACH(service, &env->services, entry) { - (void)strlcpy(io.pfrio_table.pfrt_anchor, HOSTATED_ANCHOR "/", + (void)strlcpy(io.pfrio_table.pfrt_anchor, HOSTSTATED_ANCHOR "/", sizeof(io.pfrio_table.pfrt_anchor)); (void)strlcat(io.pfrio_table.pfrt_anchor, service->name, sizeof(io.pfrio_table.pfrt_anchor)); @@ -128,7 +128,7 @@ kill_tables(struct hostated *env) { } void -sync_table(struct hostated *env, struct service *service, struct table *table) +sync_table(struct hoststated *env, struct service *service, struct table *table) { int i; struct pfioc_table io; @@ -153,7 +153,7 @@ sync_table(struct hostated *env, struct service *service, struct table *table) io.pfrio_size = table->up; io.pfrio_size2 = 0; io.pfrio_buffer = addlist; - (void)strlcpy(io.pfrio_table.pfrt_anchor, HOSTATED_ANCHOR "/", + (void)strlcpy(io.pfrio_table.pfrt_anchor, HOSTSTATED_ANCHOR "/", sizeof(io.pfrio_table.pfrt_anchor)); (void)strlcat(io.pfrio_table.pfrt_anchor, service->name, sizeof(io.pfrio_table.pfrt_anchor)); @@ -200,12 +200,12 @@ sync_table(struct hostated *env, struct service *service, struct table *table) } void -flush_table(struct hostated *env, struct service *service) +flush_table(struct hoststated *env, struct service *service) { struct pfioc_table io; memset(&io, 0, sizeof(io)); - (void)strlcpy(io.pfrio_table.pfrt_anchor, HOSTATED_ANCHOR "/", + (void)strlcpy(io.pfrio_table.pfrt_anchor, HOSTSTATED_ANCHOR "/", sizeof(io.pfrio_table.pfrt_anchor)); (void)strlcat(io.pfrio_table.pfrt_anchor, service->name, sizeof(io.pfrio_table.pfrt_anchor)); @@ -218,7 +218,7 @@ flush_table(struct hostated *env, struct service *service) } int -transaction_init(struct hostated *env, const char *anchor) +transaction_init(struct hoststated *env, const char *anchor) { env->pf->pft.size = 1; env->pf->pft.esize = sizeof env->pf->pfte; @@ -234,7 +234,7 @@ transaction_init(struct hostated *env, const char *anchor) } int -transaction_commit(struct hostated *env) +transaction_commit(struct hoststated *env) { if (ioctl(env->pf->dev, DIOCXCOMMIT, &env->pf->pft) == -1) return (-1); @@ -242,7 +242,7 @@ transaction_commit(struct hostated *env) } void -sync_ruleset(struct hostated *env, struct service *service, int enable) +sync_ruleset(struct hoststated *env, struct service *service, int enable) { struct pfioc_rule rio; struct pfioc_pooladdr pio; @@ -252,7 +252,7 @@ sync_ruleset(struct hostated *env, struct service *service, int enable) char anchor[PF_ANCHOR_NAME_SIZE]; bzero(anchor, sizeof(anchor)); - (void)strlcpy(anchor, HOSTATED_ANCHOR "/", sizeof(anchor)); + (void)strlcpy(anchor, HOSTSTATED_ANCHOR "/", sizeof(anchor)); (void)strlcat(anchor, service->name, sizeof(anchor)); transaction_init(env, anchor); @@ -323,19 +323,19 @@ sync_ruleset(struct hostated *env, struct service *service, int enable) } void -flush_rulesets(struct hostated *env) +flush_rulesets(struct hoststated *env) { struct service *service; char anchor[PF_ANCHOR_NAME_SIZE]; kill_tables(env); TAILQ_FOREACH(service, &env->services, entry) { - strlcpy(anchor, HOSTATED_ANCHOR "/", sizeof(anchor)); + strlcpy(anchor, HOSTSTATED_ANCHOR "/", sizeof(anchor)); strlcat(anchor, service->name, sizeof(anchor)); transaction_init(env, anchor); transaction_commit(env); } - strlcpy(anchor, HOSTATED_ANCHOR, sizeof(anchor)); + strlcpy(anchor, HOSTSTATED_ANCHOR, sizeof(anchor)); transaction_init(env, anchor); transaction_commit(env); log_debug("flush_rulesets: flushed rules"); diff --git a/usr.sbin/relayctl/relayctl.8 b/usr.sbin/relayctl/relayctl.8 index 4f97ca8a072..61a11ce7942 100644 --- a/usr.sbin/relayctl/relayctl.8 +++ b/usr.sbin/relayctl/relayctl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: relayctl.8,v 1.5 2006/12/19 14:44:38 jmc Exp $ +.\" $OpenBSD: relayctl.8,v 1.6 2007/01/09 13:50:10 pyr Exp $ .\" .\" Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> .\" @@ -15,10 +15,10 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd November 1, 2006 -.Dt HOSTATECTL 8 +.Dt HOSTSTATECTL 8 .Os .Sh NAME -.Nm hostatectl +.Nm hoststatectl .Nd control the host status daemon .Sh SYNOPSIS .Nm @@ -28,7 +28,7 @@ The .Nm program controls the -.Xr hostated 8 +.Xr hoststated 8 daemon. .Pp The following commands are available: @@ -68,10 +68,10 @@ Start doing checks for all hosts that aren't individually disabled again. .El .Sh FILES -.Bl -tag -width "/var/run/hostated.sockXX" -compact -.It /var/run/hostated.sock +.Bl -tag -width "/var/run/hoststated.sockXX" -compact +.It /var/run/hoststated.sock Unix-domain socket used for communication with -.Xr hostated 8 . +.Xr hoststated 8 . .El .Sh SEE ALSO -.Xr hostated 8 +.Xr hoststated 8 diff --git a/usr.sbin/relayctl/relayctl.c b/usr.sbin/relayctl/relayctl.c index 026a2747895..505541b3d16 100644 --- a/usr.sbin/relayctl/relayctl.c +++ b/usr.sbin/relayctl/relayctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayctl.c,v 1.7 2007/01/09 00:45:32 deraadt Exp $ */ +/* $OpenBSD: relayctl.c,v 1.8 2007/01/09 13:50:10 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -57,7 +57,7 @@ usage(void) exit(1); } -/* dummy function so that hostatectl does not need libevent */ +/* dummy function so that hoststatectl does not need libevent */ void imsg_event_add(struct imsgbuf *i) { @@ -78,15 +78,15 @@ main(int argc, char *argv[]) if ((res = parse(argc - 1, argv + 1)) == NULL) exit(1); - /* connect to hostated control socket */ + /* connect to hoststated control socket */ if ((ctl_sock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) err(1, "socket"); bzero(&sun, sizeof(sun)); sun.sun_family = AF_UNIX; - strlcpy(sun.sun_path, HOSTATED_SOCKET, sizeof(sun.sun_path)); + strlcpy(sun.sun_path, HOSTSTATED_SOCKET, sizeof(sun.sun_path)); if (connect(ctl_sock, (struct sockaddr *)&sun, sizeof(sun)) == -1) - err(1, "connect: %s", HOSTATED_SOCKET); + err(1, "connect: %s", HOSTSTATED_SOCKET); if ((ibuf = malloc(sizeof(struct imsgbuf))) == NULL) err(1, NULL); diff --git a/usr.sbin/relayd/control.c b/usr.sbin/relayd/control.c index c2392cd15dc..e16f8f55879 100644 --- a/usr.sbin/relayd/control.c +++ b/usr.sbin/relayd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.7 2007/01/09 00:45:32 deraadt Exp $ */ +/* $OpenBSD: control.c,v 1.8 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -57,28 +57,28 @@ control_init(void) bzero(&sun, sizeof(sun)); sun.sun_family = AF_UNIX; - strlcpy(sun.sun_path, HOSTATED_SOCKET, sizeof(sun.sun_path)); + strlcpy(sun.sun_path, HOSTSTATED_SOCKET, sizeof(sun.sun_path)); - if (unlink(HOSTATED_SOCKET) == -1) + if (unlink(HOSTSTATED_SOCKET) == -1) if (errno != ENOENT) { - log_warn("control_init: unlink %s", HOSTATED_SOCKET); + log_warn("control_init: unlink %s", HOSTSTATED_SOCKET); close(fd); return (-1); } old_umask = umask(S_IXUSR|S_IXGRP|S_IWOTH|S_IROTH|S_IXOTH); if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) { - log_warn("control_init: bind: %s", HOSTATED_SOCKET); + log_warn("control_init: bind: %s", HOSTSTATED_SOCKET); close(fd); umask(old_umask); return (-1); } umask(old_umask); - if (chmod(HOSTATED_SOCKET, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) == -1) { + if (chmod(HOSTSTATED_SOCKET, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) == -1) { log_warn("control_init: chmod"); close(fd); - (void)unlink(HOSTATED_SOCKET); + (void)unlink(HOSTSTATED_SOCKET); return (-1); } @@ -108,7 +108,7 @@ void control_cleanup(void) { - unlink(HOSTATED_SOCKET); + unlink(HOSTSTATED_SOCKET); } /* ARGSUSED */ diff --git a/usr.sbin/relayd/hce.c b/usr.sbin/relayd/hce.c index 308a8d7166b..c951b5ba8bb 100644 --- a/usr.sbin/relayd/hce.c +++ b/usr.sbin/relayd/hce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hce.c,v 1.8 2007/01/09 00:45:32 deraadt Exp $ */ +/* $OpenBSD: hce.c,v 1.9 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -45,7 +45,7 @@ void hce_dispatch_parent(int, short, void *); void hce_launch_checks(int, short, void *); int hce_checks_done(void); -static struct hostated *env = NULL; +static struct hoststated *env = NULL; struct imsgbuf *ibuf_pfe; struct imsgbuf *ibuf_main; @@ -62,7 +62,7 @@ hce_sig_handler(int sig, short event, void *arg) } pid_t -hce(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], +hce(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], int pipe_pfe2hce[2]) { pid_t pid; @@ -88,7 +88,7 @@ hce(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], if ((env->icmp6_sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) err(1, "socket"); - if ((pw = getpwnam(HOSTATED_USER)) == NULL) + if ((pw = getpwnam(HOSTSTATED_USER)) == NULL) fatal("hce: getpwnam"); if (chroot(pw->pw_dir) == -1) @@ -97,7 +97,7 @@ hce(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], fatal("hce: chdir(\"/\")"); setproctitle("host check engine"); - hostated_process = PROC_HCE; + hoststated_process = PROC_HCE; if (setgroups(1, &pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y index 66c0e120541..e3428244243 100644 --- a/usr.sbin/relayd/parse.y +++ b/usr.sbin/relayd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.14 2007/01/09 00:45:32 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.15 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -43,7 +43,7 @@ #include "hoststated.h" -struct hostated *conf = NULL; +struct hoststated *conf = NULL; static FILE *fin = NULL; static int lineno = 1; static int errors = 0; @@ -742,7 +742,7 @@ top: } int -parse_config(struct hostated *x_conf, const char *filename, int opts) +parse_config(struct hoststated *x_conf, const char *filename, int opts) { struct sym *sym, *next; @@ -775,7 +775,7 @@ parse_config(struct hostated *x_conf, const char *filename, int opts) /* Free macros and check which have not been used. */ for (sym = TAILQ_FIRST(&symhead); sym != NULL; sym = next) { next = TAILQ_NEXT(sym, entries); - if ((conf->opts & HOSTATED_OPT_VERBOSE) && !sym->used) + if ((conf->opts & HOSTSTATED_OPT_VERBOSE) && !sym->used) fprintf(stderr, "warning: macro '%s' not " "used\n", sym->nam); if (!sym->persist) { diff --git a/usr.sbin/relayd/pfe.c b/usr.sbin/relayd/pfe.c index 1ee1c529937..4c14a2b6a2f 100644 --- a/usr.sbin/relayd/pfe.c +++ b/usr.sbin/relayd/pfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfe.c,v 1.6 2007/01/09 00:45:32 deraadt Exp $ */ +/* $OpenBSD: pfe.c,v 1.7 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -40,7 +40,7 @@ void pfe_dispatch_parent(int, short, void *); void pfe_sync(void); -static struct hostated *env = NULL; +static struct hoststated *env = NULL; struct imsgbuf *ibuf_main; struct imsgbuf *ibuf_hce; @@ -58,7 +58,7 @@ pfe_sig_handler(int sig, short event, void *arg) } pid_t -pfe(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], +pfe(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], int pipe_pfe2hce[2]) { pid_t pid; @@ -83,7 +83,7 @@ pfe(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], init_filter(env); init_tables(env); - if ((pw = getpwnam(HOSTATED_USER)) == NULL) + if ((pw = getpwnam(HOSTSTATED_USER)) == NULL) fatal("pfe: getpwnam"); if (chroot(pw->pw_dir) == -1) @@ -92,7 +92,7 @@ pfe(struct hostated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], fatal("pfe: chdir(\"/\")"); setproctitle("pf update engine"); - hostated_process = PROC_PFE; + hoststated_process = PROC_PFE; if (setgroups(1, &pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || diff --git a/usr.sbin/relayd/pfe_filter.c b/usr.sbin/relayd/pfe_filter.c index 50fe7456ad9..18e0af927e3 100644 --- a/usr.sbin/relayd/pfe_filter.c +++ b/usr.sbin/relayd/pfe_filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfe_filter.c,v 1.8 2007/01/09 00:45:32 deraadt Exp $ */ +/* $OpenBSD: pfe_filter.c,v 1.9 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -44,12 +44,12 @@ struct pfdata { struct pfioc_trans_e pfte; }; -int transaction_init(struct hostated *, const char *); -int transaction_commit(struct hostated *); -void kill_tables(struct hostated *); +int transaction_init(struct hoststated *, const char *); +int transaction_commit(struct hoststated *); +void kill_tables(struct hoststated *); void -init_filter(struct hostated *env) +init_filter(struct hoststated *env) { struct pf_status status; @@ -65,7 +65,7 @@ init_filter(struct hostated *env) } void -init_tables(struct hostated *env) +init_tables(struct hoststated *env) { int i; struct service *service; @@ -77,7 +77,7 @@ init_tables(struct hostated *env) i = 0; TAILQ_FOREACH(service, &env->services, entry) { - (void)strlcpy(tables[i].pfrt_anchor, HOSTATED_ANCHOR "/", + (void)strlcpy(tables[i].pfrt_anchor, HOSTSTATED_ANCHOR "/", sizeof(tables[i].pfrt_anchor)); (void)strlcat(tables[i].pfrt_anchor, service->name, sizeof(tables[i].pfrt_anchor)); @@ -111,13 +111,13 @@ init_tables(struct hostated *env) } void -kill_tables(struct hostated *env) { +kill_tables(struct hoststated *env) { struct pfioc_table io; struct service *service; memset(&io, 0, sizeof(io)); TAILQ_FOREACH(service, &env->services, entry) { - (void)strlcpy(io.pfrio_table.pfrt_anchor, HOSTATED_ANCHOR "/", + (void)strlcpy(io.pfrio_table.pfrt_anchor, HOSTSTATED_ANCHOR "/", sizeof(io.pfrio_table.pfrt_anchor)); (void)strlcat(io.pfrio_table.pfrt_anchor, service->name, sizeof(io.pfrio_table.pfrt_anchor)); @@ -128,7 +128,7 @@ kill_tables(struct hostated *env) { } void -sync_table(struct hostated *env, struct service *service, struct table *table) +sync_table(struct hoststated *env, struct service *service, struct table *table) { int i; struct pfioc_table io; @@ -153,7 +153,7 @@ sync_table(struct hostated *env, struct service *service, struct table *table) io.pfrio_size = table->up; io.pfrio_size2 = 0; io.pfrio_buffer = addlist; - (void)strlcpy(io.pfrio_table.pfrt_anchor, HOSTATED_ANCHOR "/", + (void)strlcpy(io.pfrio_table.pfrt_anchor, HOSTSTATED_ANCHOR "/", sizeof(io.pfrio_table.pfrt_anchor)); (void)strlcat(io.pfrio_table.pfrt_anchor, service->name, sizeof(io.pfrio_table.pfrt_anchor)); @@ -200,12 +200,12 @@ sync_table(struct hostated *env, struct service *service, struct table *table) } void -flush_table(struct hostated *env, struct service *service) +flush_table(struct hoststated *env, struct service *service) { struct pfioc_table io; memset(&io, 0, sizeof(io)); - (void)strlcpy(io.pfrio_table.pfrt_anchor, HOSTATED_ANCHOR "/", + (void)strlcpy(io.pfrio_table.pfrt_anchor, HOSTSTATED_ANCHOR "/", sizeof(io.pfrio_table.pfrt_anchor)); (void)strlcat(io.pfrio_table.pfrt_anchor, service->name, sizeof(io.pfrio_table.pfrt_anchor)); @@ -218,7 +218,7 @@ flush_table(struct hostated *env, struct service *service) } int -transaction_init(struct hostated *env, const char *anchor) +transaction_init(struct hoststated *env, const char *anchor) { env->pf->pft.size = 1; env->pf->pft.esize = sizeof env->pf->pfte; @@ -234,7 +234,7 @@ transaction_init(struct hostated *env, const char *anchor) } int -transaction_commit(struct hostated *env) +transaction_commit(struct hoststated *env) { if (ioctl(env->pf->dev, DIOCXCOMMIT, &env->pf->pft) == -1) return (-1); @@ -242,7 +242,7 @@ transaction_commit(struct hostated *env) } void -sync_ruleset(struct hostated *env, struct service *service, int enable) +sync_ruleset(struct hoststated *env, struct service *service, int enable) { struct pfioc_rule rio; struct pfioc_pooladdr pio; @@ -252,7 +252,7 @@ sync_ruleset(struct hostated *env, struct service *service, int enable) char anchor[PF_ANCHOR_NAME_SIZE]; bzero(anchor, sizeof(anchor)); - (void)strlcpy(anchor, HOSTATED_ANCHOR "/", sizeof(anchor)); + (void)strlcpy(anchor, HOSTSTATED_ANCHOR "/", sizeof(anchor)); (void)strlcat(anchor, service->name, sizeof(anchor)); transaction_init(env, anchor); @@ -323,19 +323,19 @@ sync_ruleset(struct hostated *env, struct service *service, int enable) } void -flush_rulesets(struct hostated *env) +flush_rulesets(struct hoststated *env) { struct service *service; char anchor[PF_ANCHOR_NAME_SIZE]; kill_tables(env); TAILQ_FOREACH(service, &env->services, entry) { - strlcpy(anchor, HOSTATED_ANCHOR "/", sizeof(anchor)); + strlcpy(anchor, HOSTSTATED_ANCHOR "/", sizeof(anchor)); strlcat(anchor, service->name, sizeof(anchor)); transaction_init(env, anchor); transaction_commit(env); } - strlcpy(anchor, HOSTATED_ANCHOR, sizeof(anchor)); + strlcpy(anchor, HOSTSTATED_ANCHOR, sizeof(anchor)); transaction_init(env, anchor); transaction_commit(env); log_debug("flush_rulesets: flushed rules"); diff --git a/usr.sbin/relayd/relayd.8 b/usr.sbin/relayd/relayd.8 index 23c27d50376..9988e416086 100644 --- a/usr.sbin/relayd/relayd.8 +++ b/usr.sbin/relayd/relayd.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: relayd.8,v 1.4 2006/12/18 19:48:04 jmc Exp $ +.\" $OpenBSD: relayd.8,v 1.5 2007/01/09 13:50:11 pyr Exp $ .\" .\" Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> .\" @@ -15,10 +15,10 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd November 1, 2006 -.Dt HOSTATED 8 +.Dt HOSTSTATED 8 .Os .Sh NAME -.Nm hostated +.Nm hoststated .Nd Host Status daemon .Sh SYNOPSIS .Nm @@ -40,7 +40,7 @@ to install rulesets through the anchor, the following line is required in the NAT section of .Xr pf.conf 5 : .Bd -literal -offset indent -rdr-anchor "hostated/*" +rdr-anchor "hoststated/*" .Ed .Pp .Nm @@ -55,11 +55,11 @@ Additionally a table can be backed up i.e. its content will be swapped by the content of another table when it is empty. This can be used to serve static content when a dynamic service goes down. See -.Xr hostated.conf 5 +.Xr hoststated.conf 5 for a more detailed explanation of how to configure .Nm . .Pp -.Xr hostatectl 8 +.Xr hoststatectl 8 can be used to enable or disable hosts, tables, and services as well as showing the current status of each object. .Pp @@ -74,7 +74,7 @@ will run in the foreground and log to .It Fl f Ar file Specify an alternative configuration file. The default is -.Pa /etc/hostated.conf . +.Pa /etc/hoststated.conf . .It Fl n Configtest mode. Only check the configuration file for validity. @@ -82,15 +82,15 @@ Only check the configuration file for validity. Produce more verbose output. .El .Sh FILES -.Bl -tag -width "/var/run/hostated.sockXX" -compact -.It /etc/hostated.conf +.Bl -tag -width "/var/run/hoststated.sockXX" -compact +.It /etc/hoststated.conf Default .Nm configuration file. -.It /var/run/hostated.sock +.It /var/run/hoststated.sock Unix-domain socket used for communication with -.Xr hostatectl 8 . +.Xr hoststatectl 8 . .El .Sh SEE ALSO -.Xr hostated.conf 5 , -.Xr hostatectl 8 +.Xr hoststated.conf 5 , +.Xr hoststatectl 8 diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c index d916fd8385d..1507f4d19fb 100644 --- a/usr.sbin/relayd/relayd.c +++ b/usr.sbin/relayd/relayd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayd.c,v 1.8 2007/01/09 02:32:58 reyk Exp $ */ +/* $OpenBSD: relayd.c,v 1.9 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -98,7 +98,7 @@ main(int argc, char *argv[]) int c; int debug; u_int32_t opts; - struct hostated env; + struct hoststated env; const char *conffile; struct event ev_sigint; struct event ev_sigterm; @@ -116,13 +116,13 @@ main(int argc, char *argv[]) debug = 1; break; case 'n': - opts |= HOSTATED_OPT_NOACTION; + opts |= HOSTSTATED_OPT_NOACTION; break; case 'f': conffile = optarg; break; case 'v': - opts |= HOSTATED_OPT_VERBOSE; + opts |= HOSTSTATED_OPT_VERBOSE; break; default: usage(); @@ -134,7 +134,7 @@ main(int argc, char *argv[]) if (parse_config(&env, conffile, opts)) exit(1); - if (env.opts & HOSTATED_OPT_NOACTION) { + if (env.opts & HOSTSTATED_OPT_NOACTION) { fprintf(stderr, "configuration OK\n"); exit(0); } @@ -142,8 +142,8 @@ main(int argc, char *argv[]) if (geteuid()) errx(1, "need root privileges"); - if (getpwnam(HOSTATED_USER) == NULL) - errx(1, "unknown user %s", HOSTATED_USER); + if (getpwnam(HOSTSTATED_USER) == NULL) + errx(1, "unknown user %s", HOSTSTATED_USER); if (!debug) daemon(1, 0); @@ -342,7 +342,7 @@ main_dispatch_hce(int fd, short event, void * ptr) } struct host * -host_find(struct hostated *env, objid_t id) +host_find(struct hoststated *env, objid_t id) { struct table *table; struct host *host; @@ -355,7 +355,7 @@ host_find(struct hostated *env, objid_t id) } struct table * -table_find(struct hostated *env, objid_t id) +table_find(struct hoststated *env, objid_t id) { struct table *table; @@ -366,7 +366,7 @@ table_find(struct hostated *env, objid_t id) } struct service * -service_find(struct hostated *env, objid_t id) +service_find(struct hoststated *env, objid_t id) { struct service *service; @@ -377,7 +377,7 @@ service_find(struct hostated *env, objid_t id) } struct host * -host_findbyname(struct hostated *env, const char *name) +host_findbyname(struct hoststated *env, const char *name) { struct table *table; struct host *host; @@ -390,7 +390,7 @@ host_findbyname(struct hostated *env, const char *name) } struct table * -table_findbyname(struct hostated *env, const char *name) +table_findbyname(struct hoststated *env, const char *name) { struct table *table; @@ -401,7 +401,7 @@ table_findbyname(struct hostated *env, const char *name) } struct service * -service_findbyname(struct hostated *env, const char *name) +service_findbyname(struct hoststated *env, const char *name) { struct service *service; diff --git a/usr.sbin/relayd/relayd.conf.5 b/usr.sbin/relayd/relayd.conf.5 index 5b92fe3aee6..6ff747e51a0 100644 --- a/usr.sbin/relayd/relayd.conf.5 +++ b/usr.sbin/relayd/relayd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: relayd.conf.5,v 1.12 2007/01/08 20:46:18 reyk Exp $ +.\" $OpenBSD: relayd.conf.5,v 1.13 2007/01/09 13:50:11 pyr Exp $ .\" .\" Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> .\" @@ -15,15 +15,15 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd November 1, 2006 -.Dt HOSTATED.CONF 5 +.Dt HOSTSTATED.CONF 5 .Os .Sh NAME -.Nm hostated.conf +.Nm hoststated.conf .Nd Host Status daemon configuration file .Sh DESCRIPTION .Nm is the configuration file for the Host Status Daemon, -.Xr hostated 8 . +.Xr hoststated 8 . .Sh SECTIONS .Nm is divided into four main sections: @@ -33,7 +33,7 @@ User-defined variables may be defined and used later, simplifying the configuration file. .It Sy Global Configuration Global settings for -.Xr hostated 8 . +.Xr hoststated 8 . .It Sy Tables Table definitions describe the content of a .Xr pf 4 @@ -150,7 +150,7 @@ Use a simple TCP connect to check that hosts are up. .It Ic disable Start the table disabled \(en no hosts will be checked in this table. The table can be later enabled through -.Xr hostatectl 8 . +.Xr hoststatectl 8 . .It Ic host Ar address Add the host whose address is .Ar address @@ -182,7 +182,7 @@ are seen as down or disabled. .It Ic disable Set the service initially disabled. It can be later enabled through -.Xr hostatectl 8 . +.Xr hoststatectl 8 . .It Ic sticky-address This has the same effect than specifying sticky-address for a rdr rule in @@ -246,19 +246,19 @@ service www { virtual ip www.example.com port 8080 interface trunk0 virtual ip www6.example.com port 80 interface trunk0 - tag HOSTATED + tag HOSTSTATED table phphosts backup table sorryhost } .Ed .Sh FILES -.Bl -tag -width "/etc/hostated.conf" -compact -.It Pa /etc/hostated.conf -.Xr hostated 8 +.Bl -tag -width "/etc/hoststated.conf" -compact +.It Pa /etc/hoststated.conf +.Xr hoststated 8 configuration file .It Pa /etc/services Service name database .El .Sh SEE ALSO -.Xr hostatectl 8 , -.Xr hostated 8 +.Xr hoststatectl 8 , +.Xr hoststated 8 diff --git a/usr.sbin/relayd/relayd.h b/usr.sbin/relayd/relayd.h index 432f19ff0f9..a21a3a4bd7f 100644 --- a/usr.sbin/relayd/relayd.h +++ b/usr.sbin/relayd/relayd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: relayd.h,v 1.12 2007/01/09 03:32:56 reyk Exp $ */ +/* $OpenBSD: relayd.h,v 1.13 2007/01/09 13:50:11 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -17,20 +17,20 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define CONF_FILE "/etc/hostated.conf" -#define HOSTATED_SOCKET "/var/run/hostated.sock" -#define PF_SOCKET "/dev/pf" -#define HOSTATED_USER "_hostated" -#define HOSTATED_ANCHOR "hostated" -#define CHECK_TIMEOUT 200 -#define CHECK_INTERVAL 10 -#define EMPTY_TABLE UINT_MAX -#define EMPTY_ID UINT_MAX -#define TABLE_NAME_SIZE 32 -#define TAG_NAME_SIZE 64 -#define SRV_NAME_SIZE 64 -#define MAX_NAME_SIZE 64 -#define SRV_MAX_VIRTS 16 +#define CONF_FILE "/etc/hoststated.conf" +#define HOSTSTATED_SOCKET "/var/run/hoststated.sock" +#define PF_SOCKET "/dev/pf" +#define HOSTSTATED_USER "_hoststated" +#define HOSTSTATED_ANCHOR "hoststated" +#define CHECK_TIMEOUT 200 +#define CHECK_INTERVAL 10 +#define EMPTY_TABLE UINT_MAX +#define EMPTY_ID UINT_MAX +#define TABLE_NAME_SIZE 32 +#define TAG_NAME_SIZE 64 +#define SRV_NAME_SIZE 64 +#define MAX_NAME_SIZE 64 +#define SRV_MAX_VIRTS 16 #define SMALL_READ_BUF_SIZE 1024 #define READ_BUF_SIZE 65535 @@ -74,13 +74,13 @@ struct imsgbuf { enum imsg_type { IMSG_NONE, - IMSG_CTL_OK, /* answer to hostatectl requests */ + IMSG_CTL_OK, /* answer to hoststatectl requests */ IMSG_CTL_FAIL, IMSG_CTL_END, IMSG_CTL_SERVICE, IMSG_CTL_TABLE, IMSG_CTL_HOST, - IMSG_CTL_SHOW_SUM, /* hostatectl requests */ + IMSG_CTL_SHOW_SUM, /* hoststatectl requests */ IMSG_CTL_SERVICE_ENABLE, IMSG_CTL_SERVICE_DISABLE, IMSG_CTL_TABLE_ENABLE, @@ -125,14 +125,14 @@ struct ctl_id { }; struct ctl_icmp_event { - struct hostated *env; - int icmp_sock; - int icmp6_sock; - int has_icmp4; - int has_icmp6; - int last_up; - struct event ev; - struct timeval tv_start; + struct hoststated *env; + int icmp_sock; + int icmp6_sock; + int has_icmp4; + int has_icmp6; + int last_up; + struct event ev; + struct timeval tv_start; }; struct ctl_tcp_event { @@ -223,9 +223,9 @@ enum { PROC_MAIN, PROC_PFE, PROC_HCE -} hostated_process; +} hoststated_process; -struct hostated { +struct hoststated { u_int8_t opts; struct pfdata *pf; int icmp_sock; @@ -241,8 +241,8 @@ struct hostated { struct ctl_icmp_event cie; }; -#define HOSTATED_OPT_VERBOSE 0x01 -#define HOSTATED_OPT_NOACTION 0x04 +#define HOSTSTATED_OPT_VERBOSE 0x01 +#define HOSTSTATED_OPT_NOACTION 0x04 /* initially control.h */ struct { @@ -275,7 +275,7 @@ void session_socket_blockmode(int, enum blockmodes); extern struct ctl_connlist ctl_conns; /* parse.y */ -int parse_config(struct hostated *, const char *, int); +int parse_config(struct hoststated *, const char *, int); /* log.c */ void log_init(int); @@ -312,7 +312,7 @@ void imsg_free(struct imsg *); void imsg_event_add(struct imsgbuf *); /* needs to be provided externally */ /* pfe.c */ -pid_t pfe(struct hostated *, int [2], int [2], int [2]); +pid_t pfe(struct hoststated *, int [2], int [2], int [2]); void show(struct ctl_conn *); int enable_service(struct ctl_conn *, struct ctl_id *); int enable_table(struct ctl_conn *, struct ctl_id *); @@ -322,15 +322,15 @@ int disable_table(struct ctl_conn *, struct ctl_id *); int disable_host(struct ctl_conn *, struct ctl_id *); /* pfe_filter.c */ -void init_filter(struct hostated *); -void init_tables(struct hostated *); -void flush_table(struct hostated *, struct service *); -void sync_table(struct hostated *, struct service *, struct table *); -void sync_ruleset(struct hostated *, struct service *, int); -void flush_rulesets(struct hostated *); +void init_filter(struct hoststated *); +void init_tables(struct hoststated *); +void flush_table(struct hoststated *, struct service *); +void sync_table(struct hoststated *, struct service *, struct table *); +void sync_ruleset(struct hoststated *, struct service *, int); +void flush_rulesets(struct hoststated *); /* hce.c */ -pid_t hce(struct hostated *, int [2], int [2], int [2]); +pid_t hce(struct hoststated *, int [2], int [2], int [2]); void hce_notify_done(struct host *, const char *); /* check_icmp.c */ @@ -346,10 +346,10 @@ void send_http_request(struct ctl_tcp_event *); /* check_send_expect.c */ void start_send_expect(struct ctl_tcp_event *); -/* hostated.c */ -struct host *host_find(struct hostated *, objid_t); -struct table *table_find(struct hostated *, objid_t); -struct service *service_find(struct hostated *, objid_t); -struct host *host_findbyname(struct hostated *, const char *); -struct table *table_findbyname(struct hostated *, const char *); -struct service *service_findbyname(struct hostated *, const char *); +/* hoststated.c */ +struct host *host_find(struct hoststated *, objid_t); +struct table *table_find(struct hoststated *, objid_t); +struct service *service_find(struct hoststated *, objid_t); +struct host *host_findbyname(struct hoststated *, const char *); +struct table *table_findbyname(struct hoststated *, const char *); +struct service *service_findbyname(struct hoststated *, const char *); |