Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:00:00

0001 /* GIO - GLib Input, Output and Streaming Library
0002  *
0003  * Copyright (C) 2010 Red Hat, Inc.
0004  * Copyright © 2015 Collabora, Ltd.
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-or-later
0007  *
0008  * This library is free software; you can redistribute it and/or
0009  * modify it under the terms of the GNU Lesser General Public
0010  * License as published by the Free Software Foundation; either
0011  * version 2.1 of the License, or (at your option) any later version.
0012  *
0013  * This library is distributed in the hope that it will be useful,
0014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016  * Lesser General Public License for more details.
0017  *
0018  * You should have received a copy of the GNU Lesser General
0019  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0020  */
0021 
0022 #ifndef __G_TLS_BACKEND_H__
0023 #define __G_TLS_BACKEND_H__
0024 
0025 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0026 #error "Only <gio/gio.h> can be included directly."
0027 #endif
0028 
0029 #include <gio/giotypes.h>
0030 
0031 G_BEGIN_DECLS
0032 
0033 /**
0034  * G_TLS_BACKEND_EXTENSION_POINT_NAME:
0035  *
0036  * Extension point for TLS functionality via #GTlsBackend.
0037  * See [Extending GIO][extending-gio].
0038  */
0039 #define G_TLS_BACKEND_EXTENSION_POINT_NAME "gio-tls-backend"
0040 
0041 #define G_TYPE_TLS_BACKEND               (g_tls_backend_get_type ())
0042 #define G_TLS_BACKEND(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_TLS_BACKEND, GTlsBackend))
0043 #define G_IS_TLS_BACKEND(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_TLS_BACKEND))
0044 #define G_TLS_BACKEND_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_TLS_BACKEND, GTlsBackendInterface))
0045 
0046 typedef struct _GTlsBackend          GTlsBackend;
0047 typedef struct _GTlsBackendInterface GTlsBackendInterface;
0048 
0049 /**
0050  * GTlsBackendInterface:
0051  * @g_iface: The parent interface.
0052  * @supports_tls: returns whether the backend supports TLS.
0053  * @supports_dtls: returns whether the backend supports DTLS
0054  * @get_default_database: returns a default #GTlsDatabase instance.
0055  * @get_certificate_type: returns the #GTlsCertificate implementation type
0056  * @get_client_connection_type: returns the #GTlsClientConnection implementation type
0057  * @get_server_connection_type: returns the #GTlsServerConnection implementation type
0058  * @get_file_database_type: returns the #GTlsFileDatabase implementation type.
0059  * @get_dtls_client_connection_type: returns the #GDtlsClientConnection implementation type
0060  * @get_dtls_server_connection_type: returns the #GDtlsServerConnection implementation type
0061  *
0062  * Provides an interface for describing TLS-related types.
0063  *
0064  * Since: 2.28
0065  */
0066 struct _GTlsBackendInterface
0067 {
0068   GTypeInterface g_iface;
0069 
0070   /* methods */
0071   gboolean       ( *supports_tls)               (GTlsBackend *backend);
0072   GType          ( *get_certificate_type)       (void);
0073   GType          ( *get_client_connection_type) (void);
0074   GType          ( *get_server_connection_type) (void);
0075   GType          ( *get_file_database_type)     (void);
0076   GTlsDatabase * ( *get_default_database)       (GTlsBackend *backend);
0077   gboolean       ( *supports_dtls)              (GTlsBackend *backend);
0078   GType          ( *get_dtls_client_connection_type) (void);
0079   GType          ( *get_dtls_server_connection_type) (void);
0080 };
0081 
0082 GIO_AVAILABLE_IN_ALL
0083 GType          g_tls_backend_get_type                   (void) G_GNUC_CONST;
0084 
0085 GIO_AVAILABLE_IN_ALL
0086 GTlsBackend *  g_tls_backend_get_default                (void);
0087 
0088 GIO_AVAILABLE_IN_ALL
0089 GTlsDatabase * g_tls_backend_get_default_database       (GTlsBackend *backend);
0090 GIO_AVAILABLE_IN_2_60
0091 void           g_tls_backend_set_default_database       (GTlsBackend  *backend,
0092                                                          GTlsDatabase *database);
0093 
0094 GIO_AVAILABLE_IN_ALL
0095 gboolean       g_tls_backend_supports_tls               (GTlsBackend *backend);
0096 GIO_AVAILABLE_IN_2_48
0097 gboolean       g_tls_backend_supports_dtls              (GTlsBackend *backend);
0098 
0099 GIO_AVAILABLE_IN_ALL
0100 GType          g_tls_backend_get_certificate_type       (GTlsBackend *backend);
0101 GIO_AVAILABLE_IN_ALL
0102 GType          g_tls_backend_get_client_connection_type (GTlsBackend *backend);
0103 GIO_AVAILABLE_IN_ALL
0104 GType          g_tls_backend_get_server_connection_type (GTlsBackend *backend);
0105 GIO_AVAILABLE_IN_ALL
0106 GType          g_tls_backend_get_file_database_type     (GTlsBackend *backend);
0107 
0108 GIO_AVAILABLE_IN_2_48
0109 GType          g_tls_backend_get_dtls_client_connection_type (GTlsBackend *backend);
0110 GIO_AVAILABLE_IN_2_48
0111 GType          g_tls_backend_get_dtls_server_connection_type (GTlsBackend *backend);
0112 
0113 G_END_DECLS
0114 
0115 #endif /* __G_TLS_BACKEND_H__ */