and ctl_conns to control.c cleanup headers and the engine accordingly.
-/* $OpenBSD: control.c,v 1.23 2017/01/08 23:04:42 krw Exp $ */
+/* $OpenBSD: control.c,v 1.24 2021/01/19 12:23:30 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
#include "log.h"
#include "control.h"
+TAILQ_HEAD(ctl_conns, ctl_conn) ctl_conns = TAILQ_HEAD_INITIALIZER(ctl_conns);
+
#define CONTROL_BACKLOG 5
struct ctl_conn *control_connbyfd(int);
struct ctl_conn *control_connbypid(pid_t);
void control_close(int);
+struct {
+ struct event ev;
+ struct event evt;
+ int fd;
+} control_state;
+
int
control_init(void)
{
int
control_listen(void)
{
-
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
log_warn("control_listen: listen");
return (-1);
-/* $OpenBSD: control.h,v 1.5 2015/02/09 11:46:27 claudio Exp $ */
+/* $OpenBSD: control.h,v 1.6 2021/01/19 12:23:30 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
#include <sys/time.h>
#include <event.h>
-struct {
- struct event ev;
- struct event evt;
- int fd;
-} control_state;
-
struct ctl_conn {
TAILQ_ENTRY(ctl_conn) entry;
struct imsgev iev;
-/* $OpenBSD: dvmrpe.c,v 1.20 2021/01/19 11:46:10 claudio Exp $ */
+/* $OpenBSD: dvmrpe.c,v 1.21 2021/01/19 12:23:30 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
struct dvmrpd_conf *deconf = NULL;
struct imsgev *iev_main;
struct imsgev *iev_rde;
-struct ctl_conn *ctl_conn;
void
dvmrpe_sig_handler(int sig, short event, void *bula)
event_add(&deconf->ev, NULL);
/* listen on dvmrpd control socket */
- TAILQ_INIT(&ctl_conns);
control_listen();
/* start interfaces */
-/* $OpenBSD: dvmrpe.h,v 1.6 2021/01/19 11:46:10 claudio Exp $ */
+/* $OpenBSD: dvmrpe.h,v 1.7 2021/01/19 12:23:30 claudio Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Esben Norby <norby@openbsd.org>
#include <netinet/in.h>
#include <netinet/ip.h>
-TAILQ_HEAD(ctl_conns, ctl_conn) ctl_conns;
-
/* neighbor events */
enum nbr_event {
NBR_EVT_NOTHING,
struct route_report *re;
};
+struct ctl_conn;
+
/* ask_nbrs2.c */
int send_ask_nbrs2(struct iface *, struct in_addr, void *, int);
void recv_ask_nbrs2(struct nbr *, char *, u_int16_t);