webticket: implement caching
[siplcs.git] / src / core / sipe-core-private.h
bloba9105b1f6bb5bca1d88bfc489a5fa3084a1fb9df
1 /**
2 * @file sipe-core-private.h
4 * pidgin-sipe
6 * Copyright (C) 2010-12 SIPE Project <http://sipe.sourceforge.net/>
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.
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.
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
23 /* Forward declarations */
24 struct sip_csta;
25 struct sip_service_data;
26 struct sip_transport;
27 struct sipe_calendar;
28 struct sipe_certificate;
29 struct sipe_media_call_private;
30 struct sipe_groupchat;
31 struct sipe_svc;
32 struct sipe_webticket;
34 /**
35 * Private part of the Sipe data structure
37 * This part contains the information only needed by the core
39 struct sipe_core_private {
40 /**
41 * The public part is the first item, i.e. a pointer to the
42 * public part can also be used as a pointer to the private part.
44 struct sipe_core_public public;
46 /* sip-transport.c private data */
47 struct sip_transport *transport;
48 const struct sip_service_data *service_data;
49 guint transport_type;
51 /* Account information */
52 gchar *username;
53 gchar *authdomain;
54 gchar *authuser;
55 gchar *password;
56 gchar *email;
58 /* SIPE protocol information */
59 gchar *contact;
60 gchar *register_callid;
61 gchar *epid;
62 gchar *focus_factory_uri;
63 GSList *sessions;
64 GSList *sessions_to_accept;
65 /* from REGISTER response: server events
66 * we're allowed to subscribe to
68 GSList *allowed_events;
70 /* Presence */
71 gchar *status;
72 gchar *note;
73 time_t note_since;
74 time_t idle_switch;
75 time_t do_not_publish[SIPE_ACTIVITY_NUM_TYPES];
77 /* [MS-SIP] deltaNum counters */
78 guint deltanum_contacts;
79 guint deltanum_acl; /* setACE (OCS2005 only) */
81 /* [MS-PRES] */
82 GSList *containers;
83 GSList *our_publication_keys;
84 GHashTable *our_publications;
85 GHashTable *user_state_publications;
87 /* Buddies */
88 GSList *groups;
89 GHashTable *buddies;
91 /* Calendar and related stuff */
92 struct sipe_calendar *calendar;
95 * 2005 Custom XML piece
97 * Possibly set by other point of presence or just other client at
98 * earlier time. It should be preserved/modified, not overwritten.
99 * This implies subscription to self-contact. Information kept:
101 * - User note
102 * - OOF flag
103 * - User status
105 gchar *ocs2005_user_states;
107 /* Scheduling system */
108 GSList *timeouts;
110 /* Active subscriptions */
111 GHashTable *subscriptions;
113 /* Voice call */
114 struct sipe_media_call_private *media_call;
115 gchar *test_call_bot_uri;
117 * Provides the necessary information on where we can obtain
118 * credentials for the A/V Edge server service.
120 gchar *mras_uri;
121 gchar *media_relay_username;
122 gchar *media_relay_password;
123 GSList *media_relays;
125 /* Group chat */
126 struct sipe_groupchat *groupchat;
128 /* buddy menu memory allocation */
129 GSList *blist_menu_containers;
131 /* For RCC - Remote Call Control */
132 struct sip_csta *csta;
134 struct sipe_dns_query *dns_query;
136 /* TLS-DSK: Certificates & Web services */
137 struct sipe_certificate *certificate;
138 struct sipe_webticket *webticket;
139 struct sipe_svc *svc;
141 /* [MS-DLX] server URI */
142 gchar *dlx_uri;
144 /* Addressbook server URI */
145 gchar *addressbook_uri;
147 /* Pending photo download HTTP requests */
148 GSList *pending_photo_requests;
152 * Flags - stored in sipe_core_public.flags but names not exported
154 /* server is OCS2007+ */
155 #define SIPE_CORE_PRIVATE_FLAG_OCS2007 0x80000000
156 /* we are connected from outside the enterprise network boundary
157 * via Edge Server */
158 #define SIPE_CORE_PRIVATE_FLAG_REMOTE_USER 0x40000000
159 /* multiple points of presence detected */
160 #define SIPE_CORE_PRIVATE_FLAG_MPOP 0x20000000
161 /* if there is support for batched subscription*/
162 #define SIPE_CORE_PRIVATE_FLAG_BATCHED_SUPPORT 0x10000000
163 /* if note is out-of-office note */
164 #define SIPE_CORE_PRIVATE_FLAG_OOF_NOTE 0x08000000
165 /* whether we published our initial state or not */
166 #define SIPE_CORE_PRIVATE_FLAG_INITIAL_PUBLISH 0x04000000
167 /* whether basic access level is set or not */
168 #define SIPE_CORE_PRIVATE_FLAG_ACCESS_LEVEL_SET 0x02000000
169 /* whether subscribed to buddies presence or not */
170 #define SIPE_CORE_PRIVATE_FLAG_SUBSCRIBED_BUDDIES 0x01000000
172 #define SIPE_CORE_PUBLIC_FLAG_IS(flag) \
173 ((sipe_private->public.flags & SIPE_CORE_FLAG_ ## flag) == SIPE_CORE_FLAG_ ## flag)
174 #define SIPE_CORE_PUBLIC_FLAG_SET(flag) \
175 (sipe_private->public.flags |= SIPE_CORE_FLAG_ ## flag)
176 #define SIPE_CORE_PUBLIC_FLAG_UNSET(flag) \
177 (sipe_private->public.flags &= ~SIPE_CORE_FLAG_ ## flag)
178 #define SIPE_CORE_PRIVATE_FLAG_IS(flag) \
179 ((sipe_private->public.flags & SIPE_CORE_PRIVATE_FLAG_ ## flag) == SIPE_CORE_PRIVATE_FLAG_ ## flag)
180 #define SIPE_CORE_PRIVATE_FLAG_SET(flag) \
181 (sipe_private->public.flags |= SIPE_CORE_PRIVATE_FLAG_ ## flag)
182 #define SIPE_CORE_PRIVATE_FLAG_UNSET(flag) \
183 (sipe_private->public.flags &= ~SIPE_CORE_PRIVATE_FLAG_ ## flag)
185 /* Convenience macros */
186 #define SIPE_CORE_PRIVATE ((struct sipe_core_private *)sipe_public)
187 #define SIPE_CORE_PUBLIC ((struct sipe_core_public *)sipe_private)
190 * sipe-core internal functions
192 void sipe_core_connection_cleanup(struct sipe_core_private *sipe_private);
195 Local Variables:
196 mode: c
197 c-file-style: "bsd"
198 indent-tabs-mode: t
199 tab-width: 8
200 End: