vm_sockets_diag.h 978 B

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