diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2009-06-05 00:20:51 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2009-06-05 00:20:51 +0000 |
commit | 948db6985e3ef14f4aeac282d48738a3cd64c599 (patch) | |
tree | f648b16b135667e193629bdb7bd4dc423997f504 /usr.sbin/relayd | |
parent | e7c72fa7318f594e47f10b4196cc7c769a51513a (diff) |
some KNF cleanup following the last sed.
Diffstat (limited to 'usr.sbin/relayd')
-rw-r--r-- | usr.sbin/relayd/control.c | 80 | ||||
-rw-r--r-- | usr.sbin/relayd/hce.c | 5 | ||||
-rw-r--r-- | usr.sbin/relayd/pfe.c | 18 | ||||
-rw-r--r-- | usr.sbin/relayd/relay.c | 11 | ||||
-rw-r--r-- | usr.sbin/relayd/relayd.c | 10 |
5 files changed, 67 insertions, 57 deletions
diff --git a/usr.sbin/relayd/control.c b/usr.sbin/relayd/control.c index 33124defa88..ba6963eebf7 100644 --- a/usr.sbin/relayd/control.c +++ b/usr.sbin/relayd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.30 2009/06/05 00:04:01 pyr Exp $ */ +/* $OpenBSD: control.c,v 1.31 2009/06/05 00:20:50 pyr Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -237,13 +237,13 @@ control_dispatch_imsg(int fd, short event, void *arg) fatalx("invalid imsg header len"); memcpy(&id, imsg.data, sizeof(id)); if (disable_rdr(c, &id)) - imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, + 0, 0, -1, NULL, 0); else { memcpy(imsg.data, &id, sizeof(id)); control_imsg_forward(&imsg); - imsg_compose_event(&c->ibuf, IMSG_CTL_OK, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_OK, + 0, 0, -1, NULL, 0); } break; case IMSG_CTL_RDR_ENABLE: @@ -251,13 +251,13 @@ control_dispatch_imsg(int fd, short event, void *arg) fatalx("invalid imsg header len"); memcpy(&id, imsg.data, sizeof(id)); if (enable_rdr(c, &id)) - imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, + 0, 0, -1, NULL, 0); else { memcpy(imsg.data, &id, sizeof(id)); control_imsg_forward(&imsg); - imsg_compose_event(&c->ibuf, IMSG_CTL_OK, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_OK, + 0, 0, -1, NULL, 0); } break; case IMSG_CTL_TABLE_DISABLE: @@ -265,13 +265,13 @@ control_dispatch_imsg(int fd, short event, void *arg) fatalx("invalid imsg header len"); memcpy(&id, imsg.data, sizeof(id)); if (disable_table(c, &id)) - imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, + 0, 0, -1, NULL, 0); else { memcpy(imsg.data, &id, sizeof(id)); control_imsg_forward(&imsg); - imsg_compose_event(&c->ibuf, IMSG_CTL_OK, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_OK, + 0, 0, -1, NULL, 0); } break; case IMSG_CTL_TABLE_ENABLE: @@ -279,13 +279,13 @@ control_dispatch_imsg(int fd, short event, void *arg) fatalx("invalid imsg header len"); memcpy(&id, imsg.data, sizeof(id)); if (enable_table(c, &id)) - imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, + 0, 0, -1, NULL, 0); else { memcpy(imsg.data, &id, sizeof(id)); control_imsg_forward(&imsg); - imsg_compose_event(&c->ibuf, IMSG_CTL_OK, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_OK, + 0, 0, -1, NULL, 0); } break; case IMSG_CTL_HOST_DISABLE: @@ -293,13 +293,13 @@ control_dispatch_imsg(int fd, short event, void *arg) fatalx("invalid imsg header len"); memcpy(&id, imsg.data, sizeof(id)); if (disable_host(c, &id, NULL)) - imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, + 0, 0, -1, NULL, 0); else { memcpy(imsg.data, &id, sizeof(id)); control_imsg_forward(&imsg); - imsg_compose_event(&c->ibuf, IMSG_CTL_OK, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_OK, + 0, 0, -1, NULL, 0); } break; case IMSG_CTL_HOST_ENABLE: @@ -307,31 +307,33 @@ control_dispatch_imsg(int fd, short event, void *arg) fatalx("invalid imsg header len"); memcpy(&id, imsg.data, sizeof(id)); if (enable_host(c, &id, NULL)) - imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, + 0, 0, -1, NULL, 0); else { memcpy(imsg.data, &id, sizeof(id)); control_imsg_forward(&imsg); - imsg_compose_event(&c->ibuf, IMSG_CTL_OK, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_OK, + 0, 0, -1, NULL, 0); } break; case IMSG_CTL_SHUTDOWN: - imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, 0, 0, -1, NULL, - 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, + 0, 0, -1, NULL, 0); break; case IMSG_CTL_POLL: - imsg_compose_event(ibuf_hce, IMSG_CTL_POLL, 0, 0,-1, NULL, 0); - imsg_compose_event(&c->ibuf, IMSG_CTL_OK, 0, 0, -1, NULL, 0); + imsg_compose_event(ibuf_hce, IMSG_CTL_POLL, + 0, 0,-1, NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_OK, + 0, 0, -1, NULL, 0); break; case IMSG_CTL_RELOAD: if (env->sc_prefork_relay > 0) { - imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, + 0, 0, -1, NULL, 0); break; } - imsg_compose_event(ibuf_main, IMSG_CTL_RELOAD, 0, 0, -1, NULL, - 0); + imsg_compose_event(ibuf_main, IMSG_CTL_RELOAD, + 0, 0, -1, NULL, 0); /* * we unconditionnaly return a CTL_OK imsg because * we have no choice. @@ -340,14 +342,15 @@ control_dispatch_imsg(int fd, short event, void *arg) * that the reload command has been set, * it doesn't say wether the command succeeded or not. */ - imsg_compose_event(&c->ibuf, IMSG_CTL_OK, 0, 0, -1, NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_OK, + 0, 0, -1, NULL, 0); break; case IMSG_CTL_NOTIFY: if (c->flags & CTL_CONN_NOTIFY) { log_debug("control_dispatch_imsg: " "client requested notify more than once"); - imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, 0, 0, -1, - NULL, 0); + imsg_compose_event(&c->ibuf, IMSG_CTL_FAIL, + 0, 0, -1, NULL, 0); break; } c->flags |= CTL_CONN_NOTIFY; @@ -370,8 +373,9 @@ control_imsg_forward(struct imsg *imsg) TAILQ_FOREACH(c, &ctl_conns, entry) if (c->flags & CTL_CONN_NOTIFY) - imsg_compose_event(&c->ibuf, imsg->hdr.type, 0, imsg->hdr.pid, - -1, imsg->data, imsg->hdr.len - IMSG_HEADER_SIZE); + imsg_compose_event(&c->ibuf, imsg->hdr.type, + 0, imsg->hdr.pid, -1, imsg->data, + imsg->hdr.len - IMSG_HEADER_SIZE); } void diff --git a/usr.sbin/relayd/hce.c b/usr.sbin/relayd/hce.c index 25013575e28..7f45ecf4e56 100644 --- a/usr.sbin/relayd/hce.c +++ b/usr.sbin/relayd/hce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hce.c,v 1.51 2009/06/05 00:04:01 pyr Exp $ */ +/* $OpenBSD: hce.c,v 1.52 2009/06/05 00:20:50 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -307,7 +307,8 @@ hce_notify_done(struct host *host, enum host_error he) if (msg) log_debug("hce_notify_done: %s (%s)", host->conf.name, msg); - imsg_compose_event(ibuf_pfe, IMSG_HOST_STATUS, 0, 0, -1, &st, sizeof(st)); + imsg_compose_event(ibuf_pfe, IMSG_HOST_STATUS, + 0, 0, -1, &st, sizeof(st)); if (host->up != host->last_up) logopt = RELAYD_OPT_LOGUPDATE; else diff --git a/usr.sbin/relayd/pfe.c b/usr.sbin/relayd/pfe.c index 166e257a54a..92dd86ab4af 100644 --- a/usr.sbin/relayd/pfe.c +++ b/usr.sbin/relayd/pfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfe.c,v 1.58 2009/06/05 00:04:01 pyr Exp $ */ +/* $OpenBSD: pfe.c,v 1.59 2009/06/05 00:20:50 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -489,8 +489,8 @@ pfe_dispatch_relay(int fd, short event, void * ptr) "invalid relay proc"); if (natlook(env, &cnl) != 0) cnl.in = -1; - imsg_compose_event(&ibuf_relay[cnl.proc], IMSG_NATLOOK, 0, 0, - -1, &cnl, sizeof(cnl)); + imsg_compose_event(&ibuf_relay[cnl.proc], IMSG_NATLOOK, + 0, 0, -1, &cnl, sizeof(cnl)); break; case IMSG_STATISTICS: if (imsg.hdr.len != IMSG_HEADER_SIZE + sizeof(crs)) @@ -537,8 +537,8 @@ show(struct ctl_conn *c) rdr->table, sizeof(*rdr->table)); if (!(rdr->table->conf.flags & F_DISABLE)) TAILQ_FOREACH(host, &rdr->table->hosts, entry) - imsg_compose_event(&c->ibuf, IMSG_CTL_HOST, 0, 0, -1, - host, sizeof(*host)); + imsg_compose_event(&c->ibuf, IMSG_CTL_HOST, + 0, 0, -1, host, sizeof(*host)); if (rdr->backup->conf.id == EMPTY_TABLE) continue; @@ -546,8 +546,8 @@ show(struct ctl_conn *c) rdr->backup, sizeof(*rdr->backup)); if (!(rdr->backup->conf.flags & F_DISABLE)) TAILQ_FOREACH(host, &rdr->backup->hosts, entry) - imsg_compose_event(&c->ibuf, IMSG_CTL_HOST, 0, 0, -1, - host, sizeof(*host)); + imsg_compose_event(&c->ibuf, IMSG_CTL_HOST, + 0, 0, -1, host, sizeof(*host)); } relays: if (env->sc_relays == NULL) @@ -565,8 +565,8 @@ relays: rlay->rl_dsttable, sizeof(*rlay->rl_dsttable)); if (!(rlay->rl_dsttable->conf.flags & F_DISABLE)) TAILQ_FOREACH(host, &rlay->rl_dsttable->hosts, entry) - imsg_compose_event(&c->ibuf, IMSG_CTL_HOST, 0, 0, -1, - host, sizeof(*host)); + imsg_compose_event(&c->ibuf, IMSG_CTL_HOST, + 0, 0, -1, host, sizeof(*host)); } end: imsg_compose_event(&c->ibuf, IMSG_CTL_END, 0, 0, -1, NULL, 0); diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c index 769af1fc32b..12366c63a52 100644 --- a/usr.sbin/relayd/relay.c +++ b/usr.sbin/relayd/relay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relay.c,v 1.113 2009/06/05 00:04:01 pyr Exp $ */ +/* $OpenBSD: relay.c,v 1.114 2009/06/05 00:20:50 pyr Exp $ */ /* * Copyright (c) 2006, 2007, 2008 Reyk Floeter <reyk@openbsd.org> @@ -2220,7 +2220,8 @@ relay_bindanyreq(struct session *con, in_port_t port, int proto) bnd.bnd_port = port; bnd.bnd_proto = proto; bcopy(&con->se_in.ss, &bnd.bnd_ss, sizeof(bnd.bnd_ss)); - imsg_compose_event(ibuf_main, IMSG_BINDANY, 0, 0, -1, &bnd, sizeof(bnd)); + imsg_compose_event(ibuf_main, IMSG_BINDANY, + 0, 0, -1, &bnd, sizeof(bnd)); /* Schedule timeout */ evtimer_set(&con->se_ev, relay_bindany, con); @@ -2498,9 +2499,11 @@ relay_dispatch_pfe(int fd, short event, void *ptr) TAILQ_FOREACH(rlay, env->sc_relays, rl_entry) SPLAY_FOREACH(con, session_tree, &rlay->rl_sessions) - imsg_compose_event(ibuf, IMSG_CTL_SESSION, + imsg_compose_event(ibuf, + IMSG_CTL_SESSION, 0, 0, -1, con, sizeof(*con)); - imsg_compose_event(ibuf, IMSG_CTL_END, 0, 0, -1, NULL, 0); + imsg_compose_event(ibuf, IMSG_CTL_END, + 0, 0, -1, NULL, 0); break; default: log_debug("relay_dispatch_msg: unexpected imsg %d", diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c index 4c2b999bcb6..c1b49370c4d 100644 --- a/usr.sbin/relayd/relayd.c +++ b/usr.sbin/relayd/relayd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayd.c,v 1.87 2009/06/05 00:04:01 pyr Exp $ */ +/* $OpenBSD: relayd.c,v 1.88 2009/06/05 00:20:50 pyr Exp $ */ /* * Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org> @@ -448,8 +448,9 @@ reconfigure(void) imsg_compose_event(ibuf_hce, IMSG_RECONF_TABLE, 0, 0, -1, &table->conf, sizeof(table->conf)); if (table->sendbuf != NULL) - imsg_compose_event(ibuf_hce, IMSG_RECONF_SENDBUF, 0, 0, -1, - table->sendbuf, strlen(table->sendbuf) + 1); + imsg_compose_event(ibuf_hce, IMSG_RECONF_SENDBUF, + 0, 0, -1, table->sendbuf, + strlen(table->sendbuf) + 1); TAILQ_FOREACH(host, &table->hosts, entry) { imsg_compose_event(ibuf_hce, IMSG_RECONF_HOST, 0, 0, -1, &host->conf, sizeof(host->conf)); @@ -765,7 +766,8 @@ main_dispatch_relay(int fd, short event, void * ptr) /* NOTREACHED */ } s = bindany(&bnd); - imsg_compose_event(&ibuf_relay[bnd.bnd_proc], IMSG_BINDANY, + imsg_compose_event(&ibuf_relay[bnd.bnd_proc], + IMSG_BINDANY, 0, 0, s, &bnd.bnd_id, sizeof(bnd.bnd_id)); break; default: |