Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* AF_VSOCK sock_diag(7) interface for querying open sockets */
2
3#ifndef _UAPI__VM_SOCKETS_DIAG_H__
4#define _UAPI__VM_SOCKETS_DIAG_H__
5
6#include <linux/types.h>
7
8/* Request */
9struct vsock_diag_req {
10 __u8 sdiag_family; /* must be AF_VSOCK */
11 __u8 sdiag_protocol; /* must be 0 */
12 __u16 pad; /* must be 0 */
13 __u32 vdiag_states; /* query bitmap (e.g. 1 << TCP_LISTEN) */
14 __u32 vdiag_ino; /* must be 0 (reserved) */
15 __u32 vdiag_show; /* must be 0 (reserved) */
16 __u32 vdiag_cookie[2];
17};
18
19/* Response */
20struct vsock_diag_msg {
21 __u8 vdiag_family; /* AF_VSOCK */
22 __u8 vdiag_type; /* SOCK_STREAM or SOCK_DGRAM */
23 __u8 vdiag_state; /* sk_state (e.g. TCP_LISTEN) */
24 __u8 vdiag_shutdown; /* local RCV_SHUTDOWN | SEND_SHUTDOWN */
25 __u32 vdiag_src_cid;
26 __u32 vdiag_src_port;
27 __u32 vdiag_dst_cid;
28 __u32 vdiag_dst_port;
29 __u32 vdiag_ino;
30 __u32 vdiag_cookie[2];
31};
32
33#endif /* _UAPI__VM_SOCKETS_DIAG_H__ */