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.
32

RETURN VALUE

34       This call returns a boolean value.
35

ERRORS

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

HANDLE STATE

46       The handle must be negotiating, otherwise this call will return an
47       error.
48

VERSION

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

SEE ALSO

58       nbd_aio_opt_structured_reply(3), nbd_create(3),
59       nbd_get_structured_replies_negotiated(3), nbd_opt_go(3),
60       nbd_set_opt_mode(3), nbd_set_request_structured_replies(3), libnbd(3).
61

AUTHORS

63       Eric Blake
64
65       Richard W.M. Jones
66
68       Copyright Red Hat
69

LICENSE

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