ekg2
|
00001 #ifndef __JABBER_DCC_H 00002 #define __JABBER_DCC_H 00003 00004 #define JABBER_DEFAULT_DCC_PORT 6000 /* XXX */ 00005 00006 #include <ekg/plugins.h> 00007 00008 #include <stdio.h> 00009 00010 #include <ekg/dynstuff.h> 00011 #include <ekg/protocol.h> 00012 00013 enum jabber_dcc_protocol_type_t { 00014 JABBER_DCC_PROTOCOL_UNKNOWN = 0, 00015 JABBER_DCC_PROTOCOL_BYTESTREAMS, /* http://www.jabber.org/jeps/jep-0065.html */ 00016 JABBER_DCC_PROTOCOL_IBB, /* http://www.jabber.org/jeps/jep-0047.html */ 00017 JABBER_DCC_PROTOCOL_WEBDAV, /* http://www.jabber.org/jeps/jep-0129.html */ /* DON'T IMPLEMENT IT UNTILL IT WILL BE STARNDARD DRAFT */ 00018 }; 00019 00020 enum jabber_socks5_step_t { 00021 SOCKS5_UNKNOWN = 0, 00022 SOCKS5_CONNECT, 00023 SOCKS5_AUTH, 00024 SOCKS5_DATA, 00025 }; 00026 00027 /* <JABBER_DCC_PROTOCOL_BYTESTREAMS> */ 00028 struct jabber_streamhost_item { 00029 char *jid; 00030 char *ip; 00031 int port; 00032 }; 00033 00034 typedef struct { 00035 int validate; /* should be: JABBER_DCC_PROTOCOL_BYTESTREAMS */ 00036 enum jabber_socks5_step_t step; 00037 00038 struct jabber_streamhost_item *streamhost; 00039 list_t streamlist; 00040 } jabber_dcc_bytestream_t; 00041 00042 /* </JABBER_DCC_PROTOCOL_BYTESTREAMS> */ 00043 00044 00045 typedef struct { 00046 FILE *fd; 00047 int sfd; 00048 session_t *session; 00049 00050 char *req; 00051 char *sid; 00052 enum jabber_dcc_protocol_type_t protocol; 00053 union { /* priv_data data based on protocol */ 00054 jabber_dcc_bytestream_t *bytestream; /* for JABBER_DCC_PROTOCOL_BYTESTREAMS */ 00055 void *other; /* XXX */ 00056 } priv_data; 00057 } jabber_dcc_t; 00058 00059 00060 dcc_t *jabber_dcc_find(const char *uin, const char *id, const char *sid); 00061 void jabber_dcc_close_handler(struct dcc_s *d); 00062 00063 WATCHER(jabber_dcc_handle_recv); 00064 00065 QUERY(jabber_dcc_postinit); 00066 extern int jabber_dcc; 00067 extern int jabber_dcc_port; 00068 extern char *jabber_dcc_ip; 00069 extern int jabber_dcc; 00070 00071 #endif