Jabber WindowGram Client (JWGC)

Introduction Screenshots Installation Downloads
Documentation Browse Source Resources Project Site

Stable Version
-none-

Latest Version
beta5



Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

libjabber_types.h

Go to the documentation of this file.
00001 /*
00002  *  This program is free software; you can redistribute it and/or modify
00003  *  it under the terms of the GNU General Public License as published by
00004  *  the Free Software Foundation; either version 2 of the License, or
00005  *  (at your option) any later version.
00006  *
00007  *  This program is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  *  GNU General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00015  *
00016  *  Jabber
00017  *  Copyright (C) 1998-1999 The Jabber Team http://jabber.org/
00018  *
00019  */
00020 
00021 /* $Id: libjabber_types.h,v 1.3 2004/03/08 04:30:37 jadestorm Exp $ */
00022 
00023 #ifndef _LIBJABBER_TYPES_H_
00024 #define _LIBJABBER_TYPES_H_ 1
00025 
00026 /* --------------------------------------------------------- */
00027 /* jid.c                                                     */
00028 /* JID structures & constants                                */
00029 /* --------------------------------------------------------- */
00030 #define JID_RESOURCE 1
00031 #define JID_USER     2
00032 #define JID_SERVER   4
00033 
00034 typedef struct jid_struct { 
00035         xode_pool               p;
00036         char                    *resource;
00037         char                    *user;
00038         char                    *server;
00039         char                    *full;
00040         struct jid_struct       *next;  /* for lists of jids */
00041 } *jid;
00042   
00043 
00044 
00045 /* --------------------------------------------------------- */
00046 /* jpacket.c                                                 */
00047 /* JPacket structures & constants                            */
00048 /* --------------------------------------------------------- */
00049 #define JABPACKET_UNKNOWN       0
00050 #define JABPACKET_MESSAGE       1
00051 #define JABPACKET_PRESENCE      2
00052 #define JABPACKET_IQ            3
00053 
00054 #define JABPACKET__UNKNOWN      0
00055 #define JABPACKET__NONE         1
00056 #define JABPACKET__ERROR        2
00057 #define JABPACKET__CHAT         3
00058 #define JABPACKET__GROUPCHAT    4
00059 #define JABPACKET__GET          5
00060 #define JABPACKET__SET          6
00061 #define JABPACKET__RESULT       7
00062 #define JABPACKET__SUBSCRIBE    8
00063 #define JABPACKET__SUBSCRIBED   9
00064 #define JABPACKET__UNSUBSCRIBE  10
00065 #define JABPACKET__UNSUBSCRIBED 11
00066 #define JABPACKET__AVAILABLE    12
00067 #define JABPACKET__UNAVAILABLE  13
00068 #define JABPACKET__PROBE        14
00069 #define JABPACKET__HEADLINE     15
00070 #define JABPACKET__INVISIBLE    16
00071 #define JABPACKET__INTERNAL     17
00072 
00073 typedef struct jabpacket_struct {
00074         int                     type;
00075         int                     subtype;
00076         int                     flag;
00077         void                    *aux1;
00078         xode                    x;
00079         jid                     to;
00080         jid                     from;
00081         char                    *iqns;
00082         xode                    iq;
00083         xode_pool               p;
00084 } *jabpacket, _jabpacket;
00085  
00086 
00087 
00088 /* --------------------------------------------------------- */
00089 /* jconn.c                                                   */
00090 /* JConn structures & functions                              */
00091 /* --------------------------------------------------------- */
00092 #define JABCONN_STATE_OFF       0
00093 #define JABCONN_STATE_CONNECTED 1
00094 #define JABCONN_STATE_ON        2
00095 #define JABCONN_STATE_AUTH      3
00096 
00097 typedef struct jabconn_struct {
00098         /* Core structure */
00099         xode_pool               p;              /* Memory allocation pool */
00100         int                     state;          /* Connection state flag */
00101         int                     fd;             /* Connection file descriptor */
00102         int                     dumpfd;         /* FD to dump output to */
00103         char                    *dumpid;        /* ID to dump output of */
00104 #ifdef USE_SSL
00105         int                     sslfd;          /* SSL file descriptor */
00106         SSL                     *ssl;           /* SSL connection */
00107         SSL_CTX                 *ssl_ctx;       /* SSL context */
00108 #endif /* USE_SSL */
00109         jid                     user;           /* User info */
00110         char                    *pass;          /* User passwd */
00111         int                     port;           /* Port to connect to */
00112 
00113         /* Capability tracking */
00114         int                     auth_password;  /* Password auth supported */
00115         int                     auth_digest;    /* Digest auth supported */
00116         int                     auth_0k;        /* 0k auth supported */
00117 
00118         /* Stream stuff */
00119         int                     id;             /* Id counter */
00120         char                    idbuf[9];       /* Temporary storage */
00121         char                    *sid;           /* Stream id */
00122         int                     sequence;       /* Sequence id */
00123         char                    *token;         /* Token id */
00124         XML_Parser              parser;         /* Parser instance */
00125         xode                    current;        /* Current parsing node */
00126 
00127         /* Event callback ptrs */
00128         void (*on_state)(struct jabconn_struct *j, int state);
00129         void (*on_packet)(struct jabconn_struct *j, jabpacket p);
00130 } *jabconn, jabconn_struct;
00131 
00132 typedef void (*jabconn_state_h)(jabconn j, int state);
00133 typedef void (*jabconn_packet_h)(jabconn j, jabpacket p);
00134 
00135 
00136 
00137 /* --------------------------------------------------------- */
00138 /* jutil.c                                                   */
00139 /* JUtil functions, types, and defines                       */
00140 /* --------------------------------------------------------- */
00141 
00142 /* Error structures & constants                              */
00143 typedef struct terror_struct
00144 {
00145         int                     code;
00146         char                    msg[64];
00147 } terror;
00148 
00149 #define TERROR_BAD              (terror){400,"Bad Request"}
00150 #define TERROR_AUTH             (terror){401,"Unauthorized"}
00151 #define TERROR_PAY              (terror){402,"Payment Required"}
00152 #define TERROR_FORBIDDEN        (terror){403,"Forbidden"}
00153 #define TERROR_NOTFOUND         (terror){404,"Not Found"}
00154 #define TERROR_NOTALLOWED       (terror){405,"Not Allowed"}
00155 #define TERROR_NOTACCEPTABLE    (terror){406,"Not Acceptable"}
00156 #define TERROR_REGISTER         (terror){407,"Registration Required"}
00157 #define TERROR_REQTIMEOUT       (terror){408,"Request Timeout"}
00158 #define TERROR_CONFLICT         (terror){409,"Conflict"}
00159 #define TERROR_INTERNAL         (terror){500,"Internal Server Error"}
00160 #define TERROR_NOTIMPL          (terror){501,"Not Implemented"}
00161 #define TERROR_EXTERNAL         (terror){502,"Remote Server Error"}
00162 #define TERROR_UNAVAIL          (terror){503,"Service Unavailable"}
00163 #define TERROR_EXTTIMEOUT       (terror){504,"Remote Server Timeout"}
00164 #define TERROR_DISCONNECTED     (terror){510,"Disconnected"}
00165 
00166 /* Namespace constants                                       */
00167 #define NSCHECK(x,n) (j_strcmp(xmlnode_get_attrib(x,"xmlns"),n) == 0)
00168 
00169 #define NS_CLIENT       "jabber:client"
00170 #define NS_SERVER       "jabber:server"
00171 #define NS_AUTH         "jabber:iq:auth"
00172 #define NS_REGISTER     "jabber:iq:register"
00173 #define NS_ROSTER       "jabber:iq:roster"
00174 #define NS_OFFLINE      "jabber:x:offline"
00175 #define NS_AGENT        "jabber:iq:agent"
00176 #define NS_AGENTS       "jabber:iq:agents"
00177 #define NS_DELAY        "jabber:x:delay"
00178 #define NS_VERSION      "jabber:iq:version"
00179 #define NS_TIME         "jabber:iq:time"
00180 #define NS_VCARD        "vcard-temp"
00181 #define NS_PRIVATE      "jabber:iq:private"
00182 #define NS_SEARCH       "jabber:iq:search"
00183 #define NS_OOB          "jabber:iq:oob"
00184 #define NS_XOOB         "jabber:x:oob"
00185 #define NS_ADMIN        "jabber:iq:admin"
00186 #define NS_FILTER       "jabber:iq:filter"
00187 #define NS_AUTH_0K      "jabber:iq:auth:0k"
00188 #define NS_BROWSE       "jabber:iq:browse"
00189 #define NS_EVENT        "jabber:x:event"
00190 #define NS_CONFERENCE   "jabber:iq:conference"
00191 #define NS_SIGNED       "jabber:x:signed"
00192 #define NS_ENCRYPTED    "jabber:x:encrypted"
00193 #define NS_GATEWAY      "jabber:iq:gateway"
00194 #define NS_LAST         "jabber:iq:last"
00195 #define NS_ENVELOPE     "jabber:x:envelope"
00196 #define NS_EXPIRE       "jabber:x:expire"
00197 #define NS_XHTML        "http://www.w3.org/1999/xhtml"
00198 #define NS_XDBGINSERT   "jabber:xdb:ginsert"
00199 #define NS_XDBNSLIST    "jabber:xdb:nslist"
00200 #define NS_DATA         "jabber:x:data"
00201 
00202 /* Message Types                                             */
00203 #define TMSG_NORMAL     "normal"
00204 #define TMSG_ERROR      "error"
00205 #define TMSG_CHAT       "chat"
00206 #define TMSG_GROUPCHAT  "groupchat"
00207 #define TMSG_HEADLINE   "headline"
00208 
00209 
00210 #endif /* _LIBJABBER_TYPES_H_ */


Last updated at Tue Dec 18 21:07:42 PST 2007. This site and project hosted by...SourceForge.net Logo
Source Perspective by Fisheye