annotate src/protocols/simple/simple.h @ 11656:f9c5480ad0ce

[gaim-migrate @ 13940] The poster of 1253287 says FreeBSD does have a z printf modifier. Someone commented that Solaris doesn't either. I don't know either way, but we use G_GSIZE_FORMAT elsewhere, so I figured it was worth a shot. I rooted out several %z format strings and changed them. It compiles for me. I make no guarantees past that. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 13 Oct 2005 19:53:09 +0000
parents e1ab173ef3b5
children 4669e7461968
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11181
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
1 /**
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
2 * @file simple.h
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
3 *
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
4 * gaim
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
5 *
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
6 * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de>
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
7 *
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
11 * (at your option) any later version.
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
12 *
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
16 * GNU General Public License for more details.
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
17 *
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
21 */
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
22
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
23 #ifndef _GAIM_SIMPLE_H
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
24 #define _GAIM_SIMPLE_H
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
25
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
26 #include <glib.h>
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
27 #include <time.h>
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
28 #include <prpl.h>
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
29 #include <digcalc.h>
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
30 #include "sipmsg.h"
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
31
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
32 #define SIMPLE_BUF_INC 1024
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
33
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
34 struct sip_dialog {
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
35 gchar *ourtag;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
36 gchar *theirtag;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
37 gchar *callid;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
38 };
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
39
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
40 struct simple_watcher {
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
41 gchar *name;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
42 time_t expire;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
43 struct sip_dialog dialog;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
44 };
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
45
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
46 struct simple_buddy {
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
47 gchar *name;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
48 time_t resubscribe;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
49 };
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
50
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
51 struct sip_auth {
11346
e40318d2bcd8 [gaim-migrate @ 13563]
Thomas Butter <tbutter>
parents: 11194
diff changeset
52 int type; /* 1 = Digest / 2 = NTLM */
11181
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
53 gchar *nonce;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
54 gchar *realm;
11424
e1ab173ef3b5 [gaim-migrate @ 13661]
Thomas Butter <tbutter>
parents: 11409
diff changeset
55 gchar *target;
11181
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
56 int nc;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
57 HASHHEX HA1;
11346
e40318d2bcd8 [gaim-migrate @ 13563]
Thomas Butter <tbutter>
parents: 11194
diff changeset
58 int retries;
11181
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
59 };
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
60
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
61 struct simple_account_data {
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
62 GaimConnection *gc;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
63 gchar *servername;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
64 gchar *username;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
65 gchar *password;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
66 int fd;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
67 int cseq;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
68 time_t reregister;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
69 time_t republish;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
70 int registerstatus; // 0 nothing, 1 first registration send, 2 auth received, 3 registered
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
71 struct sip_auth registrar;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
72 struct sip_auth proxy;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
73 int listenfd;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
74 int listenport;
11409
1e495a5fcbbc [gaim-migrate @ 13646]
Thomas Butter <tbutter>
parents: 11383
diff changeset
75 int listenpa;
11181
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
76 gchar *ip;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
77 gchar *status;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
78 GHashTable *buddies;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
79 guint registertimeout;
11194
4c1f45ac00e9 [gaim-migrate @ 13317]
Thomas Butter <tbutter>
parents: 11189
diff changeset
80 guint resendtimeout;
11181
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
81 int connecting;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
82 GaimAccount *account;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
83 gchar *sendlater;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
84 GSList *transactions;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
85 GSList *watcher;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
86 GSList *openconns;
11189
5f79dfde334c [gaim-migrate @ 13307]
Thomas Butter <tbutter>
parents: 11181
diff changeset
87 gboolean udp;
5f79dfde334c [gaim-migrate @ 13307]
Thomas Butter <tbutter>
parents: 11181
diff changeset
88 struct sockaddr_in serveraddr;
11194
4c1f45ac00e9 [gaim-migrate @ 13317]
Thomas Butter <tbutter>
parents: 11189
diff changeset
89 int registerexpire;
11383
b4cf724b64f8 [gaim-migrate @ 13610]
Thomas Butter <tbutter>
parents: 11346
diff changeset
90 gchar *realhostname;
b4cf724b64f8 [gaim-migrate @ 13610]
Thomas Butter <tbutter>
parents: 11346
diff changeset
91 int realport; /* port and hostname from SRV record */
11181
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
92 };
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
93
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
94 struct sip_connection {
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
95 int fd;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
96 gchar *inbuf;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
97 int inbuflen;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
98 int inbufused;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
99 int inputhandler;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
100 };
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
101
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
102 struct transaction;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
103
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
104 typedef gboolean (*TransCallback) (struct simple_account_data *, struct sipmsg *, struct transaction *);
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
105
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
106 struct transaction {
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
107 time_t time;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
108 int retries;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
109 int transport; // 0 = tcp, 1 = udp
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
110 int fd;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
111 gchar *cseq;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
112 struct sipmsg *msg;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
113 TransCallback callback;
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
114 };
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
115
e5bbe5070e04 [gaim-migrate @ 13292]
Thomas Butter <tbutter>
parents:
diff changeset
116 #endif /* _GAIM_SIMPLE_H */