mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-23 02:01:55 +00:00
57 lines
928 B
C
57 lines
928 B
C
/*
|
|
* BIRD -- I/O and event loop
|
|
*
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
*/
|
|
|
|
#ifndef _BIRD_SYSDEP_UNIX_IO_LOOP_H_
|
|
#define _BIRD_SYSDEP_UNIX_IO_LOOP_H_
|
|
|
|
#include "lib/rcu.h"
|
|
|
|
struct pipe
|
|
{
|
|
int fd[2];
|
|
};
|
|
|
|
void pipe_new(struct pipe *);
|
|
void pipe_pollin(struct pipe *, struct pollfd *);
|
|
void pipe_drain(struct pipe *);
|
|
void pipe_kick(struct pipe *);
|
|
|
|
struct birdloop
|
|
{
|
|
pool *pool;
|
|
|
|
struct timeloop time;
|
|
event_list event_list;
|
|
list sock_list;
|
|
uint sock_num;
|
|
|
|
BUFFER(sock *) poll_sk;
|
|
BUFFER(struct pollfd) poll_fd;
|
|
u8 poll_changed;
|
|
u8 close_scheduled;
|
|
|
|
uint ping_pending;
|
|
_Atomic u32 ping_sent;
|
|
struct pipe wakeup;
|
|
|
|
pthread_t thread_id;
|
|
pthread_attr_t thread_attr;
|
|
|
|
struct rcu_birdloop rcu;
|
|
|
|
uint links;
|
|
|
|
_Atomic u32 flags;
|
|
struct birdloop_flag_handler *flag_handler;
|
|
|
|
void (*stopped)(void *data);
|
|
void *stop_data;
|
|
|
|
struct birdloop *prev_loop;
|
|
};
|
|
|
|
#endif
|