comparison listener.h @ 62:20563735e8b5

just checkpointing
author Matt Johnston <matt@ucc.asn.au>
date Tue, 10 Aug 2004 17:09:52 +0000
parents db2c8e6fb284
children dcc43965928f
comparison
equal deleted inserted replaced
61:3a4f0ef1e8c3 62:20563735e8b5
4 #define MAX_LISTENERS 20 4 #define MAX_LISTENERS 20
5 #define LISTENER_EXTEND_SIZE 1 5 #define LISTENER_EXTEND_SIZE 1
6 6
7 struct Listener { 7 struct Listener {
8 8
9 int sock; 9 int socks[DROPBEAR_MAX_SOCKS];
10 unsigned int nsocks;
10 11
11 int index; /* index in the array of listeners */ 12 int index; /* index in the array of listeners */
12 13
13 void (*accepter)(struct Listener*); 14 void (*accepter)(struct Listener*, int sock);
14 void (*cleanup)(struct Listener*); 15 void (*cleanup)(struct Listener*);
15 16
16 int type; /* CHANNEL_ID_X11, CHANNEL_ID_AGENT, 17 int type; /* CHANNEL_ID_X11, CHANNEL_ID_AGENT,
17 CHANNEL_ID_TCPDIRECT (for clients), 18 CHANNEL_ID_TCPDIRECT (for clients),
18 CHANNEL_ID_TCPFORWARDED (for servers) */ 19 CHANNEL_ID_TCPFORWARDED (for servers) */
23 24
24 void listeners_initialise(); 25 void listeners_initialise();
25 void handle_listeners(fd_set * readfds); 26 void handle_listeners(fd_set * readfds);
26 void set_listener_fds(fd_set * readfds); 27 void set_listener_fds(fd_set * readfds);
27 28
28 struct Listener* new_listener(int sock, int type, void* typedata, 29 struct Listener* new_listener(int socks[], unsigned int nsocks,
29 void (*accepter)(struct Listener*), 30 int type, void* typedata,
31 void (*accepter)(struct Listener*, int sock),
30 void (*cleanup)(struct Listener*)); 32 void (*cleanup)(struct Listener*));
31 33
32 struct Listener * get_listener(int type, void* typedata, 34 struct Listener * get_listener(int type, void* typedata,
33 int (*match)(void*, void*)); 35 int (*match)(void*, void*));
34 36