1nbd_get_extended_headers_negotiated(3L)IBNBnDbd_get_extended_headers_negotiated(3)
2
3
4
6 nbd_get_extended_headers_negotiated - see if extended headers are in
7 use
8
10 #include <libnbd.h>
11
12 int nbd_get_extended_headers_negotiated (
13 struct nbd_handle *h
14 );
15
17 After connecting you may call this to find out if the connection is
18 using extended headers. Note that this setting is sticky; this can
19 return true even after a second nbd_opt_extended_headers(3) returns
20 false because the server detected a duplicate request.
21
22 When extended headers are not in use, commands are limited to a 32-bit
23 length, even when the libnbd API uses a 64-bit parameter to express the
24 length. But even when extended headers are supported, the server may
25 enforce other limits, visible through nbd_get_block_size(3).
26
27 Note that when extended headers are negotiated, you should prefer the
28 use of nbd_block_status_64(3) instead of nbd_block_status(3) if any of
29 the meta contexts you requested via nbd_add_meta_context(3) might
30 return 64-bit status values; however, all of the well-known meta
31 contexts covered by current "LIBNBD_CONTEXT_*" constants only return
32 32-bit status.
33
35 This call returns a boolean value.
36
38 On error -1 is returned.
39
40 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
41 of the error.
42
43 The following parameters must not be NULL: "h". For more information
44 see "Non-NULL parameters" in libnbd(3).
45
47 The handle must be negotiating, or connected with the server, or shut
48 down, otherwise this call will return an error.
49
51 This function first appeared in libnbd 1.18.
52
53 If you need to test if this function is available at compile time check
54 if the following macro is defined:
55
56 #define LIBNBD_HAVE_NBD_GET_EXTENDED_HEADERS_NEGOTIATED 1
57
59 nbd_add_meta_context(3), nbd_block_status(3), nbd_block_status_64(3),
60 nbd_cache(3), nbd_create(3), nbd_get_block_size(3),
61 nbd_get_protocol(3), nbd_get_request_extended_headers(3),
62 nbd_get_structured_replies_negotiated(3), nbd_opt_extended_headers(3),
63 nbd_set_request_extended_headers(3), nbd_trim(3), nbd_zero(3),
64 libnbd(3).
65
67 Eric Blake
68
69 Richard W.M. Jones
70
72 Copyright Red Hat
73
75 This library is free software; you can redistribute it and/or modify it
76 under the terms of the GNU Lesser General Public License as published
77 by the Free Software Foundation; either version 2 of the License, or
78 (at your option) any later version.
79
80 This library is distributed in the hope that it will be useful, but
81 WITHOUT ANY WARRANTY; without even the implied warranty of
82 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
83 Lesser General Public License for more details.
84
85 You should have received a copy of the GNU Lesser General Public
86 License along with this library; if not, write to the Free Software
87 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
88 02110-1301 USA
89
90
91
92libnbd-1.18.1 2023-10n-b3d1_get_extended_headers_negotiated(3)