core: move SIP transport auth type to public API
[siplcs.git] / src / core / sipe-core-private.h
blobf3e6b177b07480e32e70ca76661b5fdbd40e6f48
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;
50 guint authentication_type;
52 /* Account information */
53 gchar *username;
54 gchar *authdomain;
55 gchar *authuser;
56 gchar *password;
57 gchar *email;
59 /* SIPE protocol information */
60 gchar *contact;
61 gchar *register_callid;
62 gchar *epid;
63 gchar *focus_factory_uri;
64 GSList *sessions;
65 GSList *sessions_to_accept;
66 /* from REGISTER response: server events
67 * we're allowed to subscribe to
69 GSList *allowed_events;
71 /* Presence */
72 gchar *status;
73 gchar *note;
74 time_t note_since;
75 time_t idle_switch;
76 time_t do_not_publish[SIPE_ACTIVITY_NUM_TYPES];
78 /* [MS-SIP] deltaNum counters */
79 guint deltanum_contacts;
80 guint deltanum_acl; /* setACE (OCS2005 only) */
82 /* [MS-PRES] */
83 GSList *containers;
84 GSList *our_publication_keys;
85 GHashTable *our_publications;
86 GHashTable *user_state_publications;
88 /* Buddies */
89 GSList *groups;
90 GHashTable *buddies;
92 /* Calendar and related stuff */
93 struct sipe_calendar *calendar;
96 * 2005 Custom XML piece
98 * Possibly set by other point of presence or just other client at
99 * earlier time. It should be preserved/modified, not overwritten.
100 * This implies subscription to self-contact. Information kept:
102 * - User note
103 * - OOF flag
104 * - User status
106 gchar *ocs2005_user_states;
108 /* Scheduling system */
109 GSList *timeouts;
111 /* Active subscriptions */
112 GHashTable *subscriptions;
114 /* Voice call */
115 struct sipe_media_call_private *media_call;
116 gchar *test_call_bot_uri;
118 * Provides the necessary information on where we can obtain
119 * credentials for the A/V Edge server service.
121 gchar *mras_uri;
122 gchar *media_relay_username;
123 gchar *media_relay_password;
124 GSList *media_relays;
126 /* Group chat */
127 struct sipe_groupchat *groupchat;
129 /* buddy menu memory allocation */
130 GSList *blist_menu_containers;
132 /* For RCC - Remote Call Control */
133 struct sip_csta *csta;
135 struct sipe_dns_query *dns_query;
137 /* TLS-DSK: Certificates & Web services */
138 struct sipe_certificate *certificate;
139 struct sipe_webticket *webticket;
140 struct sipe_svc *svc;
142 /* [MS-DLX] server URI */
143 gchar *dlx_uri;
145 /* Addressbook server URI */
146 gchar *addressbook_uri;
148 /* Pending photo download HTTP requests */
149 GSList *pending_photo_requests;
153 * Flags - stored in sipe_core_public.flags but names not exported
155 /* server is OCS2007+ */
156 #define SIPE_CORE_PRIVATE_FLAG_OCS2007 0x80000000
157 /* we are connected from outside the enterprise network boundary
158 * via Edge Server */
159 #define SIPE_CORE_PRIVATE_FLAG_REMOTE_USER 0x40000000
160 /* multiple points of presence detected */
161 #define SIPE_CORE_PRIVATE_FLAG_MPOP 0x20000000
162 /* if there is support for batched subscription*/
163 #define SIPE_CORE_PRIVATE_FLAG_BATCHED_SUPPORT 0x10000000
164 /* if note is out-of-office note */
165 #define SIPE_CORE_PRIVATE_FLAG_OOF_NOTE 0x08000000
166 /* whether we published our initial state or not */
167 #define SIPE_CORE_PRIVATE_FLAG_INITIAL_PUBLISH 0x04000000
168 /* whether basic access level is set or not */
169 #define SIPE_CORE_PRIVATE_FLAG_ACCESS_LEVEL_SET 0x02000000
170 /* whether subscribed to buddies presence or not */
171 #define SIPE_CORE_PRIVATE_FLAG_SUBSCRIBED_BUDDIES 0x01000000
173 #define SIPE_CORE_PUBLIC_FLAG_IS(flag) \
174 ((sipe_private->public.flags & SIPE_CORE_FLAG_ ## flag) == SIPE_CORE_FLAG_ ## flag)
175 #define SIPE_CORE_PUBLIC_FLAG_SET(flag) \
176 (sipe_private->public.flags |= SIPE_CORE_FLAG_ ## flag)
177 #define SIPE_CORE_PUBLIC_FLAG_UNSET(flag) \
178 (sipe_private->public.flags &= ~SIPE_CORE_FLAG_ ## flag)
179 #define SIPE_CORE_PRIVATE_FLAG_IS(flag) \
180 ((sipe_private->public.flags & SIPE_CORE_PRIVATE_FLAG_ ## flag) == SIPE_CORE_PRIVATE_FLAG_ ## flag)
181 #define SIPE_CORE_PRIVATE_FLAG_SET(flag) \
182 (sipe_private->public.flags |= SIPE_CORE_PRIVATE_FLAG_ ## flag)
183 #define SIPE_CORE_PRIVATE_FLAG_UNSET(flag) \
184 (sipe_private->public.flags &= ~SIPE_CORE_PRIVATE_FLAG_ ## flag)
186 /* Convenience macros */
187 #define SIPE_CORE_PRIVATE ((struct sipe_core_private *)sipe_public)
188 #define SIPE_CORE_PUBLIC ((struct sipe_core_public *)sipe_private)
191 * sipe-core internal functions
193 void sipe_core_connection_cleanup(struct sipe_core_private *sipe_private);
196 Local Variables:
197 mode: c
198 c-file-style: "bsd"
199 indent-tabs-mode: t
200 tab-width: 8
201 End: