Blame libsoup/soup-server.h

rpm-build 4f3c61
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
rpm-build 4f3c61
/*
rpm-build 4f3c61
 * Copyright (C) 2000-2003, Ximian, Inc.
rpm-build 4f3c61
 */
rpm-build 4f3c61
rpm-build 4f3c61
#ifndef SOUP_SERVER_H
rpm-build 4f3c61
#define SOUP_SERVER_H 1
rpm-build 4f3c61
rpm-build 4f3c61
#include <libsoup/soup-types.h>
rpm-build 4f3c61
#include <libsoup/soup-uri.h>
rpm-build 4f3c61
#include <libsoup/soup-websocket-connection.h>
rpm-build 4f3c61
rpm-build 4f3c61
G_BEGIN_DECLS
rpm-build 4f3c61
rpm-build 4f3c61
#define SOUP_TYPE_SERVER            (soup_server_get_type ())
rpm-build 4f3c61
#define SOUP_SERVER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_SERVER, SoupServer))
rpm-build 4f3c61
#define SOUP_SERVER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_SERVER, SoupServerClass))
rpm-build 4f3c61
#define SOUP_IS_SERVER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_SERVER))
rpm-build 4f3c61
#define SOUP_IS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_SERVER))
rpm-build 4f3c61
#define SOUP_SERVER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_SERVER, SoupServerClass))
rpm-build 4f3c61
rpm-build 4f3c61
typedef struct SoupClientContext SoupClientContext;
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
GType soup_client_context_get_type (void);
rpm-build 4f3c61
#define SOUP_TYPE_CLIENT_CONTEXT (soup_client_context_get_type ())
rpm-build 4f3c61
rpm-build 4f3c61
typedef enum {
rpm-build 4f3c61
	SOUP_SERVER_LISTEN_HTTPS     = (1 << 0),
rpm-build 4f3c61
	SOUP_SERVER_LISTEN_IPV4_ONLY = (1 << 1),
rpm-build 4f3c61
	SOUP_SERVER_LISTEN_IPV6_ONLY = (1 << 2)
rpm-build 4f3c61
} SoupServerListenOptions;
rpm-build 4f3c61
rpm-build 4f3c61
struct _SoupServer {
rpm-build 4f3c61
	GObject parent;
rpm-build 4f3c61
rpm-build 4f3c61
};
rpm-build 4f3c61
rpm-build 4f3c61
typedef struct {
rpm-build 4f3c61
	GObjectClass parent_class;
rpm-build 4f3c61
rpm-build 4f3c61
	/* signals */
rpm-build 4f3c61
	void (*request_started)  (SoupServer *server, SoupMessage *msg,
rpm-build 4f3c61
				  SoupClientContext *client);
rpm-build 4f3c61
	void (*request_read)     (SoupServer *server, SoupMessage *msg,
rpm-build 4f3c61
				  SoupClientContext *client);
rpm-build 4f3c61
	void (*request_finished) (SoupServer *server, SoupMessage *msg,
rpm-build 4f3c61
				  SoupClientContext *client);
rpm-build 4f3c61
	void (*request_aborted)  (SoupServer *server, SoupMessage *msg,
rpm-build 4f3c61
				  SoupClientContext *client);
rpm-build 4f3c61
rpm-build 4f3c61
	/* Padding for future expansion */
rpm-build 4f3c61
	void (*_libsoup_reserved1) (void);
rpm-build 4f3c61
	void (*_libsoup_reserved2) (void);
rpm-build 4f3c61
	void (*_libsoup_reserved3) (void);
rpm-build 4f3c61
	void (*_libsoup_reserved4) (void);
rpm-build 4f3c61
} SoupServerClass;
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
GType soup_server_get_type (void);
rpm-build 4f3c61
rpm-build 4f3c61
#define SOUP_SERVER_TLS_CERTIFICATE "tls-certificate"
rpm-build 4f3c61
#define SOUP_SERVER_RAW_PATHS       "raw-paths"
rpm-build 4f3c61
#define SOUP_SERVER_SERVER_HEADER   "server-header"
rpm-build 4f3c61
#define SOUP_SERVER_HTTP_ALIASES    "http-aliases"
rpm-build 4f3c61
#define SOUP_SERVER_HTTPS_ALIASES   "https-aliases"
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
SoupServer     *soup_server_new                (const char               *optname1,
rpm-build 4f3c61
					        ...) G_GNUC_NULL_TERMINATED;
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_48
rpm-build 4f3c61
gboolean        soup_server_set_ssl_cert_file  (SoupServer               *server,
rpm-build 4f3c61
					        const char               *ssl_cert_file,
rpm-build 4f3c61
					        const char               *ssl_key_file,
rpm-build 4f3c61
					        GError                  **error);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
gboolean        soup_server_is_https           (SoupServer               *server);
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_48
rpm-build 4f3c61
gboolean        soup_server_listen             (SoupServer               *server,
rpm-build 4f3c61
					        GSocketAddress           *address,
rpm-build 4f3c61
					        SoupServerListenOptions   options,
rpm-build 4f3c61
					        GError                  **error);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_48
rpm-build 4f3c61
gboolean        soup_server_listen_all         (SoupServer               *server,
rpm-build 4f3c61
					        guint                     port,
rpm-build 4f3c61
					        SoupServerListenOptions   options,
rpm-build 4f3c61
					        GError                  **error);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_48
rpm-build 4f3c61
gboolean        soup_server_listen_local       (SoupServer               *server,
rpm-build 4f3c61
					        guint                     port,
rpm-build 4f3c61
					        SoupServerListenOptions   options,
rpm-build 4f3c61
					        GError                  **error);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_48
rpm-build 4f3c61
gboolean        soup_server_listen_socket      (SoupServer               *server,
rpm-build 4f3c61
					        GSocket                  *socket,
rpm-build 4f3c61
					        SoupServerListenOptions   options,
rpm-build 4f3c61
					        GError                  **error);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_48
rpm-build 4f3c61
gboolean        soup_server_listen_fd          (SoupServer               *server,
rpm-build 4f3c61
					        int                       fd,
rpm-build 4f3c61
					        SoupServerListenOptions   options,
rpm-build 4f3c61
					        GError                  **error);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_48
rpm-build 4f3c61
GSList         *soup_server_get_uris           (SoupServer               *server);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_48
rpm-build 4f3c61
GSList         *soup_server_get_listeners      (SoupServer               *server);
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
void            soup_server_disconnect         (SoupServer               *server);
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_50
rpm-build 4f3c61
gboolean        soup_server_accept_iostream    (SoupServer               *server,
rpm-build 4f3c61
						GIOStream                *stream,
rpm-build 4f3c61
						GSocketAddress           *local_addr,
rpm-build 4f3c61
						GSocketAddress           *remote_addr,
rpm-build 4f3c61
						GError                  **error);
rpm-build 4f3c61
rpm-build 4f3c61
/* Handlers and auth */
rpm-build 4f3c61
rpm-build 4f3c61
typedef void  (*SoupServerCallback)            (SoupServer         *server,
rpm-build 4f3c61
						SoupMessage        *msg,
rpm-build 4f3c61
						const char         *path,
rpm-build 4f3c61
						GHashTable         *query,
rpm-build 4f3c61
						SoupClientContext  *client,
rpm-build 4f3c61
						gpointer            user_data);
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
void            soup_server_add_handler        (SoupServer         *server,
rpm-build 4f3c61
					        const char         *path,
rpm-build 4f3c61
					        SoupServerCallback  callback,
rpm-build 4f3c61
					        gpointer            user_data,
rpm-build 4f3c61
					        GDestroyNotify      destroy);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_50
rpm-build 4f3c61
void            soup_server_add_early_handler  (SoupServer         *server,
rpm-build 4f3c61
						const char         *path,
rpm-build 4f3c61
						SoupServerCallback  callback,
rpm-build 4f3c61
						gpointer            user_data,
rpm-build 4f3c61
						GDestroyNotify      destroy);
rpm-build 4f3c61
rpm-build 4f3c61
typedef void (*SoupServerWebsocketCallback) (SoupServer              *server,
rpm-build 4f3c61
					     SoupWebsocketConnection *connection,
rpm-build 4f3c61
					     const char              *path,
rpm-build 4f3c61
					     SoupClientContext       *client,
rpm-build 4f3c61
					     gpointer                 user_data);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_50
rpm-build 4f3c61
void            soup_server_add_websocket_handler (SoupServer                   *server,
rpm-build 4f3c61
						   const char                   *path,
rpm-build 4f3c61
						   const char                   *origin,
rpm-build 4f3c61
						   char                        **protocols,
rpm-build 4f3c61
						   SoupServerWebsocketCallback   callback,
rpm-build 4f3c61
						   gpointer                      user_data,
rpm-build 4f3c61
						   GDestroyNotify                destroy);
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
void            soup_server_remove_handler     (SoupServer         *server,
rpm-build 4f3c61
					        const char         *path);
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
void            soup_server_add_auth_domain    (SoupServer         *server,
rpm-build 4f3c61
					        SoupAuthDomain     *auth_domain);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
void            soup_server_remove_auth_domain (SoupServer         *server,
rpm-build 4f3c61
					        SoupAuthDomain     *auth_domain);
rpm-build 4f3c61
rpm-build 4f3c61
/* I/O */
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
void            soup_server_pause_message   (SoupServer  *server,
rpm-build 4f3c61
					     SoupMessage *msg);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
void            soup_server_unpause_message (SoupServer  *server,
rpm-build 4f3c61
					     SoupMessage *msg);
rpm-build 4f3c61
rpm-build 4f3c61
/* Client context */
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_48
rpm-build 4f3c61
GSocket        *soup_client_context_get_gsocket        (SoupClientContext *client);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_48
rpm-build 4f3c61
GSocketAddress *soup_client_context_get_local_address  (SoupClientContext *client);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_48
rpm-build 4f3c61
GSocketAddress *soup_client_context_get_remote_address (SoupClientContext *client);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
const char     *soup_client_context_get_host           (SoupClientContext *client);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
SoupAuthDomain *soup_client_context_get_auth_domain    (SoupClientContext *client);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
const char     *soup_client_context_get_auth_user      (SoupClientContext *client);
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_50
rpm-build 4f3c61
GIOStream      *soup_client_context_steal_connection   (SoupClientContext *client);
rpm-build 4f3c61
rpm-build 4f3c61
/* Legacy API */
rpm-build 4f3c61
rpm-build 4f3c61
#define SOUP_SERVER_PORT          "port"
rpm-build 4f3c61
#define SOUP_SERVER_INTERFACE     "interface"
rpm-build 4f3c61
#define SOUP_SERVER_ASYNC_CONTEXT "async-context"
rpm-build 4f3c61
#define SOUP_SERVER_SSL_CERT_FILE "ssl-cert-file"
rpm-build 4f3c61
#define SOUP_SERVER_SSL_KEY_FILE  "ssl-key-file"
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
SOUP_DEPRECATED_IN_2_48
rpm-build 4f3c61
guint         soup_server_get_port            (SoupServer        *server);
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
SOUP_DEPRECATED_IN_2_48
rpm-build 4f3c61
SoupSocket   *soup_server_get_listener        (SoupServer        *server);
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
SOUP_DEPRECATED_IN_2_48
rpm-build 4f3c61
GMainContext *soup_server_get_async_context   (SoupServer        *server);
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
SOUP_DEPRECATED_IN_2_48
rpm-build 4f3c61
void          soup_server_run                 (SoupServer        *server);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
SOUP_DEPRECATED_IN_2_48
rpm-build 4f3c61
void          soup_server_run_async           (SoupServer        *server);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
SOUP_DEPRECATED_IN_2_48
rpm-build 4f3c61
void          soup_server_quit                (SoupServer        *server);
rpm-build 4f3c61
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
SOUP_DEPRECATED_IN_2_48
rpm-build 4f3c61
SoupAddress  *soup_client_context_get_address (SoupClientContext *client);
rpm-build 4f3c61
SOUP_AVAILABLE_IN_2_4
rpm-build 4f3c61
SOUP_DEPRECATED_IN_2_48
rpm-build 4f3c61
SoupSocket   *soup_client_context_get_socket  (SoupClientContext *client);
rpm-build 4f3c61
rpm-build 4f3c61
G_END_DECLS
rpm-build 4f3c61
rpm-build 4f3c61
#endif /* SOUP_SERVER_H */