Initial commit
[siplcs.git] / src / sipe.h
blob255be852a670c38af512a3b9e8415c67049bc077
1 /**
2 * @file sip-exchange.h
4 * gaim
6 * Copyright (C) 2007, Anibal Avelar <avelar@gmail.com>
7 * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef _PIDGIN_SIPE_H
25 #define _PIDGIN_SIPE_H
27 #include <glib.h>
28 #include <time.h>
30 #include "cipher.h"
31 #include "circbuffer.h"
32 #include "dnsquery.h"
33 #include "dnssrv.h"
34 #include "network.h"
35 #include "proxy.h"
36 #include "prpl.h"
37 #include "gaim-compat.h"
39 #include "sipmsg.h"
41 #define SIMPLE_BUF_INC 1024
43 struct sip_dialog {
44 gchar *ourtag;
45 gchar *theirtag;
46 gchar *callid;
49 struct sipe_watcher {
50 gchar *name;
51 time_t expire;
52 struct sip_dialog dialog;
53 gboolean needsxpidf;
56 struct sipe_buddy {
57 gchar *name;
58 time_t resubscribe;
61 struct sip_auth {
62 int type; /* 1 = Digest / 2 = NTLM */
63 gchar *nonce;
64 gchar *opaque;
65 gchar *realm;
66 gchar *target;
67 gchar *rspauth;
68 gchar *srand;
69 guint32 flags;
70 int nc;
71 gchar *digest_session_key;
72 int retries;
75 struct sipe_account_data {
76 GaimConnection *gc;
77 gchar *servername;
78 gchar *username;
79 gchar *password;
80 GaimDnsQueryData *query_data;
81 GaimSrvQueryData *srv_query_data;
82 GaimNetworkListenData *listen_data;
83 int fd;
84 int cseq;
85 time_t reregister;
86 time_t republish;
87 int registerstatus; /* 0 nothing, 1 first registration send, 2 auth received, 3 registered */
88 struct sip_auth registrar;
89 struct sip_auth proxy;
90 int listenfd;
91 int listenport;
92 int listenpa;
93 gchar *status;
94 GHashTable *buddies;
95 guint registertimeout;
96 guint resendtimeout;
97 gboolean connecting;
98 GaimAccount *account;
99 GaimCircBuffer *txbuf;
100 guint tx_handler;
101 gchar *regcallid;
102 GSList *transactions;
103 GSList *watcher;
104 GSList *openconns;
105 gboolean udp;
106 struct sockaddr_in serveraddr;
107 int registerexpire;
108 gchar *realhostname;
109 int realport; /* port and hostname from SRV record */
112 struct sip_connection {
113 int fd;
114 gchar *inbuf;
115 int inbuflen;
116 int inbufused;
117 int inputhandler;
120 struct transaction;
122 typedef gboolean (*TransCallback) (struct sipe_account_data *, struct sipmsg *, struct transaction *);
124 struct transaction {
125 time_t time;
126 int retries;
127 int transport; /* 0 = tcp, 1 = udp */
128 int fd;
129 gchar *cseq;
130 struct sipmsg *msg;
131 TransCallback callback;
134 struct sipe_group {
135 gchar *name_group;
136 gchar *id;
137 GaimGroup *g;
140 #endif /* _PIDGIN_SIPE_H */