comparison listener.h @ 63:dcc43965928f

- A nice cleaner structure for tcp (acceptor) forwarding. - still a checkpoint-ish commit - sorted out listening on localhost only
author Matt Johnston <matt@ucc.asn.au>
date Wed, 11 Aug 2004 17:26:47 +0000
parents 20563735e8b5
children e3adf4cf5465
comparison
equal deleted inserted replaced
62:20563735e8b5 63:dcc43965928f
9 int socks[DROPBEAR_MAX_SOCKS]; 9 int socks[DROPBEAR_MAX_SOCKS];
10 unsigned int nsocks; 10 unsigned int nsocks;
11 11
12 int index; /* index in the array of listeners */ 12 int index; /* index in the array of listeners */
13 13
14 void (*accepter)(struct Listener*, int sock); 14 void (*acceptor)(struct Listener*, int sock);
15 void (*cleanup)(struct Listener*); 15 void (*cleanup)(struct Listener*);
16 16
17 int type; /* CHANNEL_ID_X11, CHANNEL_ID_AGENT, 17 int type; /* CHANNEL_ID_X11, CHANNEL_ID_AGENT,
18 CHANNEL_ID_TCPDIRECT (for clients), 18 CHANNEL_ID_TCPDIRECT (for clients),
19 CHANNEL_ID_TCPFORWARDED (for servers) */ 19 CHANNEL_ID_TCPFORWARDED (for servers) */
26 void handle_listeners(fd_set * readfds); 26 void handle_listeners(fd_set * readfds);
27 void set_listener_fds(fd_set * readfds); 27 void set_listener_fds(fd_set * readfds);
28 28
29 struct Listener* new_listener(int socks[], unsigned int nsocks, 29 struct Listener* new_listener(int socks[], unsigned int nsocks,
30 int type, void* typedata, 30 int type, void* typedata,
31 void (*accepter)(struct Listener*, int sock), 31 void (*acceptor)(struct Listener* listener, int sock),
32 void (*cleanup)(struct Listener*)); 32 void (*cleanup)(struct Listener*));
33 33
34 struct Listener * get_listener(int type, void* typedata, 34 struct Listener * get_listener(int type, void* typedata,
35 int (*match)(void*, void*)); 35 int (*match)(void*, void*));
36 36