drbd_genl_api.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef DRBD_GENL_STRUCT_H
  2. #define DRBD_GENL_STRUCT_H
  3. /**
  4. * struct drbd_genlmsghdr - DRBD specific header used in NETLINK_GENERIC requests
  5. * @minor:
  6. * For admin requests (user -> kernel): which minor device to operate on.
  7. * For (unicast) replies or informational (broadcast) messages
  8. * (kernel -> user): which minor device the information is about.
  9. * If we do not operate on minors, but on connections or resources,
  10. * the minor value shall be (~0), and the attribute DRBD_NLA_CFG_CONTEXT
  11. * is used instead.
  12. * @flags: possible operation modifiers (relevant only for user->kernel):
  13. * DRBD_GENL_F_SET_DEFAULTS
  14. * @volume:
  15. * When creating a new minor (adding it to a resource), the resource needs
  16. * to know which volume number within the resource this is supposed to be.
  17. * The volume number corresponds to the same volume number on the remote side,
  18. * whereas the minor number on the remote side may be different
  19. * (union with flags).
  20. * @ret_code: kernel->userland unicast cfg reply return code (union with flags);
  21. */
  22. struct drbd_genlmsghdr {
  23. __u32 minor;
  24. union {
  25. __u32 flags;
  26. __s32 ret_code;
  27. };
  28. };
  29. /* To be used in drbd_genlmsghdr.flags */
  30. enum {
  31. DRBD_GENL_F_SET_DEFAULTS = 1,
  32. };
  33. enum drbd_state_info_bcast_reason {
  34. SIB_GET_STATUS_REPLY = 1,
  35. SIB_STATE_CHANGE = 2,
  36. SIB_HELPER_PRE = 3,
  37. SIB_HELPER_POST = 4,
  38. SIB_SYNC_PROGRESS = 5,
  39. };
  40. /* hack around predefined gcc/cpp "linux=1",
  41. * we cannot possibly include <1/drbd_genl.h> */
  42. #undef linux
  43. #include <linux/drbd.h>
  44. #define GENL_MAGIC_VERSION API_VERSION
  45. #define GENL_MAGIC_FAMILY drbd
  46. #define GENL_MAGIC_FAMILY_HDRSZ sizeof(struct drbd_genlmsghdr)
  47. #define GENL_MAGIC_INCLUDE_FILE <linux/drbd_genl.h>
  48. #include <linux/genl_magic_struct.h>
  49. #endif