2 * Network Block Device protocol
3 * Copyright 2006-2007, François Revol. All rights reserved.
4 * Distributed under the terms of the MIT License.
16 #define NBD_REQUEST_MAGIC 0x25609513
17 #define NBD_REPLY_MAGIC 0x67446698
19 /* in network byte order */
21 uint32 magic
; /* REQUEST_MAGIC */
23 uint64 handle
; //char handle[8];
28 /* in network byte order */
30 uint32 magic
; /* REPLY_MAGIC */
32 uint64 handle
; //char handle[8];
35 /* initialization protocol (ENBD ? or at least Linux specific ?) */
37 #define NBD_INIT_PASSWD "NBDMAGIC"
38 #define NBD_INIT_MAGIC 0x0000420281861253LL
40 /* in network byte order */
41 struct nbd_init_packet
{
42 uint8 passwd
[8]; /* "NBDMAGIC" */
43 uint64 magic
; /* INIT_MAGIC */
44 uint64 device_size
; /* size in bytes */
45 uint8 dummy
[128]; /* reserved for future use */