diff options
author | Frederic Robra | 2019-06-25 17:03:28 +0200 |
---|---|---|
committer | Frederic Robra | 2019-06-25 17:03:28 +0200 |
commit | 43e57ce5e11e9052f5a7db66f2e8613f1784f919 (patch) | |
tree | c5e1372a160b2601f61b18d617b71799b06b02ae /src/fuse/connection.h | |
download | dnbd3-ng-43e57ce5e11e9052f5a7db66f2e8613f1784f919.tar.gz dnbd3-ng-43e57ce5e11e9052f5a7db66f2e8613f1784f919.tar.xz dnbd3-ng-43e57ce5e11e9052f5a7db66f2e8613f1784f919.zip |
first version of dnbd3-ng
Diffstat (limited to 'src/fuse/connection.h')
-rw-r--r-- | src/fuse/connection.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/fuse/connection.h b/src/fuse/connection.h new file mode 100644 index 0000000..cae554c --- /dev/null +++ b/src/fuse/connection.h @@ -0,0 +1,35 @@ +#ifndef _CONNECTION_H_ +#define _CONNECTION_H_ + +#include "../shared/fdsignal.h" +#include "../shared/timing.h" +#include <stddef.h> +#include <stdbool.h> +#include <stdint.h> + +struct _dnbd3_async; + +typedef struct _dnbd3_async { + struct _dnbd3_async *next; // Next in this linked list (provate field, not set by caller) + dnbd3_signal_t* signal; // Used to signal the caller + char* buffer; // Caller-provided buffer to be filled + ticks time; // When request was put on wire, 0 if not measuring + uint64_t offset; + uint32_t length; + bool finished; // Will be set to true if the request has been handled + bool success; // Will be set to true if the request succeeded +} dnbd3_async_t; + +bool connection_init(const char *hosts, const char *image, const uint16_t rid, const bool learnNewServers); + +bool connection_initThreads(); + +uint64_t connection_getImageSize(); + +bool connection_read(dnbd3_async_t *request); + +void connection_close(); + +size_t connection_printStats(char *buffer, const size_t len); + +#endif /* CONNECTION_H_ */ |