nbd.h
01:
02: pavel@ucw.cz
03:
04:
05:
06:
07:
08: <ldl@aros.net>
09:
10:
11:
12:
13:
14:
15: #ifndef LINUX_NBD_H
16: #define LINUX_NBD_H
17:
18: #include <linux/types.h>
19:
20: #define NBD_SET_SOCK _IO( 0xab, 0 )
21: #define NBD_SET_BLKSIZE _IO( 0xab, 1 )
22: #define NBD_SET_SIZE _IO( 0xab, 2 )
23: #define NBD_DO_IT _IO( 0xab, 3 )
24: #define NBD_CLEAR_SOCK _IO( 0xab, 4 )
25: #define NBD_CLEAR_QUE _IO( 0xab, 5 )
26: #define NBD_PRINT_DEBUG _IO( 0xab, 6 )
27: #define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 )
28: #define NBD_DISCONNECT _IO( 0xab, 8 )
29: #define NBD_SET_TIMEOUT _IO( 0xab, 9 )
30:
31: enum {
32: NBD_CMD_READ = 0,
33: NBD_CMD_WRITE = 1,
34: NBD_CMD_DISC = 2
35: };
36:
37: #define nbd_cmd(req) ((req)->cmd[0])
38:
39:
40:
41:
42:
43: #define NBD_REQUEST_MAGIC 0x25609513
44: #define NBD_REPLY_MAGIC 0x67446698
45:
46:
47:
48:
49:
50:
51: struct nbd_request {
52: __be32 magic;
53: __be32 type;
54: char handle[8];
55: __be64 from;
56: __be32 len;
57: } __attribute__((packed));
58:
59:
60:
61:
62:
63: struct nbd_reply {
64: __be32 magic;
65: __be32 error;
66: char handle[8];
67: };
68: #endif
69:
© Andrew Scott 2006 -
2025,
All Rights Reserved