blob: c2af1d7876e908ae2758d227b8ac519dea4a1c0b [file] [log] [blame]
Harald Welte52b1f982008-12-23 20:25:15 +00001#ifndef _BSC_SELECT_H
2#define _BSC_SELECT_H
3
Harald Welte8470bf22008-12-25 23:28:35 +00004#include <openbsc/linuxlist.h>
5
Harald Welte52b1f982008-12-23 20:25:15 +00006#define BSC_FD_READ 0x0001
7#define BSC_FD_WRITE 0x0002
8#define BSC_FD_EXCEPT 0x0004
9
10struct bsc_fd {
11 struct llist_head list;
12 int fd;
13 unsigned int when;
14 int (*cb)(struct bsc_fd *fd, unsigned int what);
15 void *data;
16 unsigned int priv_nr;
17};
18
Harald Welte8470bf22008-12-25 23:28:35 +000019int bsc_register_fd(struct bsc_fd *fd);
20void bsc_unregister_fd(struct bsc_fd *fd);
Harald Welte04d3c922009-05-23 06:07:04 +000021int bsc_select_main(int polling);
Harald Welte52b1f982008-12-23 20:25:15 +000022#endif /* _BSC_SELECT_H */