1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2607ca46eSDavid Howells #ifndef __PACKET_DIAG_H__ 3607ca46eSDavid Howells #define __PACKET_DIAG_H__ 4607ca46eSDavid Howells 5607ca46eSDavid Howells #include <linux/types.h> 6607ca46eSDavid Howells 7607ca46eSDavid Howells struct packet_diag_req { 8607ca46eSDavid Howells __u8 sdiag_family; 9607ca46eSDavid Howells __u8 sdiag_protocol; 10607ca46eSDavid Howells __u16 pad; 11607ca46eSDavid Howells __u32 pdiag_ino; 12607ca46eSDavid Howells __u32 pdiag_show; 13607ca46eSDavid Howells __u32 pdiag_cookie[2]; 14607ca46eSDavid Howells }; 15607ca46eSDavid Howells 16607ca46eSDavid Howells #define PACKET_SHOW_INFO 0x00000001 /* Basic packet_sk information */ 17607ca46eSDavid Howells #define PACKET_SHOW_MCLIST 0x00000002 /* A set of packet_diag_mclist-s */ 18607ca46eSDavid Howells #define PACKET_SHOW_RING_CFG 0x00000004 /* Rings configuration parameters */ 19607ca46eSDavid Howells #define PACKET_SHOW_FANOUT 0x00000008 2076d0eeb1SNicolas Dichtel #define PACKET_SHOW_MEMINFO 0x00000010 21e8d9612cSNicolas Dichtel #define PACKET_SHOW_FILTER 0x00000020 22607ca46eSDavid Howells 23607ca46eSDavid Howells struct packet_diag_msg { 24607ca46eSDavid Howells __u8 pdiag_family; 25607ca46eSDavid Howells __u8 pdiag_type; 26607ca46eSDavid Howells __u16 pdiag_num; 27607ca46eSDavid Howells 28607ca46eSDavid Howells __u32 pdiag_ino; 29607ca46eSDavid Howells __u32 pdiag_cookie[2]; 30607ca46eSDavid Howells }; 31607ca46eSDavid Howells 32607ca46eSDavid Howells enum { 3331e20badSNicolas Dichtel /* PACKET_DIAG_NONE, standard nl API requires this attribute! */ 34607ca46eSDavid Howells PACKET_DIAG_INFO, 35607ca46eSDavid Howells PACKET_DIAG_MCLIST, 36607ca46eSDavid Howells PACKET_DIAG_RX_RING, 37607ca46eSDavid Howells PACKET_DIAG_TX_RING, 38607ca46eSDavid Howells PACKET_DIAG_FANOUT, 3962641903SNicolas Dichtel PACKET_DIAG_UID, 4076d0eeb1SNicolas Dichtel PACKET_DIAG_MEMINFO, 41e8d9612cSNicolas Dichtel PACKET_DIAG_FILTER, 42607ca46eSDavid Howells 43ae5fc987SAndrey Vagin __PACKET_DIAG_MAX, 44607ca46eSDavid Howells }; 45607ca46eSDavid Howells 46ae5fc987SAndrey Vagin #define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1) 47ae5fc987SAndrey Vagin 48607ca46eSDavid Howells struct packet_diag_info { 49607ca46eSDavid Howells __u32 pdi_index; 50607ca46eSDavid Howells __u32 pdi_version; 51607ca46eSDavid Howells __u32 pdi_reserve; 52607ca46eSDavid Howells __u32 pdi_copy_thresh; 53607ca46eSDavid Howells __u32 pdi_tstamp; 54607ca46eSDavid Howells __u32 pdi_flags; 55607ca46eSDavid Howells 56607ca46eSDavid Howells #define PDI_RUNNING 0x1 57607ca46eSDavid Howells #define PDI_AUXDATA 0x2 58607ca46eSDavid Howells #define PDI_ORIGDEV 0x4 59607ca46eSDavid Howells #define PDI_VNETHDR 0x8 60607ca46eSDavid Howells #define PDI_LOSS 0x10 61607ca46eSDavid Howells }; 62607ca46eSDavid Howells 63607ca46eSDavid Howells struct packet_diag_mclist { 64607ca46eSDavid Howells __u32 pdmc_index; 65607ca46eSDavid Howells __u32 pdmc_count; 66607ca46eSDavid Howells __u16 pdmc_type; 67607ca46eSDavid Howells __u16 pdmc_alen; 68745cb7f8SDmitry V. Levin __u8 pdmc_addr[32]; /* MAX_ADDR_LEN */ 69607ca46eSDavid Howells }; 70607ca46eSDavid Howells 71607ca46eSDavid Howells struct packet_diag_ring { 72607ca46eSDavid Howells __u32 pdr_block_size; 73607ca46eSDavid Howells __u32 pdr_block_nr; 74607ca46eSDavid Howells __u32 pdr_frame_size; 75607ca46eSDavid Howells __u32 pdr_frame_nr; 76607ca46eSDavid Howells __u32 pdr_retire_tmo; 77607ca46eSDavid Howells __u32 pdr_sizeof_priv; 78607ca46eSDavid Howells __u32 pdr_features; 79607ca46eSDavid Howells }; 80607ca46eSDavid Howells 81607ca46eSDavid Howells #endif 82