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