Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef __NETLINK_DIAG_H__
0003 #define __NETLINK_DIAG_H__
0004 
0005 #include <linux/types.h>
0006 
0007 struct netlink_diag_req {
0008     __u8    sdiag_family;
0009     __u8    sdiag_protocol;
0010     __u16   pad;
0011     __u32   ndiag_ino;
0012     __u32   ndiag_show;
0013     __u32   ndiag_cookie[2];
0014 };
0015 
0016 struct netlink_diag_msg {
0017     __u8    ndiag_family;
0018     __u8    ndiag_type;
0019     __u8    ndiag_protocol;
0020     __u8    ndiag_state;
0021 
0022     __u32   ndiag_portid;
0023     __u32   ndiag_dst_portid;
0024     __u32   ndiag_dst_group;
0025     __u32   ndiag_ino;
0026     __u32   ndiag_cookie[2];
0027 };
0028 
0029 struct netlink_diag_ring {
0030     __u32   ndr_block_size;
0031     __u32   ndr_block_nr;
0032     __u32   ndr_frame_size;
0033     __u32   ndr_frame_nr;
0034 };
0035 
0036 enum {
0037     /* NETLINK_DIAG_NONE, standard nl API requires this attribute!  */
0038     NETLINK_DIAG_MEMINFO,
0039     NETLINK_DIAG_GROUPS,
0040     NETLINK_DIAG_RX_RING,
0041     NETLINK_DIAG_TX_RING,
0042     NETLINK_DIAG_FLAGS,
0043 
0044     __NETLINK_DIAG_MAX,
0045 };
0046 
0047 #define NETLINK_DIAG_MAX (__NETLINK_DIAG_MAX - 1)
0048 
0049 #define NDIAG_PROTO_ALL     ((__u8) ~0)
0050 
0051 #define NDIAG_SHOW_MEMINFO  0x00000001 /* show memory info of a socket */
0052 #define NDIAG_SHOW_GROUPS   0x00000002 /* show groups of a netlink socket */
0053 #ifndef __KERNEL__
0054 /* deprecated since 4.6 */
0055 #define NDIAG_SHOW_RING_CFG 0x00000004 /* show ring configuration */
0056 #endif
0057 #define NDIAG_SHOW_FLAGS    0x00000008 /* show flags of a netlink socket */
0058 
0059 /* flags */
0060 #define NDIAG_FLAG_CB_RUNNING       0x00000001
0061 #define NDIAG_FLAG_PKTINFO      0x00000002
0062 #define NDIAG_FLAG_BROADCAST_ERROR  0x00000004
0063 #define NDIAG_FLAG_NO_ENOBUFS       0x00000008
0064 #define NDIAG_FLAG_LISTEN_ALL_NSID  0x00000010
0065 #define NDIAG_FLAG_CAP_ACK      0x00000020
0066 
0067 #endif