Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gdtlsconnection.h
Go to the documentation of this file.
1/* GIO - GLib Input, Output and Streaming Library
2 *
3 * Copyright © 2010 Red Hat, Inc.
4 * Copyright © 2015 Collabora, Ltd.
5 *
6 * SPDX-License-Identifier: LGPL-2.1-or-later
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General
19 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef __G_DTLS_CONNECTION_H__
23#define __G_DTLS_CONNECTION_H__
24
25#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
26#error "Only <gio/gio.h> can be included directly."
27#endif
28
29#include <gio/gdatagrambased.h>
30
32
33#define G_TYPE_DTLS_CONNECTION (g_dtls_connection_get_type ())
34#define G_DTLS_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_DTLS_CONNECTION, GDtlsConnection))
35#define G_IS_DTLS_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_DTLS_CONNECTION))
36#define G_DTLS_CONNECTION_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_DTLS_CONNECTION, GDtlsConnectionInterface))
37
39
40/**
41 * GDtlsConnectionInterface:
42 * @g_iface: The parent interface.
43 * @accept_certificate: Check whether to accept a certificate.
44 * @handshake: Perform a handshake operation.
45 * @handshake_async: Start an asynchronous handshake operation.
46 * @handshake_finish: Finish an asynchronous handshake operation.
47 * @shutdown: Shut down one or both directions of the connection.
48 * @shutdown_async: Start an asynchronous shutdown operation.
49 * @shutdown_finish: Finish an asynchronous shutdown operation.
50 * @set_advertised_protocols: Set APLN protocol list (Since: 2.60)
51 * @get_negotiated_protocol: Get ALPN-negotiated protocol (Since: 2.60)
52 * @get_binding_data: Retrieve TLS channel binding data (Since: 2.66)
53 *
54 * Virtual method table for a #GDtlsConnection implementation.
55 *
56 * Since: 2.48
57 */
59{
61
62 /* signals */
64 GTlsCertificate *peer_cert,
66
67 /* methods */
69 GCancellable *cancellable,
70 GError **error);
71
73 int io_priority,
74 GCancellable *cancellable,
75 GAsyncReadyCallback callback,
76 gpointer user_data);
78 GAsyncResult *result,
79 GError **error);
80
82 gboolean shutdown_read,
83 gboolean shutdown_write,
84 GCancellable *cancellable,
85 GError **error);
86
88 gboolean shutdown_read,
89 gboolean shutdown_write,
90 int io_priority,
91 GCancellable *cancellable,
92 GAsyncReadyCallback callback,
93 gpointer user_data);
95 GAsyncResult *result,
96 GError **error);
97
99 const gchar * const *protocols);
100 const gchar *(*get_negotiated_protocol) (GDtlsConnection *conn);
101
105 GByteArray *data,
106 GError **error);
108};
109
112
115 GTlsDatabase *database);
118
121 GTlsCertificate *certificate);
124
127 GTlsInteraction *interaction);
130
135
138 gboolean require_close_notify);
141
149
152 GCancellable *cancellable,
153 GError **error);
154
157 int io_priority,
158 GCancellable *cancellable,
159 GAsyncReadyCallback callback,
160 gpointer user_data);
163 GAsyncResult *result,
164 GError **error);
165
168 gboolean shutdown_read,
169 gboolean shutdown_write,
170 GCancellable *cancellable,
171 GError **error);
172
175 gboolean shutdown_read,
176 gboolean shutdown_write,
177 int io_priority,
178 GCancellable *cancellable,
179 GAsyncReadyCallback callback,
180 gpointer user_data);
183 GAsyncResult *result,
184 GError **error);
185
188 GCancellable *cancellable,
189 GError **error);
190
193 int io_priority,
194 GCancellable *cancellable,
195 GAsyncReadyCallback callback,
196 gpointer user_data);
199 GAsyncResult *result,
200 GError **error);
201
202/*< protected >*/
205 GTlsCertificate *peer_cert,
206 GTlsCertificateFlags errors);
209 const gchar * const *protocols);
210
213
218 GByteArray *data,
219 GError **error);
221
224
227
229
230#endif /* __G_DTLS_CONNECTION_H__ */
G_GNUC_END_IGNORE_DEPRECATIONS GIO_AVAILABLE_IN_2_70 GTlsProtocolVersion g_dtls_connection_get_protocol_version(GDtlsConnection *conn)
GIO_AVAILABLE_IN_2_48 void g_dtls_connection_shutdown_async(GDtlsConnection *conn, gboolean shutdown_read, gboolean shutdown_write, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_DEPRECATED_IN_2_60 GTlsRehandshakeMode g_dtls_connection_get_rehandshake_mode(GDtlsConnection *conn)
GIO_AVAILABLE_IN_2_48 GType g_dtls_connection_get_type(void) G_GNUC_CONST
GIO_AVAILABLE_IN_2_48 gboolean g_dtls_connection_get_require_close_notify(GDtlsConnection *conn)
GIO_AVAILABLE_IN_2_48 gboolean g_dtls_connection_handshake_finish(GDtlsConnection *conn, GAsyncResult *result, GError **error)
GIO_AVAILABLE_IN_2_48 void g_dtls_connection_handshake_async(GDtlsConnection *conn, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_2_48 void g_dtls_connection_set_interaction(GDtlsConnection *conn, GTlsInteraction *interaction)
G_GNUC_BEGIN_IGNORE_DEPRECATIONS GIO_DEPRECATED_IN_2_60 void g_dtls_connection_set_rehandshake_mode(GDtlsConnection *conn, GTlsRehandshakeMode mode)
G_GNUC_BEGIN_IGNORE_DEPRECATIONS GIO_AVAILABLE_IN_2_66 gboolean g_dtls_connection_get_channel_binding_data(GDtlsConnection *conn, GTlsChannelBindingType type, GByteArray *data, GError **error)
GIO_AVAILABLE_IN_2_48 gboolean g_dtls_connection_emit_accept_certificate(GDtlsConnection *conn, GTlsCertificate *peer_cert, GTlsCertificateFlags errors)
GIO_AVAILABLE_IN_2_48 gboolean g_dtls_connection_shutdown_finish(GDtlsConnection *conn, GAsyncResult *result, GError **error)
GIO_AVAILABLE_IN_2_48 GTlsDatabase * g_dtls_connection_get_database(GDtlsConnection *conn)
G_GNUC_END_IGNORE_DEPRECATIONS GIO_AVAILABLE_IN_2_48 gboolean g_dtls_connection_handshake(GDtlsConnection *conn, GCancellable *cancellable, GError **error)
GIO_AVAILABLE_IN_2_48 GTlsCertificate * g_dtls_connection_get_certificate(GDtlsConnection *conn)
GIO_AVAILABLE_IN_2_48 GTlsInteraction * g_dtls_connection_get_interaction(GDtlsConnection *conn)
GIO_AVAILABLE_IN_2_48 gboolean g_dtls_connection_close_finish(GDtlsConnection *conn, GAsyncResult *result, GError **error)
GIO_AVAILABLE_IN_2_48 GTlsCertificate * g_dtls_connection_get_peer_certificate(GDtlsConnection *conn)
GIO_AVAILABLE_IN_2_48 gboolean g_dtls_connection_close(GDtlsConnection *conn, GCancellable *cancellable, GError **error)
GIO_AVAILABLE_IN_2_48 GTlsCertificateFlags g_dtls_connection_get_peer_certificate_errors(GDtlsConnection *conn)
GIO_AVAILABLE_IN_2_48 void g_dtls_connection_set_database(GDtlsConnection *conn, GTlsDatabase *database)
GIO_AVAILABLE_IN_2_48 void g_dtls_connection_set_certificate(GDtlsConnection *conn, GTlsCertificate *certificate)
GIO_AVAILABLE_IN_2_70 gchar * g_dtls_connection_get_ciphersuite_name(GDtlsConnection *conn)
GIO_AVAILABLE_IN_2_48 gboolean g_dtls_connection_shutdown(GDtlsConnection *conn, gboolean shutdown_read, gboolean shutdown_write, GCancellable *cancellable, GError **error)
GIO_AVAILABLE_IN_2_60 const gchar * g_dtls_connection_get_negotiated_protocol(GDtlsConnection *conn)
GIO_AVAILABLE_IN_2_48 void g_dtls_connection_set_require_close_notify(GDtlsConnection *conn, gboolean require_close_notify)
GIO_AVAILABLE_IN_2_48 void g_dtls_connection_close_async(GDtlsConnection *conn, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_2_60 void g_dtls_connection_set_advertised_protocols(GDtlsConnection *conn, const gchar *const *protocols)
#define GIO_DEPRECATED_IN_2_60
#define GIO_AVAILABLE_IN_2_60
#define GIO_AVAILABLE_IN_2_48
#define GIO_AVAILABLE_IN_2_70
#define GIO_AVAILABLE_IN_2_66
GTlsCertificateFlags
Definition gioenums.h:1633
GTlsChannelBindingType
Definition gioenums.h:1682
GTlsProtocolVersion
Definition gioenums.h:1895
GTlsRehandshakeMode
Definition gioenums.h:1736
struct _GDtlsConnection GDtlsConnection
Definition giotypes.h:149
struct _GAsyncResult GAsyncResult
Definition giotypes.h:36
void(* GAsyncReadyCallback)(GObject *source_object, GAsyncResult *res, gpointer data)
Definition giotypes.h:190
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
Definition gmacros.h:771
#define G_GNUC_CONST
Definition gmacros.h:637
#define G_GNUC_END_IGNORE_DEPRECATIONS
Definition gmacros.h:772
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
G_BEGIN_DECLS typedef char gchar
Definition gtypes.h:52
void * gpointer
Definition gtypes.h:109
static void error(LoadState *S, const char *why)
void(* shutdown_async)(GDtlsConnection *conn, gboolean shutdown_read, gboolean shutdown_write, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
gboolean(* handshake_finish)(GDtlsConnection *conn, GAsyncResult *result, GError **error)
void(* set_advertised_protocols)(GDtlsConnection *conn, const gchar *const *protocols)
gboolean(* handshake)(GDtlsConnection *conn, GCancellable *cancellable, GError **error)
void(* handshake_async)(GDtlsConnection *conn, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
gboolean(* shutdown)(GDtlsConnection *conn, gboolean shutdown_read, gboolean shutdown_write, GCancellable *cancellable, GError **error)
G_GNUC_BEGIN_IGNORE_DEPRECATIONS gboolean(* get_binding_data)(GDtlsConnection *conn, GTlsChannelBindingType type, GByteArray *data, GError **error)
gboolean(* shutdown_finish)(GDtlsConnection *conn, GAsyncResult *result, GError **error)
gboolean(* accept_certificate)(GDtlsConnection *connection, GTlsCertificate *peer_cert, GTlsCertificateFlags errors)