1nbd_set_uri_allow_tls(3) LIBNBD nbd_set_uri_allow_tls(3)
2
3
4
6 nbd_set_uri_allow_tls - set the allowed TLS settings in NBD URIs
7
9 #include <libnbd.h>
10
11 int nbd_set_uri_allow_tls (struct nbd_handle *h, int tls);
12
14 Set which TLS settings are allowed to appear in NBD URIs. The default
15 is to allow either non-TLS or TLS URIs.
16
17 The "tls" parameter can be:
18
19 "LIBNBD_TLS_DISABLE"
20 TLS URIs are not permitted, ie. a URI such as "nbds://..." will be
21 rejected.
22
23 "LIBNBD_TLS_ALLOW"
24 This is the default. TLS may be used or not, depending on whether
25 the URI uses "nbds" or "nbd".
26
27 "LIBNBD_TLS_REQUIRE"
28 TLS URIs are required. All URIs must use "nbds".
29
31 If the call is successful the function returns 0.
32
34 On error "-1" is returned.
35
36 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
37 of the error.
38
39 The following parameters must not be NULL: "h". For more information
40 see "Non-NULL parameters" in libnbd(3).
41
43 The handle must be newly created, otherwise this call will return an
44 error.
45
47 This function first appeared in libnbd 1.2.
48
49 If you need to test if this function is available at compile time check
50 if the following macro is defined:
51
52 #define LIBNBD_HAVE_NBD_SET_URI_ALLOW_TLS 1
53
55 nbd_connect_uri(3), nbd_create(3), nbd_set_uri_allow_transports(3),
56 libnbd(3).
57
59 Eric Blake
60
61 Richard W.M. Jones
62
64 Copyright (C) 2019-2021 Red Hat Inc.
65
67 This library is free software; you can redistribute it and/or modify it
68 under the terms of the GNU Lesser General Public License as published
69 by the Free Software Foundation; either version 2 of the License, or
70 (at your option) any later version.
71
72 This library is distributed in the hope that it will be useful, but
73 WITHOUT ANY WARRANTY; without even the implied warranty of
74 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
75 Lesser General Public License for more details.
76
77 You should have received a copy of the GNU Lesser General Public
78 License along with this library; if not, write to the Free Software
79 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
80 02110-1301 USA
81
82
83
84libnbd-1.14.2 2023-01-03 nbd_set_uri_allow_tls(3)