00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef _XJAB_JCON_H_
00033 #define _XJAB_JCON_H_
00034
00035 #include "../../str.h"
00036 #include "xjab_jconf.h"
00037 #include "xjab_base.h"
00038 #include "tree234.h"
00039 #include "xjab_presence.h"
00040
00041 #define XJ_NET_NUL 0
00042 #define XJ_NET_ALL 0xFFFFFFFF
00043 #define XJ_NET_JAB 1
00044 #define XJ_NET_AIM 2
00045 #define XJ_NET_ICQ 4
00046 #define XJ_NET_MSN 8
00047 #define XJ_NET_YAH 16
00048
00049 #define XJ_AIM_NAME "aim."
00050 #define XJ_AIM_LEN 4
00051 #define XJ_ICQ_NAME "icq"
00052 #define XJ_ICQ_LEN 3
00053 #define XJ_MSN_NAME "msn."
00054 #define XJ_MSN_LEN 4
00055 #define XJ_YAH_NAME "yahoo."
00056 #define XJ_YAH_LEN 6
00057
00058 #define XJ_JMSG_NORMAL 1
00059 #define XJ_JMSG_CHAT 2
00060 #define XJ_JMSG_GROUPCHAT 4
00061
00062 #define XJ_JCMD_SUBSCRIBE 1
00063 #define XJ_JCMD_UNSUBSCRIBE 2
00064
00065 typedef struct _xj_jcon
00066 {
00067 int sock;
00068 int port;
00069 int juid;
00070 int seq_nr;
00071 char *hostname;
00072 char *stream_id;
00073
00074 char *resource;
00075
00076 xj_jkey jkey;
00077 int expire;
00078 int allowed;
00079 int ready;
00080
00081 int nrjconf;
00082 tree234 *jconf;
00083 xj_pres_list plist;
00084 } t_xj_jcon, *xj_jcon;
00085
00087 xj_jcon xj_jcon_init(char*, int);
00088 int xj_jcon_free(xj_jcon);
00089
00090 int xj_jcon_connect(xj_jcon);
00091 int xj_jcon_disconnect(xj_jcon);
00092
00093 void xj_jcon_set_juid(xj_jcon, int);
00094 int xj_jcon_get_juid(xj_jcon);
00095
00096 int xj_jcon_get_roster(xj_jcon);
00097 int xj_jcon_set_roster(xj_jcon, char*, char*);
00098
00099 int xj_jcon_user_auth(xj_jcon, char*, char*, char*);
00100 int xj_jcon_send_presence(xj_jcon, char*, char*, char*, char*);
00101 int xj_jcon_send_subscribe(xj_jcon, char*, char*, char*);
00102
00103 int xj_jcon_send_msg(xj_jcon, char*, int, char*, int, int);
00104 int xj_jcon_send_sig_msg(xj_jcon, char*, int, char*, int, char*, int);
00105
00106 int xj_jcon_is_ready(xj_jcon, char *, int, char);
00107
00108 xj_jconf xj_jcon_get_jconf(xj_jcon, str*, char);
00109 xj_jconf xj_jcon_check_jconf(xj_jcon, char*);
00110 int xj_jcon_del_jconf(xj_jcon, str*, char, int);
00111 int xj_jcon_jconf_presence(xj_jcon, xj_jconf, char*, char*);
00112
00113
00114
00115 int xj_jcon_set_attrs(xj_jcon, xj_jkey, int, int);
00116 int xj_jcon_update(xj_jcon, int);
00117
00118
00119
00120 #endif
00121