summaryrefslogtreecommitdiffhomepage
path: root/tcpfwd.h
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2004-06-01 02:46:09 +0000
committerMatt Johnston <matt@ucc.asn.au>2004-06-01 02:46:09 +0000
commit674a60748884dc55ee7091b7c23a41240e75f73c (patch)
tree3b5a173c356f867b94df3873b57ff36d33129ea7 /tcpfwd.h
Makefile.in contains updated files required
--HG-- extra : convert_revision : cc8a8c49dc70e632c352853a39801089b08149be
Diffstat (limited to 'tcpfwd.h')
-rw-r--r--tcpfwd.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/tcpfwd.h b/tcpfwd.h
new file mode 100644
index 0000000..85d7373
--- /dev/null
+++ b/tcpfwd.h
@@ -0,0 +1,37 @@
+#ifndef _TCPFWD_H
+#define _TCPFWD_H
+
+#define MAX_TCPLISTENERS 20
+#define TCP_EXTEND_SIZE 1
+
+struct TCPListener {
+
+ int sock;
+
+ int index; /* index in the array of listeners */
+
+ void (*accepter)(struct TCPListener*);
+ void (*cleanup)(struct TCPListener*);
+
+ int type; /* CHANNEL_ID_X11, CHANNEL_ID_AGENT,
+ CHANNEL_ID_TCPDIRECT (for clients),
+ CHANNEL_ID_TCPFORWARDED (for servers) */
+
+ void *typedata;
+
+};
+
+void tcp_fwd_initialise();
+void handle_tcp_fwd(fd_set * readfds);
+void set_tcp_fwd_fds(fd_set * readfds);
+
+int new_fwd(int sock, int type, void* typedata,
+ void (*accepter)(struct TCPListener*),
+ void (*cleanup)(struct TCPListener*));
+
+struct TCPListener * get_listener(int type, void* typedata,
+ int (*match)(void*, void*));
+
+void remove_listener(struct TCPListener* listener);
+
+#endif /* _TCPFWD_H */