1 /* 2 * aprsc 3 * 4 * (c) Heikki Hannikainen, OH7LZB <hessu@hes.iki.fi> 5 * 6 * This program is licensed under the BSD license, which can be found 7 * in the file LICENSE. 8 * 9 */ 10 11 #ifndef ACCEPT_H 12 #define ACCEPT_H 13 14 #include "config.h" 15 #include "cJSON.h" 16 17 /* 18 * The listen_t structure holds data for a currently open 19 * listener. It's allocated when a listener is created 20 * based on the configuration (listen_config_t). 21 */ 22 23 struct listen_t { 24 struct listen_t *next; 25 struct listen_t **prevp; 26 27 int id; /* random id */ 28 int listener_id; /* hash of protocol and local bound address */ 29 int fd; 30 int client_flags; 31 int portnum; 32 int clients_max; 33 int corepeer; 34 int hidden; 35 int ai_protocol; 36 37 struct client_udp_t *udp; 38 struct portaccount_t *portaccount; 39 struct acl_t *acl; 40 #ifdef USE_SSL 41 struct ssl_t *ssl; 42 #endif 43 44 char *name; 45 char *addr_s; 46 char *filters[LISTEN_MAX_FILTERS]; // up to 10 filter definitions 47 char *filter_s; 48 }; 49 50 51 extern int accept_reconfiguring; 52 extern int accept_shutting_down; 53 54 extern struct worker_t *udp_worker; 55 56 extern void accept_thread(void *asdf); 57 58 extern int accept_listener_status(cJSON *listeners, cJSON *totals); 59 60 extern int connections_accepted; 61 62 #endif 63