Displaying 20 results from an estimated 89 matches for "htobe64".
Did you mean:
htobe32
2019 Sep 24
0
[PATCH nbdkit 3/4] common/protocol: Update nbd-protocol.h so it matches libnbd’s copy.
...-55,7 +55,7 @@ static int
send_newstyle_option_reply (struct connection *conn,
uint32_t option, uint32_t reply)
{
- struct fixed_new_option_reply fixed_new_option_reply;
+ struct nbd_fixed_new_option_reply fixed_new_option_reply;
fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC);
fixed_new_option_reply.option = htobe32 (option);
@@ -83,7 +83,7 @@ static int
send_newstyle_option_reply_exportname (struct connection *conn,
uint32_t option, uint32_t reply)
{
- struct fixed_new_option_reply fixed_new_option_reply;
+...
2019 Sep 25
3
[nbdkit PATCH 0/2] more protocol.h tweaks
More nbd-protocol.h improvements
Eric Blake (2):
common/protocol: Switch nbdmagic to uint64_t
common/protocol: Declare additional constants
common/protocol/nbd-protocol.h | 16 ++++++++++------
server/protocol-handshake-newstyle.c | 2 +-
server/protocol-handshake-oldstyle.c | 2 +-
plugins/nbd/nbd-standalone.c | 2 +-
tests/test-layers.c | 2 +-
5 files
2016 Sep 26
1
[PATCH] nbdkit: flags are 32 bits for oldstyle connections
...ug ("oldstyle negotiation: flags: global 0x%x export 0x%x",
- gflags, eflags);
+ debug ("oldstyle negotiation: server flags: 0x%x", flags);
memset (&handshake, 0, sizeof handshake);
memcpy (handshake.nbdmagic, "NBDMAGIC", 8);
handshake.version = htobe64 (OLD_VERSION);
handshake.exportsize = htobe64 (exportsize);
- handshake.gflags = htobe16 (gflags);
- handshake.eflags = htobe16 (eflags);
+ handshake.flags = htobe32 (flags);
if (xwrite (conn->sockout, &handshake, sizeof handshake) == -1) {
nbdkit_error ("write: %m"...
2023 May 30
2
[libnbd PATCH v3 04/22] states: Prepare to send 64-bit requests
...41,24 @@ ISSUE_COMMAND.START:
> > return 0;
> > }
> >
> > - h->request.magic = htobe32 (NBD_REQUEST_MAGIC);
> > - h->request.flags = htobe16 (cmd->flags);
> > - h->request.type = htobe16 (cmd->type);
> > - h->request.handle = htobe64 (cmd->cookie);
> > - h->request.offset = htobe64 (cmd->offset);
> > - h->request.count = htobe32 (cmd->count);
> > + /* These fields are coincident between req.compact and req.extended */
> > + h->req.compact.flags = htobe16 (cmd->flags);
> > +...
2019 Aug 30
0
[nbdkit PATCH 5/9] server: Cache per-connection size
...ct fixed_new_option_reply_info_export export;
@@ -127,7 +127,7 @@ send_newstyle_option_reply_info_export (struct connection *conn,
fixed_new_option_reply.reply = htobe32 (reply);
fixed_new_option_reply.replylen = htobe32 (sizeof export);
export.info = htobe16 (info);
- export.exportsize = htobe64 (conn->exportsize);
+ export.exportsize = htobe64 (exportsize);
export.eflags = htobe16 (conn->eflags);
if (conn->send (conn,
@@ -201,7 +201,7 @@ conn_recv_full (struct connection *conn, void *buf, size_t len,
* in that function.
*/
static int
-finish_newstyle_options (struct...
2018 Aug 06
0
[PATCH nbdkit v2] protocol: Implement NBD_OPT_GO.
...ct connection *conn,
+ uint32_t option, uint32_t reply,
+ uint16_t info)
+{
+ struct fixed_new_option_reply fixed_new_option_reply;
+ struct fixed_new_option_reply_info_export export;
+
+ fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC);
+ fixed_new_option_reply.option = htobe32 (option);
+ fixed_new_option_reply.reply = htobe32 (reply);
+ fixed_new_option_reply.replylen = htobe32 (sizeof export);
+ export.info = htobe16 (info);
+ export.exportsize = htobe64 (conn->exportsize);
+ export.eflags = htobe16 (c...
2019 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
...if (compute_eflags (conn, &eflags) < 0)
- return -1;
-
- debug ("oldstyle negotiation: flags: global 0x%x export 0x%x",
- gflags, eflags);
-
- memset (&handshake, 0, sizeof handshake);
- memcpy (handshake.nbdmagic, "NBDMAGIC", 8);
- handshake.version = htobe64 (OLD_VERSION);
- handshake.exportsize = htobe64 (exportsize);
- handshake.gflags = htobe16 (gflags);
- handshake.eflags = htobe16 (eflags);
-
- if (conn->send (conn, &handshake, sizeof handshake) == -1) {
- nbdkit_error ("write: %m");
- return -1;
- }
-
- return 0;
-}
-...
2018 Aug 06
3
[PATCH nbdkit v2] protocol: Implement NBD_OPT_GO.
There's no substantial difference over v1, I simply fixed a few
whitespace issues, moved one struct around and tidied up the comments.
Rich.
2019 Mar 18
3
[PATCH nbdkit 0/2] server: Split out NBD protocol code from connections code.
These are a couple of patches in preparation for the Block Status
implementation. While the patches (especially the second one) are
very large they are really just elementary code motion.
Rich.
2019 Apr 23
0
[nbdkit PATCH 6/7] nbd: Implement NBD_OPT_GO client request
..._t nrinfos = htobe16 (0);
+ struct fixed_new_option_reply reply;
+ struct fixed_new_option_reply_info_export reply_export;
+ char *buffer;
+ uint16_t info;
+
+ /* TODO: structured reads, block status */
+
+ /* Try NBD_OPT_GO */
+ nbdkit_debug ("trying NBD_OPT_GO");
+ opt.version = htobe64 (NEW_VERSION);
+ opt.option = htobe32 (NBD_OPT_GO);
+ opt.optlen = htobe32 (sizeof exportnamelen + strlen (export) +
+ sizeof nrinfos);
+ if (write_full (h->fd, &opt, sizeof opt) ||
+ write_full (h->fd, &exportnamelen, sizeof exportnamelen) ||
+ wri...
2018 Aug 04
3
[PATCH nbdkit] protocol: Implement NBD_OPT_GO.
This is only lightly tested (against just qemu NBD client), and the
code might be structured a little better as the
_negotiate_handshake_newstyle_options function has now grown to be
huge. Anyway works for me.
Rich.
2014 Jan 30
4
[Bug 891] New: Build failure on Slackware AMD 64bit with GLIBC 2.7
...ortedBy: nick at linicks.net
Estimated Hours: 0.0
Being new to ipset, I tried to build from latest source today, and got build
errors:
CCLD ipset
../lib/.libs/libipset.a(session.o): In function `rawdata2attr':
/home/nick/targz/ipset-6.20.1/lib/session.c:1495: undefined reference to
`htobe64'
../lib/.libs/libipset.a(session.o): In function `attr2data':
/home/nick/targz/ipset-6.20.1/lib/session.c:618: undefined reference to
`be64toh'
collect2: ld returned 1 exit status
Researching, it turns out I need GLIBC => 2.9 to supply this.
I eventually managed to build ipset (and...
2019 Sep 24
11
[PATCH nbdkit 0/4] common/protocol: Unify public <nbd-protocol.h>
We should have only one NBD protocol file. Let's make nbdkit's
version the canonical one, and use it in libnbd.
Rich.
2017 Nov 12
6
[nbdkit PATCH] nbd: Add new nbd forwarding plugin
..._FLAG_NO_ZEROES));
+ if (write_full (h->fd, &cflags, sizeof cflags)) {
+ nbdkit_error ("unable to return global flags: %m");
+ goto err;
+ }
+
+ /* For now, we don't do any option haggling, but go straight into
+ transmission phase */
+ opt.version = htobe64 (NEW_VERSION);
+ opt.option = htobe32 (NBD_OPT_EXPORT_NAME);
+ opt.optlen = htobe32 (strlen (export));
+ if (write_full (h->fd, &opt, sizeof opt) ||
+ write_full (h->fd, export, strlen (export))) {
+ nbdkit_error ("unable to request export '%s': %m", export...
2016 Feb 05
3
[PATCH] inspect: get windows drive letters for GPT disks.
...+ memcpy (&data2, guid_bytes + 4, sizeof (data2));
+ memcpy (&data3, guid_bytes + 6, sizeof (data3));
+ memcpy (&data4, guid_bytes + 8, sizeof (data4));
+
+ /* ensure proper endianness */
+ data1 = htole32 (data1);
+ data2 = htole16 (data2);
+ data3 = htole16 (data3);
+ data4 = htobe64 (data4);
+
+ snprintf (guid, len,
+ "%08" PRIX32 "-%04" PRIX16 "-%04" PRIX16 "-%04" PRIX64 "-%06" PRIX64,
+ data1, data2, data3, (data4 >> 48), (data4 << 16));
+
+ return guid;
+}
+
/* NB: This function DOES NOT te...
2016 Jan 11
1
[PATCH] Add support for newstyle NBD protocol (RHBZ#1297100).
Experimental and only very lightly tested so far.
Rich.
2019 Apr 25
6
[nbdkit PATCH v2 0/5] structured replies/.extents for nbd plugin
Updated based on other changes that have happened in the meantime:
- rely more on cleanup.h (throughout)
- split structured read for easier review (patch 2 and 3 were combined in v1)
- rely on nbdkit not leaking a server's partial answer (patch 3)
- add tests (patch 5)
- other bug fixes I found while testing it
- drop EOVERFLOW patch for now; it will be separate once upstream
NBD protocol
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...uint32_t count, uint64_t cookie,
- const void *buf)
-{
- struct request req = {
- .magic = htobe32 (NBD_REQUEST_MAGIC),
- .flags = htobe16 (flags),
- .type = htobe16 (type),
- .handle = cookie, /* Opaque to server, so endianness doesn't matter */
- .offset = htobe64 (offset),
- .count = htobe32 (count),
- };
- int r;
-
- ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->write_lock);
- nbdkit_debug ("sending request type %d (%s), flags %#x, offset %#" PRIx64
- ", count %#x, cookie %#" PRIx64, type, name_of_nbd_cmd (type),
-...
2019 Jun 12
0
[nbdkit PATCH v3 3/5] nbd: Use libnbd 0.1.3+
...uint32_t count, uint64_t cookie,
- const void *buf)
-{
- struct request req = {
- .magic = htobe32 (NBD_REQUEST_MAGIC),
- .flags = htobe16 (flags),
- .type = htobe16 (type),
- .handle = cookie, /* Opaque to server, so endianness doesn't matter */
- .offset = htobe64 (offset),
- .count = htobe32 (count),
- };
- int r;
-
- ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->write_lock);
- nbdkit_debug ("sending request type %d (%s), flags %#x, offset %#" PRIx64
- ", count %#x, cookie %#" PRIx64, type, name_of_nbd_cmd (type),
-...
2019 May 23
2
[PATCH libnbd] api: Get rid of nbd_connection.
This isn't quite finished because not all of the tests or examples
have been updated, but it demonstrates an idea: Should we forget about
the concept of having multiple connections managed under a single
handle?
In this patch there is a single ‘struct nbd_handle *’ which manages a
single state machine and connection (and therefore no nbd_connection).
To connect to a multi-conn server you must