2 * @file sipe-core-private.h
6 * Copyright (C) 2010-2013 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
;
26 struct sip_service_data
;
30 struct sipe_certificate
;
31 struct sipe_ews_autodiscover
;
32 struct sipe_groupchat
;
35 struct sipe_http_request
;
36 struct sipe_media_call_private
;
39 struct sipe_webticket
;
42 * Private part of the Sipe data structure
44 * This part contains the information only needed by the core
46 struct sipe_core_private
{
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 */
58 guint authentication_type
;
60 /* Account information */
62 gchar
*authdomain
; /* NULL when SSO is enabled */
63 gchar
*authuser
; /* NULL when SSO is enabled */
64 gchar
*password
; /* NULL when SSO is enabled */
66 gchar
*email_authdomain
;
67 gchar
*email_authuser
; /* NULL -> use default authentication */
68 gchar
*email_password
;
70 /* SIPE protocol information */
72 gchar
*register_callid
;
74 gchar
*focus_factory_uri
;
76 GSList
*sessions_to_accept
;
77 /* from REGISTER response: server events
78 * we're allowed to subscribe to
80 GSList
*allowed_events
;
87 time_t do_not_publish
[SIPE_ACTIVITY_NUM_TYPES
];
89 /* [MS-SIP] deltaNum counters */
90 guint deltanum_contacts
;
91 guint deltanum_acl
; /* setACE (OCS2005 only) */
95 GSList
*our_publication_keys
;
96 GHashTable
*our_publications
;
97 GHashTable
*user_state_publications
;
100 struct sipe_groups
*groups
;
101 struct sipe_buddies
*buddies
;
103 /* Calendar and related stuff */
104 struct sipe_calendar
*calendar
;
106 /* EWS autodiscover */
107 struct sipe_ews_autodiscover
*ews_autodiscover
;
110 * 2005 Custom XML piece
112 * Possibly set by other point of presence or just other client at
113 * earlier time. It should be preserved/modified, not overwritten.
114 * This implies subscription to self-contact. Information kept:
120 gchar
*ocs2005_user_states
;
122 /* Scheduling system */
125 /* Active subscriptions */
126 GHashTable
*subscriptions
;
129 struct sipe_media_call_private
*media_call
;
130 gchar
*test_call_bot_uri
;
133 * Provides the necessary information on where we can obtain
134 * credentials for the A/V Edge server service.
137 gchar
*media_relay_username
;
138 gchar
*media_relay_password
;
139 GSList
*media_relays
;
142 struct sipe_groupchat
*groupchat
;
143 gchar
*persistentChatPool_uri
;
145 /* buddy menu memory allocation */
146 GSList
*blist_menu_containers
;
148 /* For RCC - Remote Call Control */
149 struct sip_csta
*csta
;
151 struct sipe_dns_query
*dns_query
;
154 struct sipe_http
*http
;
156 /* TLS-DSK: Certificates & Web services */
157 struct sipe_certificate
*certificate
;
158 struct sipe_webticket
*webticket
;
159 struct sipe_svc
*svc
;
161 /* Unified Contact Store */
162 struct sipe_ucs
*ucs
;
164 /* [MS-DLX] server URI */
167 /* Addressbook server URI */
168 gchar
*addressbook_uri
;
172 * Flags - stored in sipe_core_public.flags but names not exported
174 /* server is OCS2007+ */
175 #define SIPE_CORE_PRIVATE_FLAG_OCS2007 0x80000000
176 /* we are connected from outside the enterprise network boundary
178 #define SIPE_CORE_PRIVATE_FLAG_REMOTE_USER 0x40000000
179 /* multiple points of presence detected */
180 #define SIPE_CORE_PRIVATE_FLAG_MPOP 0x20000000
181 /* if there is support for batched subscription*/
182 #define SIPE_CORE_PRIVATE_FLAG_BATCHED_SUPPORT 0x10000000
183 /* if note is out-of-office note */
184 #define SIPE_CORE_PRIVATE_FLAG_OOF_NOTE 0x08000000
185 /* whether we published our initial state or not */
186 #define SIPE_CORE_PRIVATE_FLAG_INITIAL_PUBLISH 0x04000000
187 /* whether basic access level is set or not */
188 #define SIPE_CORE_PRIVATE_FLAG_ACCESS_LEVEL_SET 0x02000000
189 /* whether subscribed to buddies presence or not */
190 #define SIPE_CORE_PRIVATE_FLAG_SUBSCRIBED_BUDDIES 0x01000000
191 /* user enabled Single-Sign On */
192 #define SIPE_CORE_PRIVATE_FLAG_SSO 0x00800000
193 /* server is Lync 2013+ */
194 #define SIPE_CORE_PRIVATE_FLAG_LYNC2013 0x00400000
196 #define SIPE_CORE_PUBLIC_FLAG_IS(flag) \
197 ((sipe_private->public.flags & SIPE_CORE_FLAG_ ## flag) == SIPE_CORE_FLAG_ ## flag)
198 #define SIPE_CORE_PUBLIC_FLAG_SET(flag) \
199 (sipe_private->public.flags |= SIPE_CORE_FLAG_ ## flag)
200 #define SIPE_CORE_PUBLIC_FLAG_UNSET(flag) \
201 (sipe_private->public.flags &= ~SIPE_CORE_FLAG_ ## flag)
202 #define SIPE_CORE_PRIVATE_FLAG_IS(flag) \
203 ((sipe_private->public.flags & SIPE_CORE_PRIVATE_FLAG_ ## flag) == SIPE_CORE_PRIVATE_FLAG_ ## flag)
204 #define SIPE_CORE_PRIVATE_FLAG_SET(flag) \
205 (sipe_private->public.flags |= SIPE_CORE_PRIVATE_FLAG_ ## flag)
206 #define SIPE_CORE_PRIVATE_FLAG_UNSET(flag) \
207 (sipe_private->public.flags &= ~SIPE_CORE_PRIVATE_FLAG_ ## flag)
209 /* Convenience macros */
210 #define SIPE_CORE_PRIVATE ((struct sipe_core_private *)sipe_public)
211 #define SIPE_CORE_PUBLIC ((struct sipe_core_public *)sipe_private)
214 * sipe-core internal functions
216 void sipe_core_backend_initialized(struct sipe_core_private
*sipe_private
,
217 guint authentication
);
218 void sipe_core_connection_cleanup(struct sipe_core_private
*sipe_private
);
219 void sipe_core_email_authentication(struct sipe_core_private
*sipe_private
,
220 struct sipe_http_request
*request
);