packet_diag.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef __PACKET_DIAG_H__
  3. #define __PACKET_DIAG_H__
  4. #include <linux/types.h>
  5. struct packet_diag_req {
  6. __u8 sdiag_family;
  7. __u8 sdiag_protocol;
  8. __u16 pad;
  9. __u32 pdiag_ino;
  10. __u32 pdiag_show;
  11. __u32 pdiag_cookie[2];
  12. };
  13. #define PACKET_SHOW_INFO 0x00000001 /* Basic packet_sk information */
  14. #define PACKET_SHOW_MCLIST 0x00000002 /* A set of packet_diag_mclist-s */
  15. #define PACKET_SHOW_RING_CFG 0x00000004 /* Rings configuration parameters */
  16. #define PACKET_SHOW_FANOUT 0x00000008
  17. #define PACKET_SHOW_MEMINFO 0x00000010
  18. #define PACKET_SHOW_FILTER 0x00000020
  19. struct packet_diag_msg {
  20. __u8 pdiag_family;
  21. __u8 pdiag_type;
  22. __u16 pdiag_num;
  23. __u32 pdiag_ino;
  24. __u32 pdiag_cookie[2];
  25. };
  26. enum {
  27. /* PACKET_DIAG_NONE, standard nl API requires this attribute! */
  28. PACKET_DIAG_INFO,
  29. PACKET_DIAG_MCLIST,
  30. PACKET_DIAG_RX_RING,
  31. PACKET_DIAG_TX_RING,
  32. PACKET_DIAG_FANOUT,
  33. PACKET_DIAG_UID,
  34. PACKET_DIAG_MEMINFO,
  35. PACKET_DIAG_FILTER,
  36. __PACKET_DIAG_MAX,
  37. };
  38. #define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1)
  39. struct packet_diag_info {
  40. __u32 pdi_index;
  41. __u32 pdi_version;
  42. __u32 pdi_reserve;
  43. __u32 pdi_copy_thresh;
  44. __u32 pdi_tstamp;
  45. __u32 pdi_flags;
  46. #define PDI_RUNNING 0x1
  47. #define PDI_AUXDATA 0x2
  48. #define PDI_ORIGDEV 0x4
  49. #define PDI_VNETHDR 0x8
  50. #define PDI_LOSS 0x10
  51. };
  52. struct packet_diag_mclist {
  53. __u32 pdmc_index;
  54. __u32 pdmc_count;
  55. __u16 pdmc_type;
  56. __u16 pdmc_alen;
  57. __u8 pdmc_addr[32]; /* MAX_ADDR_LEN */
  58. };
  59. struct packet_diag_ring {
  60. __u32 pdr_block_size;
  61. __u32 pdr_block_nr;
  62. __u32 pdr_frame_size;
  63. __u32 pdr_frame_nr;
  64. __u32 pdr_retire_tmo;
  65. __u32 pdr_sizeof_priv;
  66. __u32 pdr_features;
  67. };
  68. #endif