diff options
author | Maria Matejka <mq@ucw.cz> | 2023-04-02 19:15:22 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2023-04-04 17:00:59 +0200 |
commit | 836e857b3098f8962c621a33f7ae5b532cf512f3 (patch) | |
tree | 96c62361fd7b2dd57cecdf9d9b9323f8aa95f021 /lib/io-loop.h | |
parent | 571c4f69bfbcf437d848b332bb2f4995fea2347d (diff) |
Sockets: Unified API for main and other loops
Now sk_open() requires an explicit IO loop to open the socket in. Also
specific functions for socket RX pause / resume are added to allow for
BGP corking.
And last but not least, socket reloop is now synchronous to resolve
weird cases of the target loop stopping before actually picking up the
relooped socket. Now the caller must ensure that both loops are locked
while relooping, and this way all sockets always have their respective
loop.
Diffstat (limited to 'lib/io-loop.h')
-rw-r--r-- | lib/io-loop.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/io-loop.h b/lib/io-loop.h index ae58bbee..502d77fc 100644 --- a/lib/io-loop.h +++ b/lib/io-loop.h @@ -16,10 +16,6 @@ extern struct birdloop main_birdloop; -void sk_start(sock *s); -void sk_stop(sock *s); -void sk_reloop(sock *s, struct birdloop *loop); - /* Start a new birdloop owned by given pool and domain */ struct birdloop *birdloop_new(pool *p, uint order, const char *name); @@ -58,6 +54,10 @@ struct birdloop_flag_handler { void birdloop_flag(struct birdloop *loop, u32 flag); void birdloop_flag_set_handler(struct birdloop *, struct birdloop_flag_handler *); +/* Setup sockets */ +void birdloop_add_socket(struct birdloop *, struct birdsock *); +void birdloop_remove_socket(struct birdloop *, struct birdsock *); + void birdloop_init(void); /* Yield for a little while. Use only in special cases. */ |