genetlink.h 1.7 KB

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