Refactor the negotiate() and connected functions
[nbd.git] / nbd-netlink.h
bloba9e6802470ea1751bdaae6d90736744809fe44a5
1 /*
2 * Copyright (C) 2017 Facebook. All rights reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public
14 * License along with this program; if not, write to the
15 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 * Boston, MA 021110-1307, USA.
18 #ifndef _UAPILINUX_NBD_NETLINK_H
19 #define _UAPILINUX_NBD_NETLINK_H
21 #define NBD_GENL_FAMILY_NAME "nbd"
22 #define NBD_GENL_VERSION 0x1
24 /* Configuration policy attributes, used for CONNECT */
25 enum {
26 NBD_ATTR_UNSPEC,
27 NBD_ATTR_INDEX,
28 NBD_ATTR_SIZE_BYTES,
29 NBD_ATTR_BLOCK_SIZE_BYTES,
30 NBD_ATTR_TIMEOUT,
31 NBD_ATTR_SERVER_FLAGS,
32 NBD_ATTR_CLIENT_FLAGS,
33 NBD_ATTR_SOCKETS,
34 NBD_ATTR_DEAD_CONN_TIMEOUT,
35 NBD_ATTR_DEVICE_LIST,
36 __NBD_ATTR_MAX,
38 #define NBD_ATTR_MAX (__NBD_ATTR_MAX - 1)
41 * This is the format for multiple devices with NBD_ATTR_DEVICE_LIST
43 * [NBD_ATTR_DEVICE_LIST]
44 * [NBD_DEVICE_ITEM]
45 * [NBD_DEVICE_INDEX]
46 * [NBD_DEVICE_CONNECTED]
48 enum {
49 NBD_DEVICE_ITEM_UNSPEC,
50 NBD_DEVICE_ITEM,
51 __NBD_DEVICE_ITEM_MAX,
53 #define NBD_DEVICE_ITEM_MAX (__NBD_DEVICE_ITEM_MAX - 1)
55 enum {
56 NBD_DEVICE_UNSPEC,
57 NBD_DEVICE_INDEX,
58 NBD_DEVICE_CONNECTED,
59 __NBD_DEVICE_MAX,
61 #define NBD_DEVICE_ATTR_MAX (__NBD_DEVICE_MAX - 1)
64 * This is the format for multiple sockets with NBD_ATTR_SOCKETS
66 * [NBD_ATTR_SOCKETS]
67 * [NBD_SOCK_ITEM]
68 * [NBD_SOCK_FD]
69 * [NBD_SOCK_ITEM]
70 * [NBD_SOCK_FD]
72 enum {
73 NBD_SOCK_ITEM_UNSPEC,
74 NBD_SOCK_ITEM,
75 __NBD_SOCK_ITEM_MAX,
77 #define NBD_SOCK_ITEM_MAX (__NBD_SOCK_ITEM_MAX - 1)
79 enum {
80 NBD_SOCK_UNSPEC,
81 NBD_SOCK_FD,
82 __NBD_SOCK_MAX,
84 #define NBD_SOCK_MAX (__NBD_SOCK_MAX - 1)
86 enum {
87 NBD_CMD_UNSPEC,
88 NBD_CMD_CONNECT,
89 NBD_CMD_DISCONNECT,
90 NBD_CMD_RECONFIGURE,
91 NBD_CMD_LINK_DEAD,
92 NBD_CMD_STATUS,
93 __NBD_CMD_MAX,
95 #define NBD_CMD_MAX (__NBD_CMD_MAX - 1)
97 #endif /* _UAPILINUX_NBD_NETLINK_H */