1nbd_opt_extended_headers(3)         LIBNBD         nbd_opt_extended_headers(3)
2
3
4

NAME

6       nbd_opt_extended_headers - request the server to enable extended
7       headers
8

SYNOPSIS

10        #include <libnbd.h>
11
12        int nbd_opt_extended_headers (
13              struct nbd_handle *h
14            );
15

DESCRIPTION

17       Request that the server use extended headers, by sending
18       "NBD_OPT_EXTENDED_HEADERS".  This can only be used if
19       nbd_set_opt_mode(3) enabled option mode; furthermore, libnbd defaults
20       to automatically requesting this unless you use
21       nbd_set_request_extended_headers(3) or
22       nbd_set_request_structured_replies(3) prior to connecting.  This
23       function is mainly useful for integration testing of corner cases in
24       server handling.
25
26       This function returns true if the server replies with success, false if
27       the server replies with an error, and fails only if the server does not
28       reply (such as for a loss of connection).  Note that some servers fail
29       a second request as redundant; libnbd assumes that once one request has
30       succeeded, then extended headers are supported (as visible by
31       nbd_get_extended_headers_negotiated(3)) regardless if later calls to
32       this function return false.  If this function returns true, the use of
33       structured replies is implied.
34

RETURN VALUE

36       This call returns a boolean value.
37

ERRORS

39       On error -1 is returned.
40
41       Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
42       of the error.
43
44       The following parameters must not be NULL: "h".  For more information
45       see "Non-NULL parameters" in libnbd(3).
46

HANDLE STATE

48       The handle must be negotiating, otherwise this call will return an
49       error.
50

VERSION

52       This function first appeared in libnbd 1.18.
53
54       If you need to test if this function is available at compile time check
55       if the following macro is defined:
56
57        #define LIBNBD_HAVE_NBD_OPT_EXTENDED_HEADERS 1
58

SEE ALSO

60       nbd_aio_opt_extended_headers(3), nbd_create(3),
61       nbd_get_extended_headers_negotiated(3), nbd_opt_go(3),
62       nbd_set_opt_mode(3), nbd_set_request_extended_headers(3),
63       nbd_set_request_structured_replies(3), libnbd(3).
64

AUTHORS

66       Eric Blake
67
68       Richard W.M. Jones
69
71       Copyright Red Hat
72

LICENSE

74       This library is free software; you can redistribute it and/or modify it
75       under the terms of the GNU Lesser General Public License as published
76       by the Free Software Foundation; either version 2 of the License, or
77       (at your option) any later version.
78
79       This library is distributed in the hope that it will be useful, but
80       WITHOUT ANY WARRANTY; without even the implied warranty of
81       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
82       Lesser General Public License for more details.
83
84       You should have received a copy of the GNU Lesser General Public
85       License along with this library; if not, write to the Free Software
86       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
87       02110-1301 USA
88
89
90
91libnbd-1.18.1                     2023-10-31       nbd_opt_extended_headers(3)
Impressum