media: fix relay-info with Farstream 0.2
[siplcs.git] / src / core / sipe-svc.h
blob6a0933772e65ef213f81abd25404f4094fff565a
1 /**
2 * @file sipe-svc.h
4 * pidgin-sipe
6 * Copyright (C) 2011-12 SIPE Project <http://sipe.sourceforge.net/>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * Interface dependencies:
27 * <glib.h>
30 /* Forward declarations */
31 struct sipe_core_private;
32 struct sipe_svc_session;
33 struct sipe_tls_random;
34 struct _sipe_xml;
36 /**
37 * Service XML callback
39 * @param sipe_private SIPE core private data
40 * @param uri service URI (NULL when request aborted)
41 * @param raw raw XML data (NULL when request failed)
42 * @param xml parsed XML data (NULL when request failed)
43 * @param callback_data callback data
45 typedef void (sipe_svc_callback)(struct sipe_core_private *sipe_private,
46 const gchar *uri,
47 const gchar *raw,
48 struct _sipe_xml *xml,
49 gpointer callback_data);
51 /**
52 * Start a session of related service requests
54 * @return Opaque session pointer
56 struct sipe_svc_session *sipe_svc_session_start(void);
58 /**
59 * Close a session of related service requests
61 * @param session Opaque session pointer
63 void sipe_svc_session_close(struct sipe_svc_session *session);
65 /**
66 * Trigger fetch of Get & Publish certificate
68 * @param sipe_private SIPE core private data
69 * @param session opaque session pointer
70 * @param uri service URI
71 * @param wsse_security predefined authentication token
72 * @param certreq certificate request (Base64 encoded)
73 * @param callback callback function
74 * @param callback_data callback data
75 * @return @c TRUE if certificate fetch was triggered
77 gboolean sipe_svc_get_and_publish_cert(struct sipe_core_private *sipe_private,
78 struct sipe_svc_session *session,
79 const gchar *uri,
80 const gchar *wsse_security,
81 const gchar *certreq,
82 sipe_svc_callback *callback,
83 gpointer callback_data);
85 /**
86 * Trigger [MS-DLX] address book entry search
88 * @param sipe_private SIPE core private data
89 * @param session opaque session pointer
90 * @param uri service URI
91 * @param wsse_security predefined authentication token
92 * @param search [MS-DLX] AbEntryRequest.ChangeSearchQuery in XML
93 * @param entries array entries in search XML string
94 * @param max_returns how many entries to return
95 * @param callback callback function
96 * @param callback_data callback data
97 * @return @c TRUE if search was triggered
99 gboolean sipe_svc_ab_entry_request(struct sipe_core_private *sipe_private,
100 struct sipe_svc_session *session,
101 const gchar *uri,
102 const gchar *wsse_security,
103 const gchar *search,
104 guint entries,
105 guint max_returns,
106 sipe_svc_callback *callback,
107 gpointer callback_data);
110 * Trigger fetch of WebTicket security token
112 * @param sipe_private SIPE core private data
113 * @param session opaque session pointer
114 * @param uri service URI
115 * @param wsse_security predefined authentication token. May be @c NULL
116 * @param service_uri request token for this service URI
117 * @param entropy random bytes buffer for entropy
118 * @param callback callback function
119 * @param callback_data callback data
120 * @return @c TRUE if token fetch was triggered
122 gboolean sipe_svc_webticket(struct sipe_core_private *sipe_private,
123 struct sipe_svc_session *session,
124 const gchar *uri,
125 const gchar *wsse_security,
126 const gchar *service_uri,
127 const struct sipe_tls_random *entropy,
128 sipe_svc_callback *callback,
129 gpointer callback_data);
132 * Trigger fetch of WebTicket security token from ADFS of a federated domain
134 * @param sipe_private SIPE core private data
135 * @param session opaque session pointer
136 * @param adfs_uri ADFS authentication URI
137 * @param callback callback function
138 * @param callback_data callback data
139 * @return @c TRUE if token fetch was triggered
141 gboolean sipe_svc_webticket_adfs(struct sipe_core_private *sipe_private,
142 struct sipe_svc_session *session,
143 const gchar *adfs_uri,
144 sipe_svc_callback *callback,
145 gpointer callback_data);
148 * Trigger fetch of WebTicket security token from login.microsoftonline.com
150 * @param sipe_private SIPE core private data
151 * @param session opaque session pointer
152 * @param service_uri request token for this service URI
153 * @param callback callback function
154 * @param callback_data callback data
155 * @return @c TRUE if token fetch was triggered
157 gboolean sipe_svc_webticket_lmc(struct sipe_core_private *sipe_private,
158 struct sipe_svc_session *session,
159 const gchar *service_uri,
160 sipe_svc_callback *callback,
161 gpointer callback_data);
164 * Trigger fetch of WebTicket security token from login.microsoftonline.com
165 * using a Web Ticket acquired
167 * @param sipe_private SIPE core private data
168 * @param session opaque session pointer
169 * @param wsse_security predefined authentication token. May be @c NULL
170 * @param service_uri request token for this service URI
171 * @param callback callback function
172 * @param callback_data callback data
173 * @return @c TRUE if token fetch was triggered
175 gboolean sipe_svc_webticket_lmc_federated(struct sipe_core_private *sipe_private,
176 struct sipe_svc_session *session,
177 const gchar *wsse_security,
178 const gchar *service_uri,
179 sipe_svc_callback *callback,
180 gpointer callback_data);
183 * Trigger fetch of RealmInfo data from login.microsoftonline.com
185 * @param sipe_private SIPE core private data
186 * @param session opaque session pointer
187 * @param callback callback function
188 * @param callback_data callback data
189 * @return @c TRUE if data fetch was triggered
191 gboolean sipe_svc_realminfo(struct sipe_core_private *sipe_private,
192 struct sipe_svc_session *session,
193 sipe_svc_callback *callback,
194 gpointer callback_data);
197 * Trigger fetch of service metadata
199 * @param sipe_private SIPE core private data
200 * @param session opaque session pointer
201 * @param uri service URI
202 * @param callback callback function
203 * @param callback_data callback data
204 * @return @c TRUE if metadata fetch was triggered
206 gboolean sipe_svc_metadata(struct sipe_core_private *sipe_private,
207 struct sipe_svc_session *session,
208 const gchar *uri,
209 sipe_svc_callback *callback,
210 gpointer callback_data);
213 * Free service data
215 * @param sipe_private SIPE core private data
217 void sipe_svc_free(struct sipe_core_private *sipe_private);