[f06894d] | 1 | /***************************************************************************\ |
---|
| 2 | * * |
---|
| 3 | * BitlBee - An IRC to IM gateway * |
---|
| 4 | * Jabber module - Main file * |
---|
| 5 | * * |
---|
| 6 | * Copyright 2006 Wilmer van der Gaast <wilmer@gaast.net> * |
---|
| 7 | * * |
---|
| 8 | * This program is free software; you can redistribute it and/or modify * |
---|
| 9 | * it under the terms of the GNU General Public License as published by * |
---|
| 10 | * the Free Software Foundation; either version 2 of the License, or * |
---|
| 11 | * (at your option) any later version. * |
---|
| 12 | * * |
---|
| 13 | * This program is distributed in the hope that it will be useful, * |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
---|
| 16 | * GNU General Public License for more details. * |
---|
| 17 | * * |
---|
| 18 | * You should have received a copy of the GNU General Public License along * |
---|
| 19 | * with this program; if not, write to the Free Software Foundation, Inc., * |
---|
| 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * |
---|
| 21 | * * |
---|
| 22 | \***************************************************************************/ |
---|
| 23 | |
---|
| 24 | #ifndef _JABBER_H |
---|
| 25 | #define _JABBER_H |
---|
| 26 | |
---|
| 27 | #include <glib.h> |
---|
| 28 | |
---|
| 29 | #include "xmltree.h" |
---|
| 30 | #include "bitlbee.h" |
---|
| 31 | |
---|
[21167d2] | 32 | typedef enum |
---|
| 33 | { |
---|
[5997488] | 34 | JFLAG_STREAM_STARTED = 1, /* Set when we detected the beginning of the stream and want to do auth. */ |
---|
| 35 | JFLAG_AUTHENTICATED = 2, /* Set when we're successfully authenticatd. */ |
---|
| 36 | JFLAG_STREAM_RESTART = 4, /* Set when we want to restart the stream (after SASL or TLS). */ |
---|
[21167d2] | 37 | } jabber_flags_t; |
---|
| 38 | |
---|
| 39 | /* iq.c */ |
---|
[f06894d] | 40 | xt_status jabber_pkt_iq( struct xt_node *node, gpointer data ); |
---|
[8d74291] | 41 | int jabber_start_iq_auth( struct gaim_connection *gc ); |
---|
[70f6aab8] | 42 | int jabber_get_roster( struct gaim_connection *gc ); |
---|
[21167d2] | 43 | |
---|
[f06894d] | 44 | xt_status jabber_pkt_message( struct xt_node *node, gpointer data ); |
---|
[0b4a0db] | 45 | |
---|
| 46 | /* presence.c */ |
---|
[f06894d] | 47 | xt_status jabber_pkt_presence( struct xt_node *node, gpointer data ); |
---|
[0b4a0db] | 48 | int presence_announce( struct gaim_connection *gc ); |
---|
[deff040] | 49 | int presence_send( struct gaim_connection *gc, char *to, char *show, char *status ); |
---|
[f06894d] | 50 | |
---|
[21167d2] | 51 | /* jabber_util.c */ |
---|
[f06894d] | 52 | char *set_eval_resprio( set_t *set, char *value ); |
---|
| 53 | char *set_eval_tls( set_t *set, char *value ); |
---|
[21167d2] | 54 | struct xt_node *jabber_make_packet( char *name, char *type, char *to, struct xt_node *children ); |
---|
| 55 | |
---|
| 56 | /* io.c */ |
---|
| 57 | int jabber_write_packet( struct gaim_connection *gc, struct xt_node *node ); |
---|
| 58 | int jabber_write( struct gaim_connection *gc, char *buf, int len ); |
---|
| 59 | gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond ); |
---|
[4a0614e] | 60 | gboolean jabber_start_stream( struct gaim_connection *gc ); |
---|
[5bcf70a] | 61 | void jabber_end_stream( struct gaim_connection *gc ); |
---|
[21167d2] | 62 | |
---|
[5997488] | 63 | /* sasl.c */ |
---|
| 64 | xt_status sasl_pkt_mechanisms( struct xt_node *node, gpointer data ); |
---|
| 65 | xt_status sasl_pkt_challenge( struct xt_node *node, gpointer data ); |
---|
| 66 | xt_status sasl_pkt_result( struct xt_node *node, gpointer data ); |
---|
[8d74291] | 67 | gboolean sasl_supported( struct gaim_connection *gc ); |
---|
[5997488] | 68 | |
---|
[21167d2] | 69 | struct jabber_data |
---|
| 70 | { |
---|
| 71 | struct gaim_connection *gc; |
---|
| 72 | |
---|
| 73 | int fd; |
---|
| 74 | void *ssl; |
---|
| 75 | char *txq; |
---|
| 76 | int tx_len; |
---|
| 77 | int r_inpa, w_inpa; |
---|
| 78 | |
---|
| 79 | struct xt_parser *xt; |
---|
| 80 | jabber_flags_t flags; |
---|
| 81 | |
---|
| 82 | char *username; /* USERNAME@server */ |
---|
| 83 | char *server; /* username@SERVER -=> server/domain, not hostname */ |
---|
| 84 | }; |
---|
[f06894d] | 85 | |
---|
| 86 | #endif |
---|