netlink_diag.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef __NETLINK_DIAG_H__
  3. #define __NETLINK_DIAG_H__
  4. #include <linux/types.h>
  5. struct netlink_diag_req {
  6. __u8 sdiag_family;
  7. __u8 sdiag_protocol;
  8. __u16 pad;
  9. __u32 ndiag_ino;
  10. __u32 ndiag_show;
  11. __u32 ndiag_cookie[2];
  12. };
  13. struct netlink_diag_msg {
  14. __u8 ndiag_family;
  15. __u8 ndiag_type;
  16. __u8 ndiag_protocol;
  17. __u8 ndiag_state;
  18. __u32 ndiag_portid;
  19. __u32 ndiag_dst_portid;
  20. __u32 ndiag_dst_group;
  21. __u32 ndiag_ino;
  22. __u32 ndiag_cookie[2];
  23. };
  24. struct netlink_diag_ring {
  25. __u32 ndr_block_size;
  26. __u32 ndr_block_nr;
  27. __u32 ndr_frame_size;
  28. __u32 ndr_frame_nr;
  29. };
  30. enum {
  31. /* NETLINK_DIAG_NONE, standard nl API requires this attribute! */
  32. NETLINK_DIAG_MEMINFO,
  33. NETLINK_DIAG_GROUPS,
  34. NETLINK_DIAG_RX_RING,
  35. NETLINK_DIAG_TX_RING,
  36. NETLINK_DIAG_FLAGS,
  37. __NETLINK_DIAG_MAX,
  38. };
  39. #define NETLINK_DIAG_MAX (__NETLINK_DIAG_MAX - 1)
  40. #define NDIAG_PROTO_ALL ((__u8) ~0)
  41. #define NDIAG_SHOW_MEMINFO 0x00000001 /* show memory info of a socket */
  42. #define NDIAG_SHOW_GROUPS 0x00000002 /* show groups of a netlink socket */
  43. #ifndef __KERNEL__
  44. /* deprecated since 4.6 */
  45. #define NDIAG_SHOW_RING_CFG 0x00000004 /* show ring configuration */
  46. #endif
  47. #define NDIAG_SHOW_FLAGS 0x00000008 /* show flags of a netlink socket */
  48. /* flags */
  49. #define NDIAG_FLAG_CB_RUNNING 0x00000001
  50. #define NDIAG_FLAG_PKTINFO 0x00000002
  51. #define NDIAG_FLAG_BROADCAST_ERROR 0x00000004
  52. #define NDIAG_FLAG_NO_ENOBUFS 0x00000008
  53. #define NDIAG_FLAG_LISTEN_ALL_NSID 0x00000010
  54. #define NDIAG_FLAG_CAP_ACK 0x00000020
  55. #endif