1nbd_opt_structured_reply(3)         LIBNBD         nbd_opt_structured_reply(3)
2
3
4

NAME

6       nbd_opt_structured_reply - request the server to enable structured
7       replies
8

SYNOPSIS

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

DESCRIPTION

17       Request that the server use structured replies, by sending
18       "NBD_OPT_STRUCTURED_REPLY".  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_structured_replies(3) prior to connecting.  This
22       function is mainly useful for integration testing of corner cases in
23       server handling.
24
25       This function returns true if the server replies with success, false if
26       the server replies with an error, and fails only if the server does not
27       reply (such as for a loss of connection).  Note that some servers fail
28       a second request as redundant; libnbd assumes that once one request has
29       succeeded, then structured replies are supported (as visible by
30       nbd_get_structured_replies_negotiated(3)) regardless if later calls to
31       this function return false.  Similarly, a server may fail this request
32       if extended headers are already negotiated, since extended headers take
33       priority.
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.16.
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_STRUCTURED_REPLY 1
58

SEE ALSO

60       nbd_aio_opt_structured_reply(3), nbd_create(3),
61       nbd_get_structured_replies_negotiated(3), nbd_opt_go(3),
62       nbd_set_opt_mode(3), nbd_set_request_structured_replies(3), libnbd(3).
63

AUTHORS

65       Eric Blake
66
67       Richard W.M. Jones
68
70       Copyright Red Hat
71

LICENSE

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_opt_structured_reply(3)
Impressum