core cleanup: separate code for sipe_backend_account_status_and_note()
[siplcs.git] / src / core / sipe-svc.h
blobcd4e0ce6c0d1a174a2030e172ec1f784f73660a4
1 /**
2 * @file sipe-svc.h
4 * pidgin-sipe
6 * Copyright (C) 2011 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_tls_random;
33 struct _sipe_xml;
35 /**
36 * Service XML callback
38 * @param sipe_private SIPE core private data
39 * @param uri service URI (NULL when request aborted)
40 * @param raw raw XML data (NULL when request failed)
41 * @param xml parsed XML data (NULL when request failed)
42 * @param callback_data callback data
44 typedef void (sipe_svc_callback)(struct sipe_core_private *sipe_private,
45 const gchar *uri,
46 const gchar *raw,
47 struct _sipe_xml *xml,
48 gpointer callback_data);
50 /**
51 * Trigger fetch of Get & Publish certificate
53 * @param sipe_private SIPE core private data
54 * @param uri service URI
55 * @param wsse_security predefined authentication token
56 * @param certreq certificate request (Base64 encoded)
57 * @param callback callback function
58 * @param callback_data callback data
59 * @return @c TRUE if token fetch was triggered
61 gboolean sipe_svc_get_and_publish_cert(struct sipe_core_private *sipe_private,
62 const gchar *uri,
63 const gchar *authuser,
64 const gchar *wsse_security,
65 const gchar *certreq,
66 sipe_svc_callback *callback,
67 gpointer callback_data);
69 /**
70 * Trigger fetch of WebTicket security token
72 * @param sipe_private SIPE core private data
73 * @param uri service URI
74 * @param authuser user name for authentication
75 * @param wsse_security predefined authentication token
76 * @param service_uri request token for this service URI
77 * @param entropy random bytes buffer for entropy
78 * @param callback callback function
79 * @param callback_data callback data
80 * @return @c TRUE if token fetch was triggered
82 gboolean sipe_svc_webticket(struct sipe_core_private *sipe_private,
83 const gchar *uri,
84 const gchar *authuser,
85 const gchar *wsse_security,
86 const gchar *service_uri,
87 const struct sipe_tls_random *entropy,
88 sipe_svc_callback *callback,
89 gpointer callback_data);
91 /**
92 * Trigger fetch of WebTicket security token from login.microsoftonline.com
94 * @param sipe_private SIPE core private data
95 * @param authuser user name for authentication
96 * @param service_uri request token for this service URI
97 * @param callback callback function
98 * @param callback_data callback data
99 * @return @c TRUE if token fetch was triggered
101 gboolean sipe_svc_webticket_lmc(struct sipe_core_private *sipe_private,
102 const gchar *authuser,
103 const gchar *service_uri,
104 sipe_svc_callback *callback,
105 gpointer callback_data);
108 * Trigger fetch of service metadata
110 * @param sipe_private SIPE core private data
111 * @param uri service URI
112 * @param callback callback function
113 * @param callback_data callback data
114 * @return @c TRUE if metadata fetch was triggered
116 gboolean sipe_svc_metadata(struct sipe_core_private *sipe_private,
117 const gchar *uri,
118 sipe_svc_callback *callback,
119 gpointer callback_data);
122 * Free service data
124 * @param sipe_private SIPE core private data
126 void sipe_svc_free(struct sipe_core_private *sipe_private);