Mercurial > dropbear
comparison listener.h @ 9:7f77962de998
- Reworked non-channel fd handling to listener.c
- More channel cleaning up
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 03 Jun 2004 16:45:53 +0000 |
parents | |
children | db2c8e6fb284 |
comparison
equal
deleted
inserted
replaced
7:425ed5c20157 | 9:7f77962de998 |
---|---|
1 #ifndef _LISTENER_H | |
2 #define _LISTENER_H | |
3 | |
4 #define MAX_LISTENERS 20 | |
5 #define LISTENER_EXTEND_SIZE 1 | |
6 | |
7 struct Listener { | |
8 | |
9 int sock; | |
10 | |
11 int index; /* index in the array of listeners */ | |
12 | |
13 void (*accepter)(struct Listener*); | |
14 void (*cleanup)(struct Listener*); | |
15 | |
16 int type; /* CHANNEL_ID_X11, CHANNEL_ID_AGENT, | |
17 CHANNEL_ID_TCPDIRECT (for clients), | |
18 CHANNEL_ID_TCPFORWARDED (for servers) */ | |
19 | |
20 void *typedata; | |
21 | |
22 }; | |
23 | |
24 void listener_initialise(); | |
25 void handle_listeners(fd_set * readfds); | |
26 void set_listener_fds(fd_set * readfds); | |
27 | |
28 struct Listener* new_listener(int sock, int type, void* typedata, | |
29 void (*accepter)(struct Listener*), | |
30 void (*cleanup)(struct Listener*)); | |
31 | |
32 struct Listener * get_listener(int type, void* typedata, | |
33 int (*match)(void*, void*)); | |
34 | |
35 void remove_listener(struct Listener* listener); | |
36 | |
37 #endif /* _LISTENER_H */ |