Christopher Ferris | 2598113 | 2017-11-14 16:53:49 -0800 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
Ben Cheng | 224b54f | 2013-10-15 18:26:18 -0700 | [diff] [blame] | 2 | #ifndef __NETLINK_DIAG_H__ |
| 3 | #define __NETLINK_DIAG_H__ |
| 4 | |
| 5 | #include <linux/types.h> |
| 6 | |
| 7 | struct netlink_diag_req { |
| 8 | __u8 sdiag_family; |
| 9 | __u8 sdiag_protocol; |
| 10 | __u16 pad; |
| 11 | __u32 ndiag_ino; |
| 12 | __u32 ndiag_show; |
| 13 | __u32 ndiag_cookie[2]; |
| 14 | }; |
| 15 | |
| 16 | struct netlink_diag_msg { |
| 17 | __u8 ndiag_family; |
| 18 | __u8 ndiag_type; |
| 19 | __u8 ndiag_protocol; |
| 20 | __u8 ndiag_state; |
| 21 | |
| 22 | __u32 ndiag_portid; |
| 23 | __u32 ndiag_dst_portid; |
| 24 | __u32 ndiag_dst_group; |
| 25 | __u32 ndiag_ino; |
| 26 | __u32 ndiag_cookie[2]; |
| 27 | }; |
| 28 | |
| 29 | struct netlink_diag_ring { |
| 30 | __u32 ndr_block_size; |
| 31 | __u32 ndr_block_nr; |
| 32 | __u32 ndr_frame_size; |
| 33 | __u32 ndr_frame_nr; |
| 34 | }; |
| 35 | |
| 36 | enum { |
Christopher Ferris | e084501 | 2014-07-09 14:58:51 -0700 | [diff] [blame] | 37 | /* NETLINK_DIAG_NONE, standard nl API requires this attribute! */ |
Ben Cheng | 224b54f | 2013-10-15 18:26:18 -0700 | [diff] [blame] | 38 | NETLINK_DIAG_MEMINFO, |
| 39 | NETLINK_DIAG_GROUPS, |
| 40 | NETLINK_DIAG_RX_RING, |
| 41 | NETLINK_DIAG_TX_RING, |
Christopher Ferris | 0543f74 | 2017-07-26 13:09:46 -0700 | [diff] [blame] | 42 | NETLINK_DIAG_FLAGS, |
Ben Cheng | 224b54f | 2013-10-15 18:26:18 -0700 | [diff] [blame] | 43 | |
| 44 | __NETLINK_DIAG_MAX, |
| 45 | }; |
| 46 | |
| 47 | #define NETLINK_DIAG_MAX (__NETLINK_DIAG_MAX - 1) |
| 48 | |
| 49 | #define NDIAG_PROTO_ALL ((__u8) ~0) |
| 50 | |
| 51 | #define NDIAG_SHOW_MEMINFO 0x00000001 /* show memory info of a socket */ |
| 52 | #define NDIAG_SHOW_GROUPS 0x00000002 /* show groups of a netlink socket */ |
Christopher Ferris | ccfaccd | 2016-08-24 12:11:31 -0700 | [diff] [blame] | 53 | #ifndef __KERNEL__ |
Christopher Ferris | 6e3550f | 2016-12-12 14:51:18 -0800 | [diff] [blame] | 54 | /* deprecated since 4.6 */ |
Ben Cheng | 224b54f | 2013-10-15 18:26:18 -0700 | [diff] [blame] | 55 | #define NDIAG_SHOW_RING_CFG 0x00000004 /* show ring configuration */ |
Christopher Ferris | ccfaccd | 2016-08-24 12:11:31 -0700 | [diff] [blame] | 56 | #endif |
Christopher Ferris | 0543f74 | 2017-07-26 13:09:46 -0700 | [diff] [blame] | 57 | #define NDIAG_SHOW_FLAGS 0x00000008 /* show flags of a netlink socket */ |
| 58 | |
| 59 | /* flags */ |
| 60 | #define NDIAG_FLAG_CB_RUNNING 0x00000001 |
| 61 | #define NDIAG_FLAG_PKTINFO 0x00000002 |
| 62 | #define NDIAG_FLAG_BROADCAST_ERROR 0x00000004 |
| 63 | #define NDIAG_FLAG_NO_ENOBUFS 0x00000008 |
| 64 | #define NDIAG_FLAG_LISTEN_ALL_NSID 0x00000010 |
| 65 | #define NDIAG_FLAG_CAP_ACK 0x00000020 |
Ben Cheng | 224b54f | 2013-10-15 18:26:18 -0700 | [diff] [blame] | 66 | |
| 67 | #endif |