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
;
29 struct sipe_certificate
;
30 struct sipe_media_call_private
;
31 struct sipe_groupchat
;
34 struct sipe_webticket
;
37 * Private part of the Sipe data structure
39 * This part contains the information only needed by the core
41 struct sipe_core_private
{
43 * The public part is the first item, i.e. a pointer to the
44 * public part can also be used as a pointer to the private part.
46 struct sipe_core_public
public;
48 /* sip-transport.c private data */
49 struct sip_transport
*transport
;
50 const struct sip_service_data
*service_data
; /* autodiscovery SRV records */
51 const struct sip_address_data
*address_data
; /* autodiscovery A records */
53 guint authentication_type
;
55 /* Account information */
57 gchar
*authdomain
; /* NULL when SSO is enabled */
58 gchar
*authuser
; /* NULL when SSO is enabled */
59 gchar
*password
; /* NULL when SSO is enabled */
62 /* SIPE protocol information */
64 gchar
*register_callid
;
66 gchar
*focus_factory_uri
;
68 GSList
*sessions_to_accept
;
69 /* from REGISTER response: server events
70 * we're allowed to subscribe to
72 GSList
*allowed_events
;
79 time_t do_not_publish
[SIPE_ACTIVITY_NUM_TYPES
];
81 /* [MS-SIP] deltaNum counters */
82 guint deltanum_contacts
;
83 guint deltanum_acl
; /* setACE (OCS2005 only) */
87 GSList
*our_publication_keys
;
88 GHashTable
*our_publications
;
89 GHashTable
*user_state_publications
;
95 /* Calendar and related stuff */
96 struct sipe_calendar
*calendar
;
99 * 2005 Custom XML piece
101 * Possibly set by other point of presence or just other client at
102 * earlier time. It should be preserved/modified, not overwritten.
103 * This implies subscription to self-contact. Information kept:
109 gchar
*ocs2005_user_states
;
111 /* Scheduling system */
114 /* Active subscriptions */
115 GHashTable
*subscriptions
;
118 struct sipe_media_call_private
*media_call
;
119 gchar
*test_call_bot_uri
;
121 * Provides the necessary information on where we can obtain
122 * credentials for the A/V Edge server service.
125 gchar
*media_relay_username
;
126 gchar
*media_relay_password
;
127 GSList
*media_relays
;
130 struct sipe_groupchat
*groupchat
;
132 /* buddy menu memory allocation */
133 GSList
*blist_menu_containers
;
135 /* For RCC - Remote Call Control */
136 struct sip_csta
*csta
;
138 struct sipe_dns_query
*dns_query
;
141 struct sipe_http
*http
;
143 /* TLS-DSK: Certificates & Web services */
144 struct sipe_certificate
*certificate
;
145 struct sipe_webticket
*webticket
;
146 struct sipe_svc
*svc
;
148 /* [MS-DLX] server URI */
151 /* Addressbook server URI */
152 gchar
*addressbook_uri
;
154 /* Pending photo download HTTP requests */
155 GSList
*pending_photo_requests
;
159 * Flags - stored in sipe_core_public.flags but names not exported
161 /* server is OCS2007+ */
162 #define SIPE_CORE_PRIVATE_FLAG_OCS2007 0x80000000
163 /* we are connected from outside the enterprise network boundary
165 #define SIPE_CORE_PRIVATE_FLAG_REMOTE_USER 0x40000000
166 /* multiple points of presence detected */
167 #define SIPE_CORE_PRIVATE_FLAG_MPOP 0x20000000
168 /* if there is support for batched subscription*/
169 #define SIPE_CORE_PRIVATE_FLAG_BATCHED_SUPPORT 0x10000000
170 /* if note is out-of-office note */
171 #define SIPE_CORE_PRIVATE_FLAG_OOF_NOTE 0x08000000
172 /* whether we published our initial state or not */
173 #define SIPE_CORE_PRIVATE_FLAG_INITIAL_PUBLISH 0x04000000
174 /* whether basic access level is set or not */
175 #define SIPE_CORE_PRIVATE_FLAG_ACCESS_LEVEL_SET 0x02000000
176 /* whether subscribed to buddies presence or not */
177 #define SIPE_CORE_PRIVATE_FLAG_SUBSCRIBED_BUDDIES 0x01000000
178 /* user enabled Single-Sign On */
179 #define SIPE_CORE_PRIVATE_FLAG_SSO 0x00800000
181 #define SIPE_CORE_PUBLIC_FLAG_IS(flag) \
182 ((sipe_private->public.flags & SIPE_CORE_FLAG_ ## flag) == SIPE_CORE_FLAG_ ## flag)
183 #define SIPE_CORE_PUBLIC_FLAG_SET(flag) \
184 (sipe_private->public.flags |= SIPE_CORE_FLAG_ ## flag)
185 #define SIPE_CORE_PUBLIC_FLAG_UNSET(flag) \
186 (sipe_private->public.flags &= ~SIPE_CORE_FLAG_ ## flag)
187 #define SIPE_CORE_PRIVATE_FLAG_IS(flag) \
188 ((sipe_private->public.flags & SIPE_CORE_PRIVATE_FLAG_ ## flag) == SIPE_CORE_PRIVATE_FLAG_ ## flag)
189 #define SIPE_CORE_PRIVATE_FLAG_SET(flag) \
190 (sipe_private->public.flags |= SIPE_CORE_PRIVATE_FLAG_ ## flag)
191 #define SIPE_CORE_PRIVATE_FLAG_UNSET(flag) \
192 (sipe_private->public.flags &= ~SIPE_CORE_PRIVATE_FLAG_ ## flag)
194 /* Convenience macros */
195 #define SIPE_CORE_PRIVATE ((struct sipe_core_private *)sipe_public)
196 #define SIPE_CORE_PUBLIC ((struct sipe_core_public *)sipe_private)
199 * sipe-core internal functions
201 void sipe_core_connection_cleanup(struct sipe_core_private
*sipe_private
);