From: florian Date: Tue, 10 Jul 2018 22:14:19 +0000 (+0000) Subject: remove newd control leftovers X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ce74f912b307936d94eedb0596d522d8bcc68862;p=openbsd remove newd control leftovers --- diff --git a/usr.sbin/rad/control.c b/usr.sbin/rad/control.c index 1771ad3d4b9..4d3a8568d95 100644 --- a/usr.sbin/rad/control.c +++ b/usr.sbin/rad/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.1 2018/07/10 16:39:54 florian Exp $ */ +/* $OpenBSD: control.c,v 1.2 2018/07/10 22:14:19 florian Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -267,22 +267,6 @@ control_dispatch_imsg(int fd, short event, void *bula) memcpy(&verbose, imsg.data, sizeof(verbose)); log_setverbose(verbose); break; - case IMSG_CTL_SHOW_MAIN_INFO: - c->iev.ibuf.pid = imsg.hdr.pid; - frontend_imsg_compose_main(imsg.hdr.type, imsg.hdr.pid, - imsg.data, imsg.hdr.len - IMSG_HEADER_SIZE); - break; - case IMSG_CTL_SHOW_FRONTEND_INFO: - frontend_showinfo_ctl(c); - imsg_compose_event(&c->iev, IMSG_CTL_END, 0, 0, -1, - NULL, 0); - break; - case IMSG_CTL_SHOW_ENGINE_INFO: - c->iev.ibuf.pid = imsg.hdr.pid; - frontend_imsg_compose_engine(imsg.hdr.type, - imsg.hdr.pid, - imsg.data, imsg.hdr.len - IMSG_HEADER_SIZE); - break; default: log_debug("%s: error handling imsg %d", __func__, imsg.hdr.type); diff --git a/usr.sbin/rad/engine.c b/usr.sbin/rad/engine.c index 11221199a4b..a5d74cd12de 100644 --- a/usr.sbin/rad/engine.c +++ b/usr.sbin/rad/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.2 2018/07/10 22:13:16 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.3 2018/07/10 22:14:19 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser @@ -47,7 +47,6 @@ __dead void engine_shutdown(void); void engine_sig_handler(int sig, short, void *); void engine_dispatch_frontend(int, short, void *); void engine_dispatch_main(int, short, void *); -void engine_showinfo_ctl(struct imsg *); void parse_ra_rs(struct imsg_ra_rs *); void parse_ra(struct imsg_ra_rs *); void parse_rs(struct imsg_ra_rs *); @@ -207,9 +206,6 @@ engine_dispatch_frontend(int fd, short event, void *bula) memcpy(&verbose, imsg.data, sizeof(verbose)); log_setverbose(verbose); break; - case IMSG_CTL_SHOW_ENGINE_INFO: - engine_showinfo_ctl(&imsg); - break; default: log_debug("%s: unexpected imsg %d", __func__, imsg.hdr.type); @@ -342,36 +338,6 @@ engine_dispatch_main(int fd, short event, void *bula) } } -void -engine_showinfo_ctl(struct imsg *imsg) -{ - char filter[IF_NAMESIZE]; - struct ctl_engine_info cei; - struct ra_iface_conf *ra_iface_conf; - - switch (imsg->hdr.type) { - case IMSG_CTL_SHOW_ENGINE_INFO: - memcpy(filter, imsg->data, sizeof(filter)); - SIMPLEQ_FOREACH(ra_iface_conf, &engine_conf->ra_iface_list, - entry) { - if (filter[0] == '\0' || memcmp(filter, - ra_iface_conf->name, sizeof(filter)) == 0) { - memcpy(cei.name, ra_iface_conf->name, - sizeof(cei.name)); - - engine_imsg_compose_frontend( - IMSG_CTL_SHOW_ENGINE_INFO, imsg->hdr.pid, - &cei, sizeof(cei)); - } - } - engine_imsg_compose_frontend(IMSG_CTL_END, imsg->hdr.pid, NULL, - 0); - break; - default: - log_debug("%s: error handling imsg", __func__); - break; - } -} void parse_ra_rs(struct imsg_ra_rs *ra_rs) diff --git a/usr.sbin/rad/frontend.c b/usr.sbin/rad/frontend.c index 5a33378b194..76a70b477ab 100644 --- a/usr.sbin/rad/frontend.c +++ b/usr.sbin/rad/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.1 2018/07/10 16:39:54 florian Exp $ */ +/* $OpenBSD: frontend.c,v 1.2 2018/07/10 22:14:19 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser @@ -408,10 +408,6 @@ frontend_dispatch_main(int fd, short event, void *bula) fatal("pledge"); frontend_startup(); break; - case IMSG_CTL_END: - case IMSG_CTL_SHOW_MAIN_INFO: - control_imsg_relay(&imsg); - break; default: log_debug("%s: error handling imsg %d", __func__, imsg.hdr.type); @@ -458,10 +454,6 @@ frontend_dispatch_engine(int fd, short event, void *bula) break; switch (imsg.hdr.type) { - case IMSG_CTL_END: - case IMSG_CTL_SHOW_ENGINE_INFO: - control_imsg_relay(&imsg); - break; case IMSG_SEND_RA: if (imsg.hdr.len != IMSG_HEADER_SIZE + sizeof(send_ra)) fatal("%s: IMSG_SEND_RA wrong length: %d", @@ -487,15 +479,6 @@ frontend_dispatch_engine(int fd, short event, void *bula) } } -void -frontend_showinfo_ctl(struct ctl_conn *c) -{ - static struct ctl_frontend_info cfi; - - imsg_compose_event(&c->iev, IMSG_CTL_SHOW_FRONTEND_INFO, 0, 0, -1, - &cfi, sizeof(struct ctl_frontend_info)); -} - void frontend_startup(void) { diff --git a/usr.sbin/rad/frontend.h b/usr.sbin/rad/frontend.h index ac368cb7e33..e67aac4274c 100644 --- a/usr.sbin/rad/frontend.h +++ b/usr.sbin/rad/frontend.h @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.h,v 1.1 2018/07/10 16:39:54 florian Exp $ */ +/* $OpenBSD: frontend.h,v 1.2 2018/07/10 22:14:19 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser @@ -24,4 +24,3 @@ void frontend_dispatch_main(int, short, void *); void frontend_dispatch_engine(int, short, void *); int frontend_imsg_compose_main(int, pid_t, void *, uint16_t); int frontend_imsg_compose_engine(int, pid_t, void *, uint16_t); -void frontend_showinfo_ctl(struct ctl_conn *); diff --git a/usr.sbin/rad/rad.c b/usr.sbin/rad/rad.c index ae3a4238817..944938480e6 100644 --- a/usr.sbin/rad/rad.c +++ b/usr.sbin/rad/rad.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rad.c,v 1.1 2018/07/10 16:39:54 florian Exp $ */ +/* $OpenBSD: rad.c,v 1.2 2018/07/10 22:14:19 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser @@ -53,11 +53,6 @@ const char* imsg_type_name[] = { "IMSG_NONE", "IMSG_CTL_LOG_VERBOSE", - "IMSG_CTL_RELOAD", - "IMSG_CTL_SHOW_ENGINE_INFO", - "IMSG_CTL_SHOW_FRONTEND_INFO", - "IMSG_CTL_SHOW_MAIN_INFO", - "IMSG_CTL_END", "IMSG_RECONF_CONF", "IMSG_RECONF_RA_IFACE", "IMSG_RECONF_RA_AUTOPREFIX", @@ -84,7 +79,6 @@ static int main_imsg_send_config(struct rad_conf *); int main_reload(void); int main_sendboth(enum imsg_type, void *, uint16_t); -void main_showinfo_ctl(struct imsg *); void free_ra_iface_conf(struct ra_iface_conf *); void in6_prefixlen2mask(struct in6_addr *, int len); @@ -434,9 +428,6 @@ main_dispatch_frontend(int fd, short event, void *bula) memcpy(&verbose, imsg.data, sizeof(verbose)); log_setverbose(verbose); break; - case IMSG_CTL_SHOW_MAIN_INFO: - main_showinfo_ctl(&imsg); - break; default: log_debug("%s: error handling imsg %s", __func__, imsg_type_name[imsg.hdr.type]); @@ -631,37 +622,6 @@ main_sendboth(enum imsg_type type, void *buf, uint16_t len) return (0); } -void -main_showinfo_ctl(struct imsg *imsg) -{ - struct ctl_main_info cmi; - size_t n; - - switch (imsg->hdr.type) { - case IMSG_CTL_SHOW_MAIN_INFO: - memset(cmi.text, 0, sizeof(cmi.text)); - n = strlcpy(cmi.text, "I'm a little teapot.", - sizeof(cmi.text)); - if (n >= sizeof(cmi.text)) - log_debug("%s: I was cut off!", __func__); - main_imsg_compose_frontend(IMSG_CTL_SHOW_MAIN_INFO, - imsg->hdr.pid, &cmi, sizeof(cmi)); - memset(cmi.text, 0, sizeof(cmi.text)); - n = strlcpy(cmi.text, "Full of sencha.", - sizeof(cmi.text)); - if (n >= sizeof(cmi.text)) - log_debug("%s: I was cut off!", __func__); - main_imsg_compose_frontend(IMSG_CTL_SHOW_MAIN_INFO, - imsg->hdr.pid, &cmi, sizeof(cmi)); - main_imsg_compose_frontend(IMSG_CTL_END, imsg->hdr.pid, NULL, - 0); - break; - default: - log_debug("%s: error handling imsg", __func__); - break; - } -} - void free_ra_iface_conf(struct ra_iface_conf *ra_iface_conf) { diff --git a/usr.sbin/rad/rad.h b/usr.sbin/rad/rad.h index d670d1d18ea..c86b9b22d75 100644 --- a/usr.sbin/rad/rad.h +++ b/usr.sbin/rad/rad.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rad.h,v 1.1 2018/07/10 16:39:54 florian Exp $ */ +/* $OpenBSD: rad.h,v 1.2 2018/07/10 22:14:19 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser @@ -51,10 +51,6 @@ enum imsg_type { IMSG_NONE, IMSG_CTL_LOG_VERBOSE, IMSG_CTL_RELOAD, - IMSG_CTL_SHOW_ENGINE_INFO, - IMSG_CTL_SHOW_FRONTEND_INFO, - IMSG_CTL_SHOW_MAIN_INFO, - IMSG_CTL_END, IMSG_RECONF_CONF, IMSG_RECONF_RA_IFACE, IMSG_RECONF_RA_AUTOPREFIX, @@ -106,22 +102,6 @@ struct rad_conf { SIMPLEQ_HEAD(ra_iface_conf_head, ra_iface_conf) ra_iface_list; }; -struct ctl_frontend_info { - int yesno; - int integer; - char global_text[RAD_MAXTEXT]; -}; - -struct ctl_engine_info { - char name[IF_NAMESIZE]; - int yesno; - int integer; -}; - -struct ctl_main_info { - char text[RAD_MAXTEXT]; -}; - struct imsg_ra_rs { uint32_t if_index; struct sockaddr_in6 from;