1nbd_aio_opt_starttls(3) LIBNBD nbd_aio_opt_starttls(3)
2
3
4
6 nbd_aio_opt_starttls - request the server to initiate TLS
7
9 #include <libnbd.h>
10
11 typedef struct {
12 int (*callback) (void *user_data, int *error);
13 void *user_data;
14 void (*free) (void *user_data);
15 } nbd_completion_callback;
16
17 int nbd_aio_opt_starttls (
18 struct nbd_handle *h,
19 nbd_completion_callback completion_callback
20 );
21
23 Request that the server initiate a secure TLS connection, by sending
24 "NBD_OPT_STARTTLS". This behaves like the synchronous counterpart
25 nbd_opt_starttls(3), except that it does not wait for the server's
26 response.
27
28 To determine when the request completes, wait for
29 nbd_aio_is_connecting(3) to return false. Or supply the optional
30 "completion_callback" which will be invoked as described in "Completion
31 callbacks" in libnbd(3), except that it is automatically retired
32 regardless of return value. Note that detecting whether the server
33 returns an error (as is done by the return value of the synchronous
34 counterpart) is only possible with a completion callback.
35
37 If the call is successful the function returns 0.
38
40 On error -1 is returned.
41
42 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
43 of the error.
44
45 The following parameters must not be NULL: "h". For more information
46 see "Non-NULL parameters" in libnbd(3).
47
49 The handle must be negotiating, otherwise this call will return an
50 error.
51
53 This function first appeared in libnbd 1.16.
54
55 If you need to test if this function is available at compile time check
56 if the following macro is defined:
57
58 #define LIBNBD_HAVE_NBD_AIO_OPT_STARTTLS 1
59
61 nbd_aio_is_connecting(3), nbd_create(3), nbd_opt_starttls(3),
62 nbd_set_opt_mode(3), libnbd(3).
63
65 Eric Blake
66
67 Richard W.M. Jones
68
70 Copyright Red Hat
71
73 This library is free software; you can redistribute it and/or modify it
74 under the terms of the GNU Lesser General Public License as published
75 by the Free Software Foundation; either version 2 of the License, or
76 (at your option) any later version.
77
78 This library is distributed in the hope that it will be useful, but
79 WITHOUT ANY WARRANTY; without even the implied warranty of
80 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
81 Lesser General Public License for more details.
82
83 You should have received a copy of the GNU Lesser General Public
84 License along with this library; if not, write to the Free Software
85 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
86 02110-1301 USA
87
88
89
90libnbd-1.18.1 2023-10-31 nbd_aio_opt_starttls(3)