-/* $OpenBSD: control.c,v 1.8 2018/08/05 08:10:35 mestre Exp $ */
+/* $OpenBSD: control.c,v 1.9 2021/01/19 10:37:25 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
#include "control.h"
#include "log.h"
+TAILQ_HEAD(ctl_conns, ctl_conn) ctl_conns = TAILQ_HEAD_INITIALIZER(ctl_conns);
+
#define CONTROL_BACKLOG 5
static void control_accept(int, short, void *);
static void control_close(int);
static void control_dispatch_imsg(int, short, void *);
+struct {
+ struct event ev;
+ struct event evt;
+ int fd;
+} control_state;
+
+
int
control_init(char *path)
{
int
control_listen(void)
{
-
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
log_warn("%s: listen", __func__);
return (-1);
-/* $OpenBSD: control.h,v 1.4 2018/08/05 08:10:35 mestre Exp $ */
+/* $OpenBSD: control.h,v 1.5 2021/01/19 10:37:25 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
#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: eigrpe.c,v 1.37 2021/01/19 10:31:12 claudio Exp $ */
+/* $OpenBSD: eigrpe.c,v 1.38 2021/01/19 10:37:25 claudio Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
event_add(&ev6, NULL);
/* listen on eigrpd control socket */
- TAILQ_INIT(&ctl_conns);
control_listen();
event_dispatch();
-/* $OpenBSD: eigrpe.h,v 1.17 2021/01/19 10:31:12 claudio Exp $ */
+/* $OpenBSD: eigrpe.h,v 1.18 2021/01/19 10:37:25 claudio Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
#include <event.h>
-TAILQ_HEAD(ctl_conns, ctl_conn) ctl_conns;
-
struct pbuf {
struct ibuf *buf;
int refcnt;
extern struct eigrpd_conf *econf;
+struct ctl_conn;
+
/* eigrpe.c */
void eigrpe(int, int, char *);
int eigrpe_imsg_compose_parent(int, pid_t, void *, uint16_t);