packet_diag.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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_UID,
  30. __PACKET_DIAG_MAX,
  31. };
  32. #define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1)
  33. struct packet_diag_info {
  34. __u32 pdi_index;
  35. __u32 pdi_version;
  36. __u32 pdi_reserve;
  37. __u32 pdi_copy_thresh;
  38. __u32 pdi_tstamp;
  39. __u32 pdi_flags;
  40. #define PDI_RUNNING 0x1
  41. #define PDI_AUXDATA 0x2
  42. #define PDI_ORIGDEV 0x4
  43. #define PDI_VNETHDR 0x8
  44. #define PDI_LOSS 0x10
  45. };
  46. struct packet_diag_mclist {
  47. __u32 pdmc_index;
  48. __u32 pdmc_count;
  49. __u16 pdmc_type;
  50. __u16 pdmc_alen;
  51. __u8 pdmc_addr[MAX_ADDR_LEN];
  52. };
  53. struct packet_diag_ring {
  54. __u32 pdr_block_size;
  55. __u32 pdr_block_nr;
  56. __u32 pdr_frame_size;
  57. __u32 pdr_frame_nr;
  58. __u32 pdr_retire_tmo;
  59. __u32 pdr_sizeof_priv;
  60. __u32 pdr_features;
  61. };
  62. #endif