1224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#ifndef __PACKET_DIAG_H__
2224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define __PACKET_DIAG_H__
3224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
4224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#include <linux/types.h>
5224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
6224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Chengstruct packet_diag_req {
7224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u8	sdiag_family;
8224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u8	sdiag_protocol;
9224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u16	pad;
10224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdiag_ino;
11224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdiag_show;
12224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdiag_cookie[2];
13224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng};
14224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
15224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define PACKET_SHOW_INFO	0x00000001 /* Basic packet_sk information */
16224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define PACKET_SHOW_MCLIST	0x00000002 /* A set of packet_diag_mclist-s */
17224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define PACKET_SHOW_RING_CFG	0x00000004 /* Rings configuration parameters */
18224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define PACKET_SHOW_FANOUT	0x00000008
19224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define PACKET_SHOW_MEMINFO	0x00000010
20224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define PACKET_SHOW_FILTER	0x00000020
21224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
22224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Chengstruct packet_diag_msg {
23224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u8	pdiag_family;
24224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u8	pdiag_type;
25224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u16	pdiag_num;
26224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
27224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdiag_ino;
28224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdiag_cookie[2];
29224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng};
30224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
31224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Chengenum {
32e084501669a4e4931c9d648351ecd7d595b81b79Christopher Ferris	/* PACKET_DIAG_NONE, standard nl API requires this attribute!  */
33224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	PACKET_DIAG_INFO,
34224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	PACKET_DIAG_MCLIST,
35224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	PACKET_DIAG_RX_RING,
36224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	PACKET_DIAG_TX_RING,
37224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	PACKET_DIAG_FANOUT,
38224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	PACKET_DIAG_UID,
39224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	PACKET_DIAG_MEMINFO,
40224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	PACKET_DIAG_FILTER,
41224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
42224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__PACKET_DIAG_MAX,
43224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng};
44224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
45224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1)
46224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
47224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Chengstruct packet_diag_info {
48224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdi_index;
49224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdi_version;
50224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdi_reserve;
51224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdi_copy_thresh;
52224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdi_tstamp;
53224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdi_flags;
54224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
55224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define PDI_RUNNING	0x1
56224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define PDI_AUXDATA	0x2
57224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define PDI_ORIGDEV	0x4
58224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define PDI_VNETHDR	0x8
59224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define PDI_LOSS	0x10
60224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng};
61224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
62224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Chengstruct packet_diag_mclist {
63224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdmc_index;
64224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdmc_count;
65224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u16	pdmc_type;
66224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u16	pdmc_alen;
67224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u8	pdmc_addr[MAX_ADDR_LEN];
68224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng};
69224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
70224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Chengstruct packet_diag_ring {
71224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdr_block_size;
72224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdr_block_nr;
73224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdr_frame_size;
74224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdr_frame_nr;
75224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdr_retire_tmo;
76224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdr_sizeof_priv;
77224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	__u32	pdr_features;
78224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng};
79224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
80224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#endif
81