genetlink.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _UAPI__LINUX_GENERIC_NETLINK_H
  3. #define _UAPI__LINUX_GENERIC_NETLINK_H
  4. #include <linux/types.h>
  5. #include <linux/netlink.h>
  6. #define GENL_NAMSIZ 16 /* length of family name */
  7. #define GENL_MIN_ID NLMSG_MIN_TYPE
  8. #define GENL_MAX_ID 1023
  9. struct genlmsghdr {
  10. __u8 cmd;
  11. __u8 version;
  12. __u16 reserved;
  13. };
  14. #define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr))
  15. #define GENL_ADMIN_PERM 0x01
  16. #define GENL_CMD_CAP_DO 0x02
  17. #define GENL_CMD_CAP_DUMP 0x04
  18. #define GENL_CMD_CAP_HASPOL 0x08
  19. #define GENL_UNS_ADMIN_PERM 0x10
  20. /*
  21. * List of reserved static generic netlink identifiers:
  22. */
  23. #define GENL_ID_CTRL NLMSG_MIN_TYPE
  24. #define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1)
  25. #define GENL_ID_PMCRAID (NLMSG_MIN_TYPE + 2)
  26. /* must be last reserved + 1 */
  27. #define GENL_START_ALLOC (NLMSG_MIN_TYPE + 3)
  28. /**************************************************************************
  29. * Controller
  30. **************************************************************************/
  31. enum {
  32. CTRL_CMD_UNSPEC,
  33. CTRL_CMD_NEWFAMILY,
  34. CTRL_CMD_DELFAMILY,
  35. CTRL_CMD_GETFAMILY,
  36. CTRL_CMD_NEWOPS,
  37. CTRL_CMD_DELOPS,
  38. CTRL_CMD_GETOPS,
  39. CTRL_CMD_NEWMCAST_GRP,
  40. CTRL_CMD_DELMCAST_GRP,
  41. CTRL_CMD_GETMCAST_GRP, /* unused */
  42. __CTRL_CMD_MAX,
  43. };
  44. #define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1)
  45. enum {
  46. CTRL_ATTR_UNSPEC,
  47. CTRL_ATTR_FAMILY_ID,
  48. CTRL_ATTR_FAMILY_NAME,
  49. CTRL_ATTR_VERSION,
  50. CTRL_ATTR_HDRSIZE,
  51. CTRL_ATTR_MAXATTR,
  52. CTRL_ATTR_OPS,
  53. CTRL_ATTR_MCAST_GROUPS,
  54. __CTRL_ATTR_MAX,
  55. };
  56. #define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
  57. enum {
  58. CTRL_ATTR_OP_UNSPEC,
  59. CTRL_ATTR_OP_ID,
  60. CTRL_ATTR_OP_FLAGS,
  61. __CTRL_ATTR_OP_MAX,
  62. };
  63. #define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
  64. enum {
  65. CTRL_ATTR_MCAST_GRP_UNSPEC,
  66. CTRL_ATTR_MCAST_GRP_NAME,
  67. CTRL_ATTR_MCAST_GRP_ID,
  68. __CTRL_ATTR_MCAST_GRP_MAX,
  69. };
  70. #define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
  71. #endif /* _UAPI__LINUX_GENERIC_NETLINK_H */