summaryrefslogtreecommitdiff
path: root/lib/socket.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2021-06-19 20:50:18 +0200
committerMaria Matejka <mq@ucw.cz>2021-11-22 19:05:43 +0100
commit94eb0858c2b938549d9d1703c872c6149901e7dd (patch)
tree2eb0cff73002b4278916c1ad6865b7a85b680bd1 /lib/socket.h
parentc84ed603714db2c42a781f8dbb5b3fd540ff689f (diff)
Converting the former BFD loop to a universal IO loop and protocol loop.
There is a simple universal IO loop, taking care of events, timers and sockets. Primarily, one instance of a protocol should use exactly one IO loop to do all its work, as is now done in BFD. Contrary to previous versions, the loop is now launched and cleaned by the nest/proto.c code, allowing for a protocol to just request its own loop by setting the loop's lock order in config higher than the_bird. It is not supported nor checked if any protocol changed the requested lock order in reconfigure. No protocol should do it at all.
Diffstat (limited to 'lib/socket.h')
-rw-r--r--lib/socket.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/socket.h b/lib/socket.h
index 96fedeeb..5bdab7f3 100644
--- a/lib/socket.h
+++ b/lib/socket.h
@@ -12,6 +12,7 @@
#include <errno.h>
#include "lib/resource.h"
+#include "lib/event.h"
#ifdef HAVE_LIBSSH
#define LIBSSH_LEGACY_0_4
#include <libssh/libssh.h>
@@ -79,6 +80,7 @@ typedef struct birdsock {
const char *password; /* Password for MD5 authentication */
const char *err; /* Error message */
struct ssh_sock *ssh; /* Used in SK_SSH */
+ struct event reloop; /* Reloop event */
} sock;
sock *sock_new(pool *); /* Allocate new socket */
@@ -128,6 +130,7 @@ extern int sk_priority_control; /* Suggested priority for control traffic, shou
#define SKF_TRUNCATED 0x200 /* Received packet was truncated, set by IO layer */
#define SKF_HDRINCL 0x400 /* Used internally */
#define SKF_PKTINFO 0x800 /* Used internally */
+#define SKF_PASSIVE_THREAD 0x1000 /* Child sockets used in thread, do not add to main loop */
/*
* Socket types SA SP DA DP IF TTL SendTo (?=may, -=must not, *=must)