diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2016-02-10 18:41:11 +0000 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:45:29 -0600 |
commit | a5e98aca204b652d90fb1a3daa72511027b0a969 (patch) | |
tree | af9881820e2f3fb1a43cc1c1d86d66b95968bb54 /nbd/nbd-internal.h | |
parent | c5258a9f1e5679a164951bcab3771a441d8595ae (diff) | |
download | hqemu-a5e98aca204b652d90fb1a3daa72511027b0a969.zip hqemu-a5e98aca204b652d90fb1a3daa72511027b0a969.tar.gz |
nbd: implement TLS support in the protocol negotiation
This extends the NBD protocol handling code so that it is capable
of negotiating TLS support during the connection setup. This involves
requesting the STARTTLS protocol option before any other NBD options.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1455129674-17255-14-git-send-email-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'nbd/nbd-internal.h')
-rw-r--r-- | nbd/nbd-internal.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nbd/nbd-internal.h b/nbd/nbd-internal.h index 9960034..db6ab65 100644 --- a/nbd/nbd-internal.h +++ b/nbd/nbd-internal.h @@ -11,6 +11,7 @@ #define NBD_INTERNAL_H #include "block/nbd.h" #include "sysemu/block-backend.h" +#include "io/channel-tls.h" #include "qemu/coroutine.h" #include "qemu/iov.h" @@ -78,6 +79,8 @@ #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. @@ -108,4 +111,15 @@ static inline ssize_t write_sync(QIOChannel *ioc, void *buffer, size_t size) return nbd_wr_syncv(ioc, &iov, 1, 0, size, false); } +struct NBDTLSHandshakeData { + GMainLoop *loop; + bool complete; + Error *error; +}; + + +void nbd_tls_handshake(Object *src, + Error *err, + void *opaque); + #endif |