summaryrefslogtreecommitdiff
path: root/sysdep/unix/io-loop.h
blob: 4024b6c5715c304386c1f9dccc8e6e9f3d1d1a18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 *	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_

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;

  _Atomic u32 ping_sent;
  int wakeup_fds[2];

  uint links;

  void (*stopped)(void *data);
  void *stop_data;

  struct birdloop *prev_loop;
};

#endif