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 | fff3321 | 2012-08-16 05:36:48 +0000 | [diff] [blame] | 18 | #define PACKET_SHOW_FANOUT 0x00000008 |
Nicolas Dichtel | 76d0eeb | 2013-04-25 06:53:53 +0000 | [diff] [blame] | 19 | #define PACKET_SHOW_MEMINFO 0x00000010 |
Nicolas Dichtel | e8d9612 | 2013-04-25 06:53:54 +0000 | [diff] [blame] | 20 | #define PACKET_SHOW_FILTER 0x00000020 |
Pavel Emelyanov | 8a360be | 2012-08-13 05:55:46 +0000 | [diff] [blame] | 21 | |
Pavel Emelyanov | 96ec632 | 2012-08-13 05:53:28 +0000 | [diff] [blame] | 22 | struct packet_diag_msg { |
| 23 | __u8 pdiag_family; |
| 24 | __u8 pdiag_type; |
| 25 | __u16 pdiag_num; |
| 26 | |
| 27 | __u32 pdiag_ino; |
| 28 | __u32 pdiag_cookie[2]; |
| 29 | }; |
| 30 | |
Pavel Emelyanov | 8a360be | 2012-08-13 05:55:46 +0000 | [diff] [blame] | 31 | enum { |
| 32 | PACKET_DIAG_INFO, |
Pavel Emelyanov | eea68e2 | 2012-08-13 05:57:44 +0000 | [diff] [blame] | 33 | PACKET_DIAG_MCLIST, |
Pavel Emelyanov | 16f0136 | 2012-08-16 05:34:22 +0000 | [diff] [blame] | 34 | PACKET_DIAG_RX_RING, |
| 35 | PACKET_DIAG_TX_RING, |
Pavel Emelyanov | fff3321 | 2012-08-16 05:36:48 +0000 | [diff] [blame] | 36 | PACKET_DIAG_FANOUT, |
Nicolas Dichtel | 6264190 | 2013-04-25 06:53:52 +0000 | [diff] [blame] | 37 | PACKET_DIAG_UID, |
Nicolas Dichtel | 76d0eeb | 2013-04-25 06:53:53 +0000 | [diff] [blame] | 38 | PACKET_DIAG_MEMINFO, |
Nicolas Dichtel | e8d9612 | 2013-04-25 06:53:54 +0000 | [diff] [blame] | 39 | PACKET_DIAG_FILTER, |
Pavel Emelyanov | 8a360be | 2012-08-13 05:55:46 +0000 | [diff] [blame] | 40 | |
Andrey Vagin | ae5fc98 | 2013-03-21 20:33:46 +0400 | [diff] [blame] | 41 | __PACKET_DIAG_MAX, |
Pavel Emelyanov | 8a360be | 2012-08-13 05:55:46 +0000 | [diff] [blame] | 42 | }; |
| 43 | |
Andrey Vagin | ae5fc98 | 2013-03-21 20:33:46 +0400 | [diff] [blame] | 44 | #define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1) |
| 45 | |
Pavel Emelyanov | 8a360be | 2012-08-13 05:55:46 +0000 | [diff] [blame] | 46 | struct packet_diag_info { |
| 47 | __u32 pdi_index; |
| 48 | __u32 pdi_version; |
| 49 | __u32 pdi_reserve; |
| 50 | __u32 pdi_copy_thresh; |
| 51 | __u32 pdi_tstamp; |
| 52 | __u32 pdi_flags; |
| 53 | |
| 54 | #define PDI_RUNNING 0x1 |
| 55 | #define PDI_AUXDATA 0x2 |
| 56 | #define PDI_ORIGDEV 0x4 |
| 57 | #define PDI_VNETHDR 0x8 |
| 58 | #define PDI_LOSS 0x10 |
| 59 | }; |
| 60 | |
Pavel Emelyanov | eea68e2 | 2012-08-13 05:57:44 +0000 | [diff] [blame] | 61 | struct packet_diag_mclist { |
| 62 | __u32 pdmc_index; |
| 63 | __u32 pdmc_count; |
| 64 | __u16 pdmc_type; |
| 65 | __u16 pdmc_alen; |
| 66 | __u8 pdmc_addr[MAX_ADDR_LEN]; |
| 67 | }; |
| 68 | |
Pavel Emelyanov | 16f0136 | 2012-08-16 05:34:22 +0000 | [diff] [blame] | 69 | struct packet_diag_ring { |
| 70 | __u32 pdr_block_size; |
| 71 | __u32 pdr_block_nr; |
| 72 | __u32 pdr_frame_size; |
| 73 | __u32 pdr_frame_nr; |
| 74 | __u32 pdr_retire_tmo; |
| 75 | __u32 pdr_sizeof_priv; |
| 76 | __u32 pdr_features; |
| 77 | }; |
| 78 | |
Pavel Emelyanov | 96ec632 | 2012-08-13 05:53:28 +0000 | [diff] [blame] | 79 | #endif |