Files
adsb-tools/adsbus/peer.h

27 lines
617 B
C
Raw Normal View History

2016-02-22 16:49:43 -08:00
#pragma once
#include <sys/epoll.h>
#include "list.h"
2016-02-22 16:49:43 -08:00
// All specific peer structs must be castable to this.
struct peer;
typedef void (*peer_event_handler)(struct peer *);
struct peer {
int fd;
peer_event_handler event_handler;
struct list_head peer_always_trigger_list;
bool always_trigger;
2016-02-22 16:49:43 -08:00
};
2016-02-25 16:17:25 -08:00
2016-03-02 22:10:55 -08:00
extern uint32_t peer_count_in, peer_count_out, peer_count_out_in;
2016-02-25 16:17:25 -08:00
void peer_init(void);
void peer_cleanup(void);
void peer_shutdown(int signal);
2016-02-22 16:49:43 -08:00
void peer_epoll_add(struct peer *, uint32_t);
void peer_epoll_del(struct peer *);
2016-03-08 20:41:00 -08:00
void peer_close(struct peer *);
void peer_call(struct peer *);
void peer_loop(void);