| 1 |
/* |
| 2 |
* Copyright (C) 2013-2014 Red Hat, Inc. |
| 3 |
* SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
*/ |
| 5 |
|
| 6 |
#ifndef __COCKPIT_WEB_SERVICE_H__ |
| 7 |
#define __COCKPIT_WEB_SERVICE_H__ |
| 8 |
|
| 9 |
#include "cockpitcreds.h" |
| 10 |
|
| 11 |
#include "cockpitjson.h" |
| 12 |
#include "cockpittransport.h" |
| 13 |
#include "cockpitwebresponse.h" |
| 14 |
#include "cockpitwebserver.h" |
| 15 |
|
| 16 |
#include "websocket.h" |
| 17 |
|
| 18 |
G_BEGIN_DECLS |
| 19 |
|
| 20 |
#define COCKPIT_TYPE_WEB_SERVICE (cockpit_web_service_get_type ()) |
| 21 |
#define COCKPIT_WEB_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), COCKPIT_TYPE_WEB_SERVICE, CockpitWebService)) |
| 22 |
#define COCKPIT_IS_WEB_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), COCKPIT_TYPE_WEB_SERVICE)) |
| 23 |
|
| 24 |
typedef struct _CockpitWebService CockpitWebService; |
| 25 |
|
| 26 |
GType cockpit_web_service_get_type (void); |
| 27 |
|
| 28 |
CockpitWebService * cockpit_web_service_new (CockpitCreds *creds, |
| 29 |
CockpitTransport *local_session); |
| 30 |
|
| 31 |
void cockpit_web_service_disconnect (CockpitWebService *self); |
| 32 |
|
| 33 |
void cockpit_web_service_socket (CockpitWebService *self, |
| 34 |
CockpitWebRequest *request); |
| 35 |
|
| 36 |
CockpitCreds * cockpit_web_service_get_creds (CockpitWebService *self); |
| 37 |
const gchar * cockpit_web_service_get_id (CockpitWebService *self); |
| 38 |
void cockpit_web_service_set_id (CockpitWebService *self, |
| 39 |
const gchar *id); |
| 40 |
|
| 41 |
gboolean cockpit_web_service_get_idling (CockpitWebService *self); |
| 42 |
|
| 43 |
WebSocketConnection * cockpit_web_service_create_socket (const gchar **protocols, |
| 44 |
CockpitWebRequest *request); |
| 45 |
|
| 46 |
gchar * cockpit_web_service_unique_channel (CockpitWebService *self); |
| 47 |
|
| 48 |
CockpitTransport * cockpit_web_service_get_transport (CockpitWebService *self); |
| 49 |
|
| 50 |
JsonObject * cockpit_web_service_get_init (CockpitWebService *self); |
| 51 |
|
| 52 |
gboolean cockpit_web_service_parse_binary (JsonObject *open, |
| 53 |
WebSocketDataType *type); |
| 54 |
|
| 55 |
gboolean cockpit_web_service_parse_external (JsonObject *open, |
| 56 |
const gchar **content_type, |
| 57 |
const gchar **content_encoding, |
| 58 |
const gchar **content_disposition, |
| 59 |
const gchar ***protocols); |
| 60 |
|
| 61 |
const gchar * cockpit_web_service_get_host (CockpitWebService *self, |
| 62 |
const gchar *checksum); |
| 63 |
|
| 64 |
const gchar * cockpit_web_service_get_checksum (CockpitWebService *self, |
| 65 |
const gchar *host); |
| 66 |
|
| 67 |
void cockpit_web_service_set_host_checksum (CockpitWebService *self, |
| 68 |
const gchar *host, |
| 69 |
const gchar *checksum); |
| 70 |
|
| 71 |
G_END_DECLS |
| 72 |
|
| 73 |
#endif /* __COCKPIT_WEB_SERVICE_H__ */ |