Pavel Emelyanov | 96ec632 | 2012-08-13 05:53:28 +0000 | [diff] [blame] | 1 | #ifndef __PACKET_DIAG_H__ |
| 2 | #define __PACKET_DIAG_H__ |
| 3 | |
| 4 | #include <linux/types.h> |
| 5 | |
| 6 | struct packet_diag_req { |
| 7 | __u8 sdiag_family; |
| 8 | __u8 sdiag_protocol; |
| 9 | __u16 pad; |
| 10 | __u32 pdiag_ino; |
| 11 | __u32 pdiag_show; |
| 12 | __u32 pdiag_cookie[2]; |
| 13 | }; |
| 14 | |
Pavel Emelyanov | 8a360be | 2012-08-13 05:55:46 +0000 | [diff] [blame] | 15 | #define PACKET_SHOW_INFO 0x00000001 /* Basic packet_sk information */ |
Pavel Emelyanov | eea68e2 | 2012-08-13 05:57:44 +0000 | [diff] [blame] | 16 | #define PACKET_SHOW_MCLIST 0x00000002 /* A set of packet_diag_mclist-s */ |
Pavel Emelyanov | 16f0136 | 2012-08-16 05:34:22 +0000 | [diff] [blame^] | 17 | #define PACKET_SHOW_RING_CFG 0x00000004 /* Rings configuration parameters */ |
Pavel Emelyanov | 8a360be | 2012-08-13 05:55:46 +0000 | [diff] [blame] | 18 | |
Pavel Emelyanov | 96ec632 | 2012-08-13 05:53:28 +0000 | [diff] [blame] | 19 | struct packet_diag_msg { |
| 20 | __u8 pdiag_family; |
| 21 | __u8 pdiag_type; |
| 22 | __u16 pdiag_num; |
| 23 | |
| 24 | __u32 pdiag_ino; |
| 25 | __u32 pdiag_cookie[2]; |
| 26 | }; |
| 27 | |
Pavel Emelyanov | 8a360be | 2012-08-13 05:55:46 +0000 | [diff] [blame] | 28 | enum { |
| 29 | PACKET_DIAG_INFO, |
Pavel Emelyanov | eea68e2 | 2012-08-13 05:57:44 +0000 | [diff] [blame] | 30 | PACKET_DIAG_MCLIST, |
Pavel Emelyanov | 16f0136 | 2012-08-16 05:34:22 +0000 | [diff] [blame^] | 31 | PACKET_DIAG_RX_RING, |
| 32 | PACKET_DIAG_TX_RING, |
Pavel Emelyanov | 8a360be | 2012-08-13 05:55:46 +0000 | [diff] [blame] | 33 | |
| 34 | PACKET_DIAG_MAX, |
| 35 | }; |
| 36 | |
| 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 | |
| 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 | |
Pavel Emelyanov | eea68e2 | 2012-08-13 05:57:44 +0000 | [diff] [blame] | 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[MAX_ADDR_LEN]; |
| 58 | }; |
| 59 | |
Pavel Emelyanov | 16f0136 | 2012-08-16 05:34:22 +0000 | [diff] [blame^] | 60 | struct packet_diag_ring { |
| 61 | __u32 pdr_block_size; |
| 62 | __u32 pdr_block_nr; |
| 63 | __u32 pdr_frame_size; |
| 64 | __u32 pdr_frame_nr; |
| 65 | __u32 pdr_retire_tmo; |
| 66 | __u32 pdr_sizeof_priv; |
| 67 | __u32 pdr_features; |
| 68 | }; |
| 69 | |
Pavel Emelyanov | 96ec632 | 2012-08-13 05:53:28 +0000 | [diff] [blame] | 70 | #endif |