packet_diag.h 1.5 KB

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