remove newd control leftovers
authorflorian <florian@openbsd.org>
Tue, 10 Jul 2018 22:14:19 +0000 (22:14 +0000)
committerflorian <florian@openbsd.org>
Tue, 10 Jul 2018 22:14:19 +0000 (22:14 +0000)
usr.sbin/rad/control.c
usr.sbin/rad/engine.c
usr.sbin/rad/frontend.c
usr.sbin/rad/frontend.h
usr.sbin/rad/rad.c
usr.sbin/rad/rad.h

index 1771ad3..4d3a856 100644 (file)
@@ -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 <henning@openbsd.org>
@@ -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);
index 1122119..a5d74cd 100644 (file)
@@ -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 <florian@openbsd.org>
@@ -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)
index 5a33378..76a70b4 100644 (file)
@@ -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 <florian@openbsd.org>
@@ -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)
 {
index ac368cb..e67aac4 100644 (file)
@@ -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 <florian@openbsd.org>
@@ -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 *);
index ae3a423..9449384 100644 (file)
@@ -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 <florian@openbsd.org>
 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)
 {
index d670d1d..c86b9b2 100644 (file)
@@ -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 <florian@openbsd.org>
@@ -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;