nbd-netlink.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * Copyright (C) 2017 Facebook. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public
  7. * License v2 as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public
  15. * License along with this program; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 021110-1307, USA.
  18. */
  19. #ifndef _UAPILINUX_NBD_NETLINK_H
  20. #define _UAPILINUX_NBD_NETLINK_H
  21. #define NBD_GENL_FAMILY_NAME "nbd"
  22. #define NBD_GENL_VERSION 0x1
  23. #define NBD_GENL_MCAST_GROUP_NAME "nbd_mc_group"
  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,
  37. };
  38. #define NBD_ATTR_MAX (__NBD_ATTR_MAX - 1)
  39. /*
  40. * This is the format for multiple devices with NBD_ATTR_DEVICE_LIST
  41. *
  42. * [NBD_ATTR_DEVICE_LIST]
  43. * [NBD_DEVICE_ITEM]
  44. * [NBD_DEVICE_INDEX]
  45. * [NBD_DEVICE_CONNECTED]
  46. */
  47. enum {
  48. NBD_DEVICE_ITEM_UNSPEC,
  49. NBD_DEVICE_ITEM,
  50. __NBD_DEVICE_ITEM_MAX,
  51. };
  52. #define NBD_DEVICE_ITEM_MAX (__NBD_DEVICE_ITEM_MAX - 1)
  53. enum {
  54. NBD_DEVICE_UNSPEC,
  55. NBD_DEVICE_INDEX,
  56. NBD_DEVICE_CONNECTED,
  57. __NBD_DEVICE_MAX,
  58. };
  59. #define NBD_DEVICE_ATTR_MAX (__NBD_DEVICE_MAX - 1)
  60. /*
  61. * This is the format for multiple sockets with NBD_ATTR_SOCKETS
  62. *
  63. * [NBD_ATTR_SOCKETS]
  64. * [NBD_SOCK_ITEM]
  65. * [NBD_SOCK_FD]
  66. * [NBD_SOCK_ITEM]
  67. * [NBD_SOCK_FD]
  68. */
  69. enum {
  70. NBD_SOCK_ITEM_UNSPEC,
  71. NBD_SOCK_ITEM,
  72. __NBD_SOCK_ITEM_MAX,
  73. };
  74. #define NBD_SOCK_ITEM_MAX (__NBD_SOCK_ITEM_MAX - 1)
  75. enum {
  76. NBD_SOCK_UNSPEC,
  77. NBD_SOCK_FD,
  78. __NBD_SOCK_MAX,
  79. };
  80. #define NBD_SOCK_MAX (__NBD_SOCK_MAX - 1)
  81. enum {
  82. NBD_CMD_UNSPEC,
  83. NBD_CMD_CONNECT,
  84. NBD_CMD_DISCONNECT,
  85. NBD_CMD_RECONFIGURE,
  86. NBD_CMD_LINK_DEAD,
  87. NBD_CMD_STATUS,
  88. __NBD_CMD_MAX,
  89. };
  90. #define NBD_CMD_MAX (__NBD_CMD_MAX - 1)
  91. #endif /* _UAPILINUX_NBD_NETLINK_H */