aboutsummaryrefslogtreecommitdiff
path: root/nbd/nbd-internal.h
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-07-07 15:30:43 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2017-07-14 12:04:41 +0200
commit3736cc5be31f0399999e37d8b28ca9a3ed0b4ccb (patch)
tree7c6554650e86dab2c7493e6b1a81b2303b0cda3a /nbd/nbd-internal.h
parent37ec36f622d46b7d13421533efe686af2326771e (diff)
nbd: Expose and debug more NBD constants
The NBD protocol has several constants defined in various extensions that we are about to implement. Expose them to the code, along with an easy way to map various constants to strings during diagnostic messages. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20170707203049.534-4-eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'nbd/nbd-internal.h')
-rw-r--r--nbd/nbd-internal.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/nbd/nbd-internal.h b/nbd/nbd-internal.h
index cf6ecbf358..bf95601ff5 100644
--- a/nbd/nbd-internal.h
+++ b/nbd/nbd-internal.h
@@ -57,12 +57,6 @@
#define NBD_SET_TIMEOUT _IO(0xab, 9)
#define NBD_SET_FLAGS _IO(0xab, 10)
-#define NBD_OPT_EXPORT_NAME (1)
-#define NBD_OPT_ABORT (2)
-#define NBD_OPT_LIST (3)
-#define NBD_OPT_PEEK_EXPORT (4)
-#define NBD_OPT_STARTTLS (5)
-
/* NBD errors are based on errno numbers, so there is a 1:1 mapping,
* but only a limited set of errno values is specified in the protocol.
* Everything else is squashed to EINVAL.
@@ -133,6 +127,10 @@ struct NBDTLSHandshakeData {
void nbd_tls_handshake(QIOTask *task,
void *opaque);
+const char *nbd_opt_lookup(uint32_t opt);
+const char *nbd_rep_lookup(uint32_t rep);
+const char *nbd_info_lookup(uint16_t info);
+const char *nbd_cmd_lookup(uint16_t info);
int nbd_drop(QIOChannel *ioc, size_t size, Error **errp);