nbd_set_uri_allow_transports(3)
π nbd_set_uri_allow_transports β libnbd's lil' transport bouncer π
okay so bestie, picture this: it's a manual page from libnbd, and it's here to tell you about nbd_set_uri_allow_transports β the function that decides which transports are even allowed to show up in your NBD URIs. yes, it's giving gatekeeper energy, and honestly? she's slaying at it. β¨
πΈ SYNOPSIS πΈ
#include <libnbd.h>
int nbd_set_uri_allow_transports (
struct nbd_handle *h, uint32_t mask
);
like, that's it. you hand her a handle and a mask and she does her thing. periodt. π
π¦ DESCRIPTION π¦
So here's the tea: this function sets which transports are allowed to appear in NBD URIs. And the default? literally any transport. she's not picky by default, bestie, she's like "come one, come all" β but you can make her picky if you want. no cap.
The mask parameter may contain any of the following flags ORed together (yes, OR them, like a little flag salad π₯):
LIBNBD_ALLOW_TRANSPORT_TCP=0x1LIBNBD_ALLOW_TRANSPORT_UNIX=0x2LIBNBD_ALLOW_TRANSPORT_VSOCK=0x4LIBNBD_ALLOW_TRANSPORT_SSH=0x8
For convenience (and honestly, thank god), the constant LIBNBD_ALLOW_TRANSPORT_MASK is available to describe all transports recognized by this build of libnbd. iconic. π«Ά
heads up though: a future version of the library may add new flags. so like, don't @ her when that happens, she warned you π
β¨ RETURN VALUE β¨
If the call is successful, the function returns 0. that's the good ending, bestie. π
π ERRORS π
On error, -1 is returned. rip.
Refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error β she's not gonna spell it all out here, go read the lore. π
The following parameters must not be NULL: h. For more information see "Non-NULL parameters" in libnbd(3). like, do not come at her with a NULL handle, she will not be amused π
π HANDLE STATE π
nbd_set_uri_allow_transports can be called when the handle is in the following state:
βββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββ
β Handle created, before connecting β β
allowed β
β Connecting β β error β
β Connecting & handshaking (opt_mode) β β error β
β Connected to the server β β error β
β Connection shut down β β error β
β Handle dead β β error β
βββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββ
so basically: only before connecting. after that? it's a no from her. the vibe check has been failed. βπ
β VERSION β
This function first appeared in libnbd 1.2. she's been around, she's got history, she's a main character. π
If you need to test if this function is available at compile time, check if the following macro is defined:
#define LIBNBD_HAVE_NBD_SET_URI_ALLOW_TRANSPORTS 1
iykyk π₯
π§ SEE ALSO π§
nbd_connect_uri(3), nbd_create(3), nbd_set_uri_allow_tls(3), libnbd(3).
go read those too, bestie, they're all part of the same friend group π«Ά
π AUTHORS π
Eric Blake
Richard W.M. Jones
(legends, fr fr π)
π COPYRIGHT π
Copyright Red Hat
πΈ LICENSE πΈ
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
that's the whole page, babe β brought to you by libnbd-1.25.8, dated 2026-10-13, and yes, it really is nbd_set_uri_allow_transports(3). mwah πβ¨
π¦ where this page comes from
- centos-stream 10: libnbd-devel 1.25.8-1.el10 Β· LGPL-2.0-or-later AND BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms