packet_diag.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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_NONE, standard nl API requires this attribute! */
  27. PACKET_DIAG_INFO,
  28. PACKET_DIAG_MCLIST,
  29. PACKET_DIAG_RX_RING,
  30. PACKET_DIAG_TX_RING,
  31. PACKET_DIAG_FANOUT,
  32. PACKET_DIAG_UID,
  33. PACKET_DIAG_MEMINFO,
  34. PACKET_DIAG_FILTER,
  35. __PACKET_DIAG_MAX,
  36. };
  37. #define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1)
  38. struct packet_diag_info {
  39. __u32 pdi_index;
  40. __u32 pdi_version;
  41. __u32 pdi_reserve;
  42. __u32 pdi_copy_thresh;
  43. __u32 pdi_tstamp;
  44. __u32 pdi_flags;
  45. #define PDI_RUNNING 0x1
  46. #define PDI_AUXDATA 0x2
  47. #define PDI_ORIGDEV 0x4
  48. #define PDI_VNETHDR 0x8
  49. #define PDI_LOSS 0x10
  50. };
  51. struct packet_diag_mclist {
  52. __u32 pdmc_index;
  53. __u32 pdmc_count;
  54. __u16 pdmc_type;
  55. __u16 pdmc_alen;
  56. __u8 pdmc_addr[32]; /* MAX_ADDR_LEN */
  57. };
  58. struct packet_diag_ring {
  59. __u32 pdr_block_size;
  60. __u32 pdr_block_nr;
  61. __u32 pdr_frame_size;
  62. __u32 pdr_frame_nr;
  63. __u32 pdr_retire_tmo;
  64. __u32 pdr_sizeof_priv;
  65. __u32 pdr_features;
  66. };
  67. #endif