summaryrefslogtreecommitdiffstats
path: root/redir.h
diff options
context:
space:
mode:
authorkraxel <kraxel>2007-08-13 11:09:36 +0000
committerkraxel <kraxel>2007-08-13 11:09:36 +0000
commit72058ecf9b8eaeb125d585026e5b3be2b5a1a4ca (patch)
tree9fafc5248c47efab89e06b533d1944c7a46a34f4 /redir.h
parent409e6fb4eae15ef0e30333550474724f0f4ef561 (diff)
downloadamtterm-72058ecf9b8eaeb125d585026e5b3be2b5a1a4ca.tar.gz
add missing files
Diffstat (limited to 'redir.h')
-rw-r--r--redir.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/redir.h b/redir.h
new file mode 100644
index 0000000..fe785b8
--- /dev/null
+++ b/redir.h
@@ -0,0 +1,39 @@
+#include "RedirectionConstants.h"
+
+enum redir_state {
+ REDIR_NONE = 0,
+ REDIR_INIT = 1,
+ REDIR_AUTH = 2,
+ REDIR_INIT_SOL = 10,
+ REDIR_CONN_SOL = 11,
+ REDIR_INIT_IDER = 20,
+ REDIR_CONN_IDER = 21,
+ REDIR_CLOSING = 30,
+ REDIR_CLOSED = 31,
+ REDIR_ERROR = 99,
+};
+
+struct redir {
+ int sock;
+ int verbose;
+ unsigned char type[4];
+ unsigned char user[16];
+ unsigned char pass[16];
+ enum redir_state state;
+
+ /* callbacks */
+ void *cb_data;
+ void (*cb_state)(void *cb_data, enum redir_state old, enum redir_state new);
+ int (*cb_recv)(void *cb_data, unsigned char *buf, int len);
+};
+
+const char *redir_strstate(enum redir_state state);
+
+int redir_start(struct redir *r);
+int redir_stop(struct redir *r);
+int redir_auth(struct redir *r);
+int redir_sol_start(struct redir *r);
+int redir_sol_stop(struct redir *r);
+int redir_sol_send(struct redir *r, unsigned char *buf, int blen);
+int redir_sol_recv(struct redir *r, unsigned char *buf, int blen);
+int redir_data(struct redir *r);