packet_diag.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. struct packet_diag_msg {
  17. __u8 pdiag_family;
  18. __u8 pdiag_type;
  19. __u16 pdiag_num;
  20. __u32 pdiag_ino;
  21. __u32 pdiag_cookie[2];
  22. };
  23. enum {
  24. PACKET_DIAG_INFO,
  25. PACKET_DIAG_MCLIST,
  26. PACKET_DIAG_RX_RING,
  27. PACKET_DIAG_TX_RING,
  28. PACKET_DIAG_FANOUT,
  29. PACKET_DIAG_MAX,
  30. };
  31. struct packet_diag_info {
  32. __u32 pdi_index;
  33. __u32 pdi_version;
  34. __u32 pdi_reserve;
  35. __u32 pdi_copy_thresh;
  36. __u32 pdi_tstamp;
  37. __u32 pdi_flags;
  38. #define PDI_RUNNING 0x1
  39. #define PDI_AUXDATA 0x2
  40. #define PDI_ORIGDEV 0x4
  41. #define PDI_VNETHDR 0x8
  42. #define PDI_LOSS 0x10
  43. };
  44. struct packet_diag_mclist {
  45. __u32 pdmc_index;
  46. __u32 pdmc_count;
  47. __u16 pdmc_type;
  48. __u16 pdmc_alen;
  49. __u8 pdmc_addr[MAX_ADDR_LEN];
  50. };
  51. struct packet_diag_ring {
  52. __u32 pdr_block_size;
  53. __u32 pdr_block_nr;
  54. __u32 pdr_frame_size;
  55. __u32 pdr_frame_nr;
  56. __u32 pdr_retire_tmo;
  57. __u32 pdr_sizeof_priv;
  58. __u32 pdr_features;
  59. };
  60. #endif