diff options
author | pyr <pyr@openbsd.org> | 2007-12-08 20:36:36 +0000 |
---|---|---|
committer | pyr <pyr@openbsd.org> | 2007-12-08 20:36:36 +0000 |
commit | 9591a9f757a082f636d2679fa5cea759471b5f22 (patch) | |
tree | 713a4728b1d5a3601fa3f0db97bd88fddd1cb28f /usr.sbin/relayctl | |
parent | service -> redirect (diff) | |
download | wireguard-openbsd-9591a9f757a082f636d2679fa5cea759471b5f22.tar.xz wireguard-openbsd-9591a9f757a082f636d2679fa5cea759471b5f22.zip |
Rename everything which reffered to services refer to rdr for internals
(for instance: rename struct service to struct rdr), refer to redirects
otherwise (hoststatectl output).
ok reyk@
Diffstat (limited to 'usr.sbin/relayctl')
-rw-r--r-- | usr.sbin/relayctl/parser.c | 24 | ||||
-rw-r--r-- | usr.sbin/relayctl/parser.h | 6 | ||||
-rw-r--r-- | usr.sbin/relayctl/relayctl.c | 32 |
3 files changed, 31 insertions, 31 deletions
diff --git a/usr.sbin/relayctl/parser.c b/usr.sbin/relayctl/parser.c index a7fa7e5d444..f3316f2569e 100644 --- a/usr.sbin/relayctl/parser.c +++ b/usr.sbin/relayctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.18 2007/12/08 20:11:48 reyk Exp $ */ +/* $OpenBSD: parser.c,v 1.19 2007/12/08 20:36:36 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -45,7 +45,7 @@ enum token_type { ENDTOKEN, HOSTID, TABLEID, - SERVICEID, + RDRID, KEYWORD }; @@ -58,10 +58,10 @@ struct token { static const struct token t_main[]; static const struct token t_show[]; -static const struct token t_service[]; +static const struct token t_rdr[]; static const struct token t_table[]; static const struct token t_host[]; -static const struct token t_service_id[]; +static const struct token t_rdr_id[]; static const struct token t_table_id[]; static const struct token t_host_id[]; @@ -71,7 +71,7 @@ static const struct token t_main[] = { {KEYWORD, "poll", POLL, NULL}, {KEYWORD, "reload", RELOAD, NULL}, {KEYWORD, "stop", SHUTDOWN, NULL}, - {KEYWORD, "redirect", NONE, t_service}, + {KEYWORD, "redirect", NONE, t_rdr}, {KEYWORD, "table", NONE, t_table}, {KEYWORD, "host", NONE, t_host}, {ENDTOKEN, "", NONE, NULL} @@ -85,10 +85,10 @@ static const struct token t_show[] = { {ENDTOKEN, "", NONE, NULL} }; -static const struct token t_service[] = { +static const struct token t_rdr[] = { {NOTOKEN, "", NONE, NULL}, - {KEYWORD, "disable", SERV_DISABLE, t_service_id}, - {KEYWORD, "enable", SERV_ENABLE, t_service_id}, + {KEYWORD, "disable", RDR_DISABLE, t_rdr_id}, + {KEYWORD, "enable", RDR_ENABLE, t_rdr_id}, {ENDTOKEN, "", NONE, NULL} }; @@ -106,8 +106,8 @@ static const struct token t_host[] = { {ENDTOKEN, "", NONE, NULL} }; -static const struct token t_service_id[] = { - {SERVICEID, "", NONE, NULL}, +static const struct token t_rdr_id[] = { + {RDRID, "", NONE, NULL}, {ENDTOKEN, "", NONE, NULL} }; @@ -203,7 +203,7 @@ match_token(const char *word, const struct token table[]) t = &table[i]; match++; break; - case SERVICEID: + case RDRID: if (word == NULL) break; res.id.id = strtonum(word, 0, UINT_MAX, &errstr); @@ -245,7 +245,7 @@ show_valid_args(const struct token table[]) case KEYWORD: fprintf(stderr, " %s\n", table[i].keyword); break; - case SERVICEID: + case RDRID: fprintf(stderr, " <redirectid>\n"); break; case TABLEID: diff --git a/usr.sbin/relayctl/parser.h b/usr.sbin/relayctl/parser.h index c9c1e875fd2..32d9f79baeb 100644 --- a/usr.sbin/relayctl/parser.h +++ b/usr.sbin/relayctl/parser.h @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.h,v 1.7 2007/10/19 12:08:55 pyr Exp $ */ +/* $OpenBSD: parser.h,v 1.8 2007/12/08 20:36:36 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -22,8 +22,8 @@ enum actions { SHOW_HOSTS, SHOW_RELAYS, SHOW_SESSIONS, - SERV_DISABLE, - SERV_ENABLE, + RDR_DISABLE, + RDR_ENABLE, TABLE_DISABLE, TABLE_ENABLE, HOST_DISABLE, diff --git a/usr.sbin/relayctl/relayctl.c b/usr.sbin/relayctl/relayctl.c index 8d86baab9ea..59a1fdd1c30 100644 --- a/usr.sbin/relayctl/relayctl.c +++ b/usr.sbin/relayctl/relayctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayctl.c,v 1.29 2007/12/08 20:11:48 reyk Exp $ */ +/* $OpenBSD: relayctl.c,v 1.30 2007/12/08 20:36:36 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -47,7 +47,7 @@ __dead void usage(void); int show_summary_msg(struct imsg *, int); int show_session_msg(struct imsg *); int show_command_output(struct imsg *); -char *print_service_status(int); +char *print_rdr_status(int); char *print_host_status(int, int); char *print_table_status(int, int); char *print_relay_status(int); @@ -65,8 +65,8 @@ int monitor(struct imsg *); struct imsgname imsgs[] = { { IMSG_HOST_STATUS, "host_status", monitor_host_status }, - { IMSG_CTL_SERVICE_DISABLE, "ctl_disable_service", monitor_id }, - { IMSG_CTL_SERVICE_ENABLE, "ctl_service_enable", monitor_id }, + { IMSG_CTL_RDR_DISABLE, "ctl_rdr_disable", monitor_id }, + { IMSG_CTL_RDR_ENABLE, "ctl_rdr_enable", monitor_id }, { IMSG_CTL_TABLE_DISABLE, "ctl_table_disable", monitor_id }, { IMSG_CTL_TABLE_ENABLE, "ctl_table_enable", monitor_id }, { IMSG_CTL_HOST_DISABLE, "ctl_host_disable", monitor_id }, @@ -151,12 +151,12 @@ main(int argc, char *argv[]) case SHOW_SESSIONS: imsg_compose(ibuf, IMSG_CTL_SESSION, 0, 0, -1, NULL, 0); break; - case SERV_ENABLE: - imsg_compose(ibuf, IMSG_CTL_SERVICE_ENABLE, 0, 0, -1, + case RDR_ENABLE: + imsg_compose(ibuf, IMSG_CTL_RDR_ENABLE, 0, 0, -1, &res->id, sizeof(res->id)); break; - case SERV_DISABLE: - imsg_compose(ibuf, IMSG_CTL_SERVICE_DISABLE, 0, 0, -1, + case RDR_DISABLE: + imsg_compose(ibuf, IMSG_CTL_RDR_DISABLE, 0, 0, -1, &res->id, sizeof(res->id)); break; case TABLE_ENABLE: @@ -213,8 +213,8 @@ main(int argc, char *argv[]) case SHOW_SESSIONS: done = show_session_msg(&imsg); break; - case SERV_DISABLE: - case SERV_ENABLE: + case RDR_DISABLE: + case RDR_ENABLE: case TABLE_DISABLE: case TABLE_ENABLE: case HOST_DISABLE: @@ -306,7 +306,7 @@ monitor(struct imsg *imsg) int show_summary_msg(struct imsg *imsg, int type) { - struct service *service; + struct rdr *rdr; struct table *table; struct host *host; struct relay *rlay; @@ -314,13 +314,13 @@ show_summary_msg(struct imsg *imsg, int type) int i; switch (imsg->hdr.type) { - case IMSG_CTL_SERVICE: + case IMSG_CTL_RDR: if (type == SHOW_RELAYS) break; - service = imsg->data; + rdr = imsg->data; printf("%-4u\t%-8s\t%-24s\t%-7s\t%s\n", - service->conf.id, "redirect", service->conf.name, "", - print_service_status(service->conf.flags)); + rdr->conf.id, "redirect", rdr->conf.name, "", + print_rdr_status(rdr->conf.flags)); break; case IMSG_CTL_TABLE: if (type == SHOW_RELAYS) @@ -442,7 +442,7 @@ show_command_output(struct imsg *imsg) } char * -print_service_status(int flags) +print_rdr_status(int flags) { if (flags & F_DISABLE) { return ("disabled"); |