notify: store ucPC2PCAVEncryption value form server
[siplcs.git] / src / core / sipe-core-private.h
blobb85454fc52fcfd7700934f2fa1d387a9b042cd03
1 /**
2 * @file sipe-core-private.h
4 * pidgin-sipe
6 * Copyright (C) 2010-2015 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_address_data;
25 struct sip_csta;
26 struct sip_service_data;
27 struct sip_transport;
28 struct sipe_buddies;
29 struct sipe_calendar;
30 struct sipe_certificate;
31 struct sipe_ews_autodiscover;
32 struct sipe_groupchat;
33 struct sipe_groups;
34 struct sipe_http;
35 struct sipe_http_request;
36 struct sipe_media_call_private;
37 struct sipe_svc;
38 struct sipe_ucs;
39 struct sipe_webticket;
41 /**
42 * Private part of the Sipe data structure
44 * This part contains the information only needed by the core
46 struct sipe_core_private {
47 /**
48 * The public part is the first item, i.e. a pointer to the
49 * public part can also be used as a pointer to the private part.
51 struct sipe_core_public public;
53 /* sip-transport.c private data */
54 struct sip_transport *transport;
55 const struct sip_service_data *service_data; /* autodiscovery SRV records */
56 const struct sip_address_data *address_data; /* autodiscovery A records */
57 guint transport_type;
58 guint authentication_type;
60 /* Account information */
61 gchar *username;
62 gchar *authuser; /* NULL when SSO is enabled */
63 gchar *password; /* NULL when SSO is enabled */
64 gchar *email;
65 gchar *email_authuser; /* NULL -> use default authentication */
66 gchar *email_password;
68 /* SIPE protocol information */
69 gchar *contact;
70 gchar *register_callid;
71 gchar *epid;
72 gchar *focus_factory_uri;
73 GSList *sessions;
74 GSList *sessions_to_accept;
75 /* from REGISTER response: server events
76 * we're allowed to subscribe to
78 GSList *allowed_events;
80 /* Presence */
81 gchar *status;
82 gchar *note;
83 time_t note_since;
84 gboolean status_set_by_user;
86 /* [MS-SIP] deltaNum counters */
87 guint deltanum_contacts;
88 guint deltanum_acl; /* setACE (OCS2005 only) */
90 /* [MS-PRES] */
91 GSList *containers;
92 GSList *our_publication_keys;
93 GHashTable *our_publications;
94 GHashTable *user_state_publications;
96 /* Buddies */
97 struct sipe_groups *groups;
98 struct sipe_buddies *buddies;
100 /* Calendar and related stuff */
101 struct sipe_calendar *calendar;
103 /* EWS autodiscover */
104 struct sipe_ews_autodiscover *ews_autodiscover;
107 * 2005 Custom XML piece
109 * Possibly set by other point of presence or just other client at
110 * earlier time. It should be preserved/modified, not overwritten.
111 * This implies subscription to self-contact. Information kept:
113 * - User note
114 * - OOF flag
115 * - User status
117 gchar *ocs2005_user_states;
119 /* Scheduling system */
120 GSList *timeouts;
122 /* Active subscriptions */
123 GHashTable *subscriptions;
125 /* Voice call */
126 struct sipe_media_call_private *media_call;
127 gchar *test_call_bot_uri;
128 gchar *uc_line_uri;
130 * Provides the necessary information on where we can obtain
131 * credentials for the A/V Edge server service.
133 gchar *mras_uri;
134 gchar *media_relay_username;
135 gchar *media_relay_password;
136 GSList *media_relays;
137 SipeEncryptionPolicy server_av_encryption_policy;
139 /* Group chat */
140 struct sipe_groupchat *groupchat;
141 gchar *persistentChatPool_uri;
143 /* buddy menu memory allocation */
144 GSList *blist_menu_containers;
146 /* For RCC - Remote Call Control */
147 struct sip_csta *csta;
149 struct sipe_dns_query *dns_query;
151 /* HTTP service */
152 struct sipe_http *http;
154 /* TLS-DSK: Certificates & Web services */
155 struct sipe_certificate *certificate;
156 struct sipe_webticket *webticket;
157 struct sipe_svc *svc;
159 /* Unified Contact Store */
160 struct sipe_ucs *ucs;
162 /* [MS-DLX] server URI */
163 gchar *dlx_uri;
165 /* Addressbook server URI */
166 gchar *addressbook_uri;
168 /* [MS-CONFPRO] CCCP request ID counter */
169 guint cccp_request_id;
171 GSList *conf_mcu_types;
175 * Flags - stored in sipe_core_public.flags but names not exported
177 /* server is OCS2007+ */
178 #define SIPE_CORE_PRIVATE_FLAG_OCS2007 0x80000000
179 /* we are connected from outside the enterprise network boundary
180 * via Edge Server */
181 #define SIPE_CORE_PRIVATE_FLAG_REMOTE_USER 0x40000000
182 /* multiple points of presence detected */
183 #define SIPE_CORE_PRIVATE_FLAG_MPOP 0x20000000
184 /* if there is support for batched subscription*/
185 #define SIPE_CORE_PRIVATE_FLAG_BATCHED_SUPPORT 0x10000000
186 /* if note is out-of-office note */
187 #define SIPE_CORE_PRIVATE_FLAG_OOF_NOTE 0x08000000
188 /* whether we published our initial state or not */
189 #define SIPE_CORE_PRIVATE_FLAG_INITIAL_PUBLISH 0x04000000
190 /* whether basic access level is set or not */
191 #define SIPE_CORE_PRIVATE_FLAG_ACCESS_LEVEL_SET 0x02000000
192 /* whether subscribed to buddies presence or not */
193 #define SIPE_CORE_PRIVATE_FLAG_SUBSCRIBED_BUDDIES 0x01000000
194 /* user enabled Single-Sign On */
195 #define SIPE_CORE_PRIVATE_FLAG_SSO 0x00800000
196 /* server is Lync 2013+ */
197 #define SIPE_CORE_PRIVATE_FLAG_LYNC2013 0x00400000
199 #define SIPE_CORE_PUBLIC_FLAG_IS(flag) \
200 ((sipe_private->public.flags & SIPE_CORE_FLAG_ ## flag) == SIPE_CORE_FLAG_ ## flag)
201 #define SIPE_CORE_PUBLIC_FLAG_SET(flag) \
202 (sipe_private->public.flags |= SIPE_CORE_FLAG_ ## flag)
203 #define SIPE_CORE_PUBLIC_FLAG_UNSET(flag) \
204 (sipe_private->public.flags &= ~SIPE_CORE_FLAG_ ## flag)
205 #define SIPE_CORE_PRIVATE_FLAG_IS(flag) \
206 ((sipe_private->public.flags & SIPE_CORE_PRIVATE_FLAG_ ## flag) == SIPE_CORE_PRIVATE_FLAG_ ## flag)
207 #define SIPE_CORE_PRIVATE_FLAG_SET(flag) \
208 (sipe_private->public.flags |= SIPE_CORE_PRIVATE_FLAG_ ## flag)
209 #define SIPE_CORE_PRIVATE_FLAG_UNSET(flag) \
210 (sipe_private->public.flags &= ~SIPE_CORE_PRIVATE_FLAG_ ## flag)
212 /* Convenience macros */
213 #define SIPE_CORE_PRIVATE ((struct sipe_core_private *)sipe_public)
214 #define SIPE_CORE_PUBLIC ((struct sipe_core_public *)sipe_private)
217 * sipe-core internal functions
219 void sipe_core_backend_initialized(struct sipe_core_private *sipe_private,
220 guint authentication);
221 void sipe_core_connection_cleanup(struct sipe_core_private *sipe_private);
222 void sipe_core_email_authentication(struct sipe_core_private *sipe_private,
223 struct sipe_http_request *request);
226 Local Variables:
227 mode: c
228 c-file-style: "bsd"
229 indent-tabs-mode: t
230 tab-width: 8
231 End: