diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-12-08 20:11:49 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-12-08 20:11:49 +0000 |
commit | 870f679c22c06acd39bf5f1c3d8db9758e4c0e93 (patch) | |
tree | fd20c055db0a1cd3a9833f1fe2fc4297b5b5b699 | |
parent | cdd4c967628b44ef33a88123e948b7dbbb5c3b20 (diff) |
service -> redirect
ok pyr@
-rw-r--r-- | usr.sbin/relayctl/parser.c | 6 | ||||
-rw-r--r-- | usr.sbin/relayctl/relayctl.8 | 20 | ||||
-rw-r--r-- | usr.sbin/relayctl/relayctl.c | 30 |
3 files changed, 28 insertions, 28 deletions
diff --git a/usr.sbin/relayctl/parser.c b/usr.sbin/relayctl/parser.c index 26906333924..a7fa7e5d444 100644 --- a/usr.sbin/relayctl/parser.c +++ b/usr.sbin/relayctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.17 2007/12/07 17:17:01 reyk Exp $ */ +/* $OpenBSD: parser.c,v 1.18 2007/12/08 20:11:48 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -71,7 +71,7 @@ static const struct token t_main[] = { {KEYWORD, "poll", POLL, NULL}, {KEYWORD, "reload", RELOAD, NULL}, {KEYWORD, "stop", SHUTDOWN, NULL}, - {KEYWORD, "service", NONE, t_service}, + {KEYWORD, "redirect", NONE, t_service}, {KEYWORD, "table", NONE, t_table}, {KEYWORD, "host", NONE, t_host}, {ENDTOKEN, "", NONE, NULL} @@ -246,7 +246,7 @@ show_valid_args(const struct token table[]) fprintf(stderr, " %s\n", table[i].keyword); break; case SERVICEID: - fprintf(stderr, " <serviceid>\n"); + fprintf(stderr, " <redirectid>\n"); break; case TABLEID: fprintf(stderr, " <tableid>\n"); diff --git a/usr.sbin/relayctl/relayctl.8 b/usr.sbin/relayctl/relayctl.8 index af1cb4af72f..0a0620199b4 100644 --- a/usr.sbin/relayctl/relayctl.8 +++ b/usr.sbin/relayctl/relayctl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: relayctl.8,v 1.17 2007/12/08 17:07:09 reyk Exp $ +.\" $OpenBSD: relayctl.8,v 1.18 2007/12/08 20:11:48 reyk Exp $ .\" .\" Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> .\" @@ -46,19 +46,19 @@ pf engine. Schedule an immediate check of all hosts. .It Cm reload Reload the configuration file. -.It Cm service disable Op Ar name | id -Disable a service. +.It Cm redirect disable Op Ar name | id +Disable a redirection. If it has .Xr pf 4 redirection rules installed, remove them. -Mark the service's main table and \(en +Mark the redirection's main table and \(en if applicable \(en backup table disabled as well. -.It Cm service enable Op Ar name | id -Enable a service. -Mark the service's main table and \(en if applicable \(en backup +.It Cm redirect enable Op Ar name | id +Enable a redirection. +Mark the redirection's main table and \(en if applicable \(en backup table enabled as well. .It Cm show hosts -Show detailed status of hosts, tables, and services. +Show detailed status of hosts, tables, and redirections. .It Cm show relays Show detailed status of relays including the current and average access statistics. @@ -66,11 +66,11 @@ The statistics will be updated every minute. .It Cm show sessions Dump the complete list of running relay sessions. .It Cm show summary -Display a list of all relays, services, tables, and hosts. +Display a list of all relays, redirections, tables, and hosts. .It Cm table disable Op Ar name | id Disable a table. Consider all hosts disabled. -If it is a main table of a service which has a non-empty backup table, +If it is a main table of a redirection which has a non-empty backup table, swap the contents of the .Xr pf 4 table with those of the backup table. diff --git a/usr.sbin/relayctl/relayctl.c b/usr.sbin/relayctl/relayctl.c index 7b1fc0ccff8..8d86baab9ea 100644 --- a/usr.sbin/relayctl/relayctl.c +++ b/usr.sbin/relayctl/relayctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayctl.c,v 1.28 2007/12/07 17:17:01 reyk Exp $ */ +/* $OpenBSD: relayctl.c,v 1.29 2007/12/08 20:11:48 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -145,8 +145,8 @@ main(int argc, char *argv[]) case SHOW_HOSTS: case SHOW_RELAYS: imsg_compose(ibuf, IMSG_CTL_SHOW_SUM, 0, 0, -1, NULL, 0); - printf("Type\t%4s\t%-24s\t%-7s\tStatus\n", - "Id", "Name", "Avlblty"); + printf("%-4s\t%-8s\t%-24s\t%-7s\tStatus\n", + "Id", "Type", "Name", "Avlblty"); break; case SHOW_SESSIONS: imsg_compose(ibuf, IMSG_CTL_SESSION, 0, 0, -1, NULL, 0); @@ -318,28 +318,28 @@ show_summary_msg(struct imsg *imsg, int type) if (type == SHOW_RELAYS) break; service = imsg->data; - printf("service\t%4u\t%-24s\t%-7s\t%s\n", - service->conf.id, service->conf.name, "", + printf("%-4u\t%-8s\t%-24s\t%-7s\t%s\n", + service->conf.id, "redirect", service->conf.name, "", print_service_status(service->conf.flags)); break; case IMSG_CTL_TABLE: if (type == SHOW_RELAYS) break; table = imsg->data; - printf("table\t%4u\t%-24s\t%-7s\t%s\n", - table->conf.id, table->conf.name, "", + printf("%-4u\t%-8s\t%-24s\t%-7s\t%s\n", + table->conf.id, "table", table->conf.name, "", print_table_status(table->up, table->conf.flags)); break; case IMSG_CTL_HOST: if (type == SHOW_RELAYS) break; host = imsg->data; - printf("host\t%4u\t%-24s\t%-7s\t%s\n", - host->conf.id, host->conf.name, + printf("%-4u\t%-8s\t%-24s\t%-7s\t%s\n", + host->conf.id, "host", host->conf.name, print_availability(host->check_cnt, host->up_cnt), print_host_status(host->up, host->flags)); if (type == SHOW_HOSTS && host->check_cnt) { - printf("\t%4s\ttotal: %lu/%lu checks", + printf("\t%8s\ttotal: %lu/%lu checks", "", host->up_cnt, host->check_cnt); if (host->retry_cnt) printf(", %d retries", host->retry_cnt); @@ -350,8 +350,8 @@ show_summary_msg(struct imsg *imsg, int type) if (type == SHOW_HOSTS) break; rlay = imsg->data; - printf("relay\t%4u\t%-24s\t%-7s\t%s\n", - rlay->conf.id, rlay->conf.name, "", + printf("%-4u\t%-8s\t%-24s\t%-7s\t%s\n", + rlay->conf.id, "relay", rlay->conf.name, "", print_relay_status(rlay->conf.flags)); break; case IMSG_CTL_STATISTICS: @@ -371,9 +371,9 @@ show_summary_msg(struct imsg *imsg, int type) } if (crs.cnt == 0) break; - printf("\t%4s\ttotal: %lu sessions\n" - "\t%4s\tlast: %lu/%us %lu/h %lu/d sessions\n" - "\t%4s\taverage: %lu/%us %lu/h %lu/d sessions\n", + printf("\t%8s\ttotal: %lu sessions\n" + "\t%8s\tlast: %lu/%us %lu/h %lu/d sessions\n" + "\t%8s\taverage: %lu/%us %lu/h %lu/d sessions\n", "", crs.cnt, "", crs.last, crs.interval, crs.last_hour, crs.last_day, |