xref: /linux/include/uapi/linux/unix_diag.h (revision 0898782247ae533d1f4e47a06bc5d4870931b284)
16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2607ca46eSDavid Howells #ifndef __UNIX_DIAG_H__
3607ca46eSDavid Howells #define __UNIX_DIAG_H__
4607ca46eSDavid Howells 
5607ca46eSDavid Howells #include <linux/types.h>
6607ca46eSDavid Howells 
7607ca46eSDavid Howells struct unix_diag_req {
8607ca46eSDavid Howells 	__u8	sdiag_family;
9607ca46eSDavid Howells 	__u8	sdiag_protocol;
10607ca46eSDavid Howells 	__u16	pad;
11607ca46eSDavid Howells 	__u32	udiag_states;
12607ca46eSDavid Howells 	__u32	udiag_ino;
13607ca46eSDavid Howells 	__u32	udiag_show;
14607ca46eSDavid Howells 	__u32	udiag_cookie[2];
15607ca46eSDavid Howells };
16607ca46eSDavid Howells 
17607ca46eSDavid Howells #define UDIAG_SHOW_NAME		0x00000001	/* show name (not path) */
18607ca46eSDavid Howells #define UDIAG_SHOW_VFS		0x00000002	/* show VFS inode info */
19607ca46eSDavid Howells #define UDIAG_SHOW_PEER		0x00000004	/* show peer socket info */
20607ca46eSDavid Howells #define UDIAG_SHOW_ICONS	0x00000008	/* show pending connections */
21607ca46eSDavid Howells #define UDIAG_SHOW_RQLEN	0x00000010	/* show skb receive queue len */
22607ca46eSDavid Howells #define UDIAG_SHOW_MEMINFO	0x00000020	/* show memory info of a socket */
23*cae9910eSFelipe Gasper #define UDIAG_SHOW_UID		0x00000040	/* show socket's UID */
24607ca46eSDavid Howells 
25607ca46eSDavid Howells struct unix_diag_msg {
26607ca46eSDavid Howells 	__u8	udiag_family;
27607ca46eSDavid Howells 	__u8	udiag_type;
28607ca46eSDavid Howells 	__u8	udiag_state;
29607ca46eSDavid Howells 	__u8	pad;
30607ca46eSDavid Howells 
31607ca46eSDavid Howells 	__u32	udiag_ino;
32607ca46eSDavid Howells 	__u32	udiag_cookie[2];
33607ca46eSDavid Howells };
34607ca46eSDavid Howells 
35607ca46eSDavid Howells enum {
3631e20badSNicolas Dichtel 	/* UNIX_DIAG_NONE, standard nl API requires this attribute!  */
37607ca46eSDavid Howells 	UNIX_DIAG_NAME,
38607ca46eSDavid Howells 	UNIX_DIAG_VFS,
39607ca46eSDavid Howells 	UNIX_DIAG_PEER,
40607ca46eSDavid Howells 	UNIX_DIAG_ICONS,
41607ca46eSDavid Howells 	UNIX_DIAG_RQLEN,
42607ca46eSDavid Howells 	UNIX_DIAG_MEMINFO,
43e4e541a8SPavel Emelyanov 	UNIX_DIAG_SHUTDOWN,
44*cae9910eSFelipe Gasper 	UNIX_DIAG_UID,
45607ca46eSDavid Howells 
46ae5fc987SAndrey Vagin 	__UNIX_DIAG_MAX,
47607ca46eSDavid Howells };
48607ca46eSDavid Howells 
49ae5fc987SAndrey Vagin #define UNIX_DIAG_MAX (__UNIX_DIAG_MAX - 1)
50ae5fc987SAndrey Vagin 
51607ca46eSDavid Howells struct unix_diag_vfs {
52607ca46eSDavid Howells 	__u32	udiag_vfs_ino;
53607ca46eSDavid Howells 	__u32	udiag_vfs_dev;
54607ca46eSDavid Howells };
55607ca46eSDavid Howells 
56607ca46eSDavid Howells struct unix_diag_rqlen {
57607ca46eSDavid Howells 	__u32	udiag_rqueue;
58607ca46eSDavid Howells 	__u32	udiag_wqueue;
59607ca46eSDavid Howells };
60607ca46eSDavid Howells 
61607ca46eSDavid Howells #endif
62