diff options
author | Matt Johnston <matt@ucc.asn.au> | 2004-06-03 16:45:53 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2004-06-03 16:45:53 +0000 |
commit | 444dbb5364798925a3cacddba7b1bb3041e41a23 (patch) | |
tree | ac499ac58516073528397e2470fcf6c0dc6fe1d9 /listener.h | |
parent | 513f947d62351e5af77676e20740232d753cd5b1 (diff) |
- Reworked non-channel fd handling to listener.c
- More channel cleaning up
--HG--
extra : convert_revision : 385ec76d0304b93e277d1cc193383db5fd773703
Diffstat (limited to 'listener.h')
-rw-r--r-- | listener.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/listener.h b/listener.h new file mode 100644 index 0000000..ab77351 --- /dev/null +++ b/listener.h @@ -0,0 +1,37 @@ +#ifndef _LISTENER_H +#define _LISTENER_H + +#define MAX_LISTENERS 20 +#define LISTENER_EXTEND_SIZE 1 + +struct Listener { + + int sock; + + int index; /* index in the array of listeners */ + + void (*accepter)(struct Listener*); + void (*cleanup)(struct Listener*); + + int type; /* CHANNEL_ID_X11, CHANNEL_ID_AGENT, + CHANNEL_ID_TCPDIRECT (for clients), + CHANNEL_ID_TCPFORWARDED (for servers) */ + + void *typedata; + +}; + +void listener_initialise(); +void handle_listeners(fd_set * readfds); +void set_listener_fds(fd_set * readfds); + +struct Listener* new_listener(int sock, int type, void* typedata, + void (*accepter)(struct Listener*), + void (*cleanup)(struct Listener*)); + +struct Listener * get_listener(int type, void* typedata, + int (*match)(void*, void*)); + +void remove_listener(struct Listener* listener); + +#endif /* _LISTENER_H */ |