blob: 5c502fdf7a42cf28257cfd45e57d194e9611e120 [file] [log] [blame]
Greg Kroah-Hartman6f52b162017-11-01 15:08:43 +01001/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
Pavel Emelyanov22931d32011-12-15 02:44:35 +00002#ifndef __UNIX_DIAG_H__
3#define __UNIX_DIAG_H__
4
Pavel Emelyanov288461e2011-12-30 00:52:51 +00005#include <linux/types.h>
6
Pavel Emelyanov22931d32011-12-15 02:44:35 +00007struct unix_diag_req {
8 __u8 sdiag_family;
9 __u8 sdiag_protocol;
10 __u16 pad;
11 __u32 udiag_states;
12 __u32 udiag_ino;
13 __u32 udiag_show;
14 __u32 udiag_cookie[2];
15};
16
Pavel Emelyanovf5248b42011-12-15 02:45:24 +000017#define UDIAG_SHOW_NAME 0x00000001 /* show name (not path) */
Pavel Emelyanov5f7b0562011-12-15 02:45:43 +000018#define UDIAG_SHOW_VFS 0x00000002 /* show VFS inode info */
Pavel Emelyanovac02be82011-12-15 02:45:58 +000019#define UDIAG_SHOW_PEER 0x00000004 /* show peer socket info */
Pavel Emelyanov2aac7a22011-12-15 02:46:14 +000020#define UDIAG_SHOW_ICONS 0x00000008 /* show pending connections */
Pavel Emelyanovcbf39192011-12-15 02:46:31 +000021#define UDIAG_SHOW_RQLEN 0x00000010 /* show skb receive queue len */
Pavel Emelyanov257b5292011-12-30 09:27:43 +000022#define UDIAG_SHOW_MEMINFO 0x00000020 /* show memory info of a socket */
Pavel Emelyanovf5248b42011-12-15 02:45:24 +000023
Pavel Emelyanov22931d32011-12-15 02:44:35 +000024struct unix_diag_msg {
25 __u8 udiag_family;
26 __u8 udiag_type;
27 __u8 udiag_state;
28 __u8 pad;
29
30 __u32 udiag_ino;
31 __u32 udiag_cookie[2];
32};
33
Pavel Emelyanovf5248b42011-12-15 02:45:24 +000034enum {
Nicolas Dichtel31e20ba2013-11-28 18:31:05 +010035 /* UNIX_DIAG_NONE, standard nl API requires this attribute! */
Pavel Emelyanovf5248b42011-12-15 02:45:24 +000036 UNIX_DIAG_NAME,
Pavel Emelyanov5f7b0562011-12-15 02:45:43 +000037 UNIX_DIAG_VFS,
Pavel Emelyanovac02be82011-12-15 02:45:58 +000038 UNIX_DIAG_PEER,
Pavel Emelyanov2aac7a22011-12-15 02:46:14 +000039 UNIX_DIAG_ICONS,
Pavel Emelyanovcbf39192011-12-15 02:46:31 +000040 UNIX_DIAG_RQLEN,
Pavel Emelyanov257b5292011-12-30 09:27:43 +000041 UNIX_DIAG_MEMINFO,
Pavel Emelyanove4e541a2012-10-23 22:29:56 +040042 UNIX_DIAG_SHUTDOWN,
Pavel Emelyanovf5248b42011-12-15 02:45:24 +000043
Andrey Vaginae5fc982013-03-21 20:33:46 +040044 __UNIX_DIAG_MAX,
Pavel Emelyanovf5248b42011-12-15 02:45:24 +000045};
46
Andrey Vaginae5fc982013-03-21 20:33:46 +040047#define UNIX_DIAG_MAX (__UNIX_DIAG_MAX - 1)
48
Pavel Emelyanov5f7b0562011-12-15 02:45:43 +000049struct unix_diag_vfs {
50 __u32 udiag_vfs_ino;
51 __u32 udiag_vfs_dev;
52};
53
Pavel Emelyanovc9da99e2011-12-30 00:54:39 +000054struct unix_diag_rqlen {
55 __u32 udiag_rqueue;
56 __u32 udiag_wqueue;
57};
58
Pavel Emelyanov22931d32011-12-15 02:44:35 +000059#endif