|
14192
|
1 /**
|
|
|
2 * @file simple.h
|
|
14267
|
3 *
|
|
14192
|
4 * gaim
|
|
|
5 *
|
|
|
6 * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de>
|
|
14267
|
7 *
|
|
14192
|
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
|
|
|
19 * along with this program; if not, write to the Free Software
|
|
|
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
21 */
|
|
|
22
|
|
|
23 #ifndef _GAIM_SIMPLE_H
|
|
|
24 #define _GAIM_SIMPLE_H
|
|
|
25
|
|
|
26 #include <glib.h>
|
|
|
27 #include <time.h>
|
|
|
28
|
|
|
29 #include "cipher.h"
|
|
|
30 #include "circbuffer.h"
|
|
14238
|
31 #include "dnsquery.h"
|
|
14267
|
32 #include "network.h"
|
|
|
33 #include "proxy.h"
|
|
14192
|
34 #include "prpl.h"
|
|
|
35
|
|
|
36 #include "sipmsg.h"
|
|
|
37
|
|
|
38 #define SIMPLE_BUF_INC 1024
|
|
|
39
|
|
|
40 struct sip_dialog {
|
|
|
41 gchar *ourtag;
|
|
|
42 gchar *theirtag;
|
|
|
43 gchar *callid;
|
|
|
44 };
|
|
|
45
|
|
|
46 struct simple_watcher {
|
|
|
47 gchar *name;
|
|
|
48 time_t expire;
|
|
|
49 struct sip_dialog dialog;
|
|
|
50 gboolean needsxpidf;
|
|
|
51 };
|
|
|
52
|
|
|
53 struct simple_buddy {
|
|
|
54 gchar *name;
|
|
|
55 time_t resubscribe;
|
|
|
56 };
|
|
|
57
|
|
|
58 struct sip_auth {
|
|
|
59 int type; /* 1 = Digest / 2 = NTLM */
|
|
|
60 gchar *nonce;
|
|
|
61 gchar *opaque;
|
|
|
62 gchar *realm;
|
|
|
63 gchar *target;
|
|
|
64 guint32 flags;
|
|
|
65 int nc;
|
|
|
66 gchar *digest_session_key;
|
|
|
67 int retries;
|
|
|
68 };
|
|
|
69
|
|
|
70 struct simple_account_data {
|
|
|
71 GaimConnection *gc;
|
|
|
72 gchar *servername;
|
|
|
73 gchar *username;
|
|
|
74 gchar *password;
|
|
14238
|
75 GaimDnsQueryData *query_data;
|
|
14267
|
76 GaimNetworkListenData *listen_data;
|
|
14192
|
77 int fd;
|
|
|
78 int cseq;
|
|
|
79 time_t reregister;
|
|
|
80 time_t republish;
|
|
|
81 int registerstatus; /* 0 nothing, 1 first registration send, 2 auth received, 3 registered */
|
|
|
82 struct sip_auth registrar;
|
|
|
83 struct sip_auth proxy;
|
|
|
84 int listenfd;
|
|
|
85 int listenport;
|
|
|
86 int listenpa;
|
|
|
87 gchar *status;
|
|
|
88 GHashTable *buddies;
|
|
|
89 guint registertimeout;
|
|
|
90 guint resendtimeout;
|
|
|
91 gboolean connecting;
|
|
|
92 GaimAccount *account;
|
|
|
93 GaimCircBuffer *txbuf;
|
|
|
94 guint tx_handler;
|
|
|
95 gchar *regcallid;
|
|
|
96 GSList *transactions;
|
|
|
97 GSList *watcher;
|
|
|
98 GSList *openconns;
|
|
|
99 gboolean udp;
|
|
|
100 struct sockaddr_in serveraddr;
|
|
|
101 int registerexpire;
|
|
|
102 gchar *realhostname;
|
|
|
103 int realport; /* port and hostname from SRV record */
|
|
|
104 };
|
|
|
105
|
|
|
106 struct sip_connection {
|
|
|
107 int fd;
|
|
|
108 gchar *inbuf;
|
|
|
109 int inbuflen;
|
|
|
110 int inbufused;
|
|
|
111 int inputhandler;
|
|
|
112 };
|
|
|
113
|
|
|
114 struct transaction;
|
|
|
115
|
|
|
116 typedef gboolean (*TransCallback) (struct simple_account_data *, struct sipmsg *, struct transaction *);
|
|
|
117
|
|
|
118 struct transaction {
|
|
|
119 time_t time;
|
|
|
120 int retries;
|
|
|
121 int transport; /* 0 = tcp, 1 = udp */
|
|
|
122 int fd;
|
|
|
123 gchar *cseq;
|
|
|
124 struct sipmsg *msg;
|
|
|
125 TransCallback callback;
|
|
|
126 };
|
|
|
127
|
|
|
128 #endif /* _GAIM_SIMPLE_H */
|