xref: /linux-6.15/include/uapi/linux/packet_diag.h (revision ae5fc987)
1607ca46eSDavid Howells #ifndef __PACKET_DIAG_H__
2607ca46eSDavid Howells #define __PACKET_DIAG_H__
3607ca46eSDavid Howells 
4607ca46eSDavid Howells #include <linux/types.h>
5607ca46eSDavid Howells 
6607ca46eSDavid Howells struct packet_diag_req {
7607ca46eSDavid Howells 	__u8	sdiag_family;
8607ca46eSDavid Howells 	__u8	sdiag_protocol;
9607ca46eSDavid Howells 	__u16	pad;
10607ca46eSDavid Howells 	__u32	pdiag_ino;
11607ca46eSDavid Howells 	__u32	pdiag_show;
12607ca46eSDavid Howells 	__u32	pdiag_cookie[2];
13607ca46eSDavid Howells };
14607ca46eSDavid Howells 
15607ca46eSDavid Howells #define PACKET_SHOW_INFO	0x00000001 /* Basic packet_sk information */
16607ca46eSDavid Howells #define PACKET_SHOW_MCLIST	0x00000002 /* A set of packet_diag_mclist-s */
17607ca46eSDavid Howells #define PACKET_SHOW_RING_CFG	0x00000004 /* Rings configuration parameters */
18607ca46eSDavid Howells #define PACKET_SHOW_FANOUT	0x00000008
19607ca46eSDavid Howells 
20607ca46eSDavid Howells struct packet_diag_msg {
21607ca46eSDavid Howells 	__u8	pdiag_family;
22607ca46eSDavid Howells 	__u8	pdiag_type;
23607ca46eSDavid Howells 	__u16	pdiag_num;
24607ca46eSDavid Howells 
25607ca46eSDavid Howells 	__u32	pdiag_ino;
26607ca46eSDavid Howells 	__u32	pdiag_cookie[2];
27607ca46eSDavid Howells };
28607ca46eSDavid Howells 
29607ca46eSDavid Howells enum {
30607ca46eSDavid Howells 	PACKET_DIAG_INFO,
31607ca46eSDavid Howells 	PACKET_DIAG_MCLIST,
32607ca46eSDavid Howells 	PACKET_DIAG_RX_RING,
33607ca46eSDavid Howells 	PACKET_DIAG_TX_RING,
34607ca46eSDavid Howells 	PACKET_DIAG_FANOUT,
35607ca46eSDavid Howells 
36*ae5fc987SAndrey Vagin 	__PACKET_DIAG_MAX,
37607ca46eSDavid Howells };
38607ca46eSDavid Howells 
39*ae5fc987SAndrey Vagin #define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1)
40*ae5fc987SAndrey Vagin 
41607ca46eSDavid Howells struct packet_diag_info {
42607ca46eSDavid Howells 	__u32	pdi_index;
43607ca46eSDavid Howells 	__u32	pdi_version;
44607ca46eSDavid Howells 	__u32	pdi_reserve;
45607ca46eSDavid Howells 	__u32	pdi_copy_thresh;
46607ca46eSDavid Howells 	__u32	pdi_tstamp;
47607ca46eSDavid Howells 	__u32	pdi_flags;
48607ca46eSDavid Howells 
49607ca46eSDavid Howells #define PDI_RUNNING	0x1
50607ca46eSDavid Howells #define PDI_AUXDATA	0x2
51607ca46eSDavid Howells #define PDI_ORIGDEV	0x4
52607ca46eSDavid Howells #define PDI_VNETHDR	0x8
53607ca46eSDavid Howells #define PDI_LOSS	0x10
54607ca46eSDavid Howells };
55607ca46eSDavid Howells 
56607ca46eSDavid Howells struct packet_diag_mclist {
57607ca46eSDavid Howells 	__u32	pdmc_index;
58607ca46eSDavid Howells 	__u32	pdmc_count;
59607ca46eSDavid Howells 	__u16	pdmc_type;
60607ca46eSDavid Howells 	__u16	pdmc_alen;
61607ca46eSDavid Howells 	__u8	pdmc_addr[MAX_ADDR_LEN];
62607ca46eSDavid Howells };
63607ca46eSDavid Howells 
64607ca46eSDavid Howells struct packet_diag_ring {
65607ca46eSDavid Howells 	__u32	pdr_block_size;
66607ca46eSDavid Howells 	__u32	pdr_block_nr;
67607ca46eSDavid Howells 	__u32	pdr_frame_size;
68607ca46eSDavid Howells 	__u32	pdr_frame_nr;
69607ca46eSDavid Howells 	__u32	pdr_retire_tmo;
70607ca46eSDavid Howells 	__u32	pdr_sizeof_priv;
71607ca46eSDavid Howells 	__u32	pdr_features;
72607ca46eSDavid Howells };
73607ca46eSDavid Howells 
74607ca46eSDavid Howells #endif
75