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