File: ovirt-proxy-private.h

package info (click to toggle)
libgovirt 0.3.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,780 kB
  • sloc: ansic: 7,013; sh: 4,825; makefile: 280; xml: 86; sed: 16
file content (87 lines) | stat: -rw-r--r-- 3,499 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
 * ovirt-proxy-private.h: oVirt virtual machine private header
 *
 * Copyright (C) 2013 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see
 * <http://www.gnu.org/licenses/>.
 *
 * Author: Christophe Fergeau <cfergeau@redhat.com>
 */
#ifndef __OVIRT_PROXY_PRIVATE_H__
#define __OVIRT_PROXY_PRIVATE_H__

#include <rest/rest-xml-node.h>
#include <libsoup/soup-cookie-jar.h>
#include <libsoup/soup-session-feature.h>

#include "ovirt-proxy.h"
#include "ovirt-rest-call.h"

G_BEGIN_DECLS

struct _OvirtProxyPrivate {
    char *tmp_ca_file;
    GByteArray *display_ca;
    gboolean admin_mode;
    OvirtApi *api;
    char *jsessionid;
    SoupCookie *jsessionid_cookie;
    char *sso_token;

    SoupCookieJar *cookie_jar;
    GHashTable *additional_headers;

    gboolean setting_ca_file;
    gulong ssl_ca_file_changed_id;
};

RestXmlNode *ovirt_proxy_get_collection_xml(OvirtProxy *proxy,
                                            const char *href,
                                            GError **error);
typedef gboolean (*OvirtProxyGetCollectionAsyncCb)(OvirtProxy* proxy,
                                                   RestXmlNode *root_node,
                                                   gpointer user_data,
                                                   GError **error);
void ovirt_proxy_get_collection_xml_async(OvirtProxy *proxy,
                                          const char *href,
                                          GTask *task,
                                          GCancellable *cancellable,
                                          OvirtProxyGetCollectionAsyncCb callback,
                                          gpointer user_data,
                                          GDestroyNotify destroy_func);

typedef gboolean (*OvirtProxyCallAsyncCb)(OvirtProxy *proxy,
                                          RestProxyCall *call,
                                          gpointer user_data,
                                          GError **error);
void ovirt_rest_call_async(OvirtRestCall *call,
                           GTask *task,
                           GCancellable *cancellable,
                           OvirtProxyCallAsyncCb callback,
                           gpointer user_data,
                           GDestroyNotify destroy_func);
gboolean ovirt_rest_call_finish(GAsyncResult *result, GError **err);

/* Work around G_GNUC_DEPRECATED attribute on ovirt_proxy_get_vms() */
GList *ovirt_proxy_get_vms_internal(OvirtProxy *proxy);
void ovirt_proxy_append_additional_headers(OvirtProxy *proxy,
                                           RestProxyCall *call);
void ovirt_proxy_add_header(OvirtProxy *proxy, const char *header, const char *value);
void ovirt_proxy_add_headers(OvirtProxy *proxy, ...);
void ovirt_proxy_add_headers_from_valist(OvirtProxy *proxy, va_list headers);

G_END_DECLS

#endif /* __OVIRT_PROXY_H__ */