xref: /linux-6.15/include/uapi/linux/packet_diag.h (revision 607ca46e)
1*607ca46eSDavid Howells #ifndef __PACKET_DIAG_H__
2*607ca46eSDavid Howells #define __PACKET_DIAG_H__
3*607ca46eSDavid Howells 
4*607ca46eSDavid Howells #include <linux/types.h>
5*607ca46eSDavid Howells 
6*607ca46eSDavid Howells struct packet_diag_req {
7*607ca46eSDavid Howells 	__u8	sdiag_family;
8*607ca46eSDavid Howells 	__u8	sdiag_protocol;
9*607ca46eSDavid Howells 	__u16	pad;
10*607ca46eSDavid Howells 	__u32	pdiag_ino;
11*607ca46eSDavid Howells 	__u32	pdiag_show;
12*607ca46eSDavid Howells 	__u32	pdiag_cookie[2];
13*607ca46eSDavid Howells };
14*607ca46eSDavid Howells 
15*607ca46eSDavid Howells #define PACKET_SHOW_INFO	0x00000001 /* Basic packet_sk information */
16*607ca46eSDavid Howells #define PACKET_SHOW_MCLIST	0x00000002 /* A set of packet_diag_mclist-s */
17*607ca46eSDavid Howells #define PACKET_SHOW_RING_CFG	0x00000004 /* Rings configuration parameters */
18*607ca46eSDavid Howells #define PACKET_SHOW_FANOUT	0x00000008
19*607ca46eSDavid Howells 
20*607ca46eSDavid Howells struct packet_diag_msg {
21*607ca46eSDavid Howells 	__u8	pdiag_family;
22*607ca46eSDavid Howells 	__u8	pdiag_type;
23*607ca46eSDavid Howells 	__u16	pdiag_num;
24*607ca46eSDavid Howells 
25*607ca46eSDavid Howells 	__u32	pdiag_ino;
26*607ca46eSDavid Howells 	__u32	pdiag_cookie[2];
27*607ca46eSDavid Howells };
28*607ca46eSDavid Howells 
29*607ca46eSDavid Howells enum {
30*607ca46eSDavid Howells 	PACKET_DIAG_INFO,
31*607ca46eSDavid Howells 	PACKET_DIAG_MCLIST,
32*607ca46eSDavid Howells 	PACKET_DIAG_RX_RING,
33*607ca46eSDavid Howells 	PACKET_DIAG_TX_RING,
34*607ca46eSDavid Howells 	PACKET_DIAG_FANOUT,
35*607ca46eSDavid Howells 
36*607ca46eSDavid Howells 	PACKET_DIAG_MAX,
37*607ca46eSDavid Howells };
38*607ca46eSDavid Howells 
39*607ca46eSDavid Howells struct packet_diag_info {
40*607ca46eSDavid Howells 	__u32	pdi_index;
41*607ca46eSDavid Howells 	__u32	pdi_version;
42*607ca46eSDavid Howells 	__u32	pdi_reserve;
43*607ca46eSDavid Howells 	__u32	pdi_copy_thresh;
44*607ca46eSDavid Howells 	__u32	pdi_tstamp;
45*607ca46eSDavid Howells 	__u32	pdi_flags;
46*607ca46eSDavid Howells 
47*607ca46eSDavid Howells #define PDI_RUNNING	0x1
48*607ca46eSDavid Howells #define PDI_AUXDATA	0x2
49*607ca46eSDavid Howells #define PDI_ORIGDEV	0x4
50*607ca46eSDavid Howells #define PDI_VNETHDR	0x8
51*607ca46eSDavid Howells #define PDI_LOSS	0x10
52*607ca46eSDavid Howells };
53*607ca46eSDavid Howells 
54*607ca46eSDavid Howells struct packet_diag_mclist {
55*607ca46eSDavid Howells 	__u32	pdmc_index;
56*607ca46eSDavid Howells 	__u32	pdmc_count;
57*607ca46eSDavid Howells 	__u16	pdmc_type;
58*607ca46eSDavid Howells 	__u16	pdmc_alen;
59*607ca46eSDavid Howells 	__u8	pdmc_addr[MAX_ADDR_LEN];
60*607ca46eSDavid Howells };
61*607ca46eSDavid Howells 
62*607ca46eSDavid Howells struct packet_diag_ring {
63*607ca46eSDavid Howells 	__u32	pdr_block_size;
64*607ca46eSDavid Howells 	__u32	pdr_block_nr;
65*607ca46eSDavid Howells 	__u32	pdr_frame_size;
66*607ca46eSDavid Howells 	__u32	pdr_frame_nr;
67*607ca46eSDavid Howells 	__u32	pdr_retire_tmo;
68*607ca46eSDavid Howells 	__u32	pdr_sizeof_priv;
69*607ca46eSDavid Howells 	__u32	pdr_features;
70*607ca46eSDavid Howells };
71*607ca46eSDavid Howells 
72*607ca46eSDavid Howells #endif
73