11181
|
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 #include <prpl.h>
|
|
29 #include <digcalc.h>
|
|
30 #include "sipmsg.h"
|
|
31
|
|
32 #define SIMPLE_BUF_INC 1024
|
|
33
|
|
34 struct sip_dialog {
|
|
35 gchar *ourtag;
|
|
36 gchar *theirtag;
|
|
37 gchar *callid;
|
|
38 };
|
|
39
|
|
40 struct simple_watcher {
|
|
41 gchar *name;
|
|
42 time_t expire;
|
|
43 struct sip_dialog dialog;
|
|
44 };
|
|
45
|
|
46 struct simple_buddy {
|
|
47 gchar *name;
|
|
48 time_t resubscribe;
|
|
49 };
|
|
50
|
|
51 struct sip_auth {
|
11346
|
52 int type; /* 1 = Digest / 2 = NTLM */
|
11181
|
53 gchar *nonce;
|
|
54 gchar *realm;
|
|
55 int nc;
|
|
56 HASHHEX HA1;
|
11346
|
57 int retries;
|
11181
|
58 };
|
|
59
|
|
60 struct simple_account_data {
|
|
61 GaimConnection *gc;
|
|
62 gchar *servername;
|
|
63 gchar *username;
|
|
64 gchar *password;
|
|
65 int fd;
|
|
66 int cseq;
|
|
67 time_t reregister;
|
|
68 time_t republish;
|
|
69 int registerstatus; // 0 nothing, 1 first registration send, 2 auth received, 3 registered
|
|
70 struct sip_auth registrar;
|
|
71 struct sip_auth proxy;
|
|
72 int listenfd;
|
|
73 int listenport;
|
|
74 gchar *ip;
|
|
75 gchar *status;
|
|
76 GHashTable *buddies;
|
|
77 guint registertimeout;
|
11194
|
78 guint resendtimeout;
|
11181
|
79 int connecting;
|
|
80 GaimAccount *account;
|
|
81 gchar *sendlater;
|
|
82 GSList *transactions;
|
|
83 GSList *watcher;
|
|
84 GSList *openconns;
|
11189
|
85 gboolean udp;
|
|
86 struct sockaddr_in serveraddr;
|
11194
|
87 int registerexpire;
|
11181
|
88 };
|
|
89
|
|
90 struct sip_connection {
|
|
91 int fd;
|
|
92 gchar *inbuf;
|
|
93 int inbuflen;
|
|
94 int inbufused;
|
|
95 int inputhandler;
|
|
96 };
|
|
97
|
|
98 struct transaction;
|
|
99
|
|
100 typedef gboolean (*TransCallback) (struct simple_account_data *, struct sipmsg *, struct transaction *);
|
|
101
|
|
102 struct transaction {
|
|
103 time_t time;
|
|
104 int retries;
|
|
105 int transport; // 0 = tcp, 1 = udp
|
|
106 int fd;
|
|
107 gchar *cseq;
|
|
108 struct sipmsg *msg;
|
|
109 TransCallback callback;
|
|
110 };
|
|
111
|
|
112 #endif /* _GAIM_SIMPLE_H */
|