From: Stefan Hajnoczi <stefanha@redhat.com>
To: netdev@vger.kernel.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Jorgen Hansen <jhansen@vmware.com>,
Dexuan Cui <decui@microsoft.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [PATCH iproute2 2/3] include: add <linux/vm_sockets_diag.h>
Date: Tue, 3 Oct 2017 13:57:43 -0400 [thread overview]
Message-ID: <20171003175744.24987-3-stefanha@redhat.com> (raw)
In-Reply-To: <20171003175744.24987-1-stefanha@redhat.com>
This new Linux header file defines the sock_diag interface used by
AF_VSOCK.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
include/linux/vm_sockets_diag.h | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
create mode 100644 include/linux/vm_sockets_diag.h
diff --git a/include/linux/vm_sockets_diag.h b/include/linux/vm_sockets_diag.h
new file mode 100644
index 00000000..14cd7dc5
--- /dev/null
+++ b/include/linux/vm_sockets_diag.h
@@ -0,0 +1,33 @@
+/* AF_VSOCK sock_diag(7) interface for querying open sockets */
+
+#ifndef _UAPI__VM_SOCKETS_DIAG_H__
+#define _UAPI__VM_SOCKETS_DIAG_H__
+
+#include <linux/types.h>
+
+/* Request */
+struct vsock_diag_req {
+ __u8 sdiag_family; /* must be AF_VSOCK */
+ __u8 sdiag_protocol; /* must be 0 */
+ __u16 pad; /* must be 0 */
+ __u32 vdiag_states; /* query bitmap (e.g. 1 << TCP_LISTEN) */
+ __u32 vdiag_ino; /* must be 0 (reserved) */
+ __u32 vdiag_show; /* must be 0 (reserved) */
+ __u32 vdiag_cookie[2];
+};
+
+/* Response */
+struct vsock_diag_msg {
+ __u8 vdiag_family; /* AF_VSOCK */
+ __u8 vdiag_type; /* SOCK_STREAM or SOCK_DGRAM */
+ __u8 vdiag_state; /* sk_state (e.g. TCP_LISTEN) */
+ __u8 vdiag_shutdown; /* local RCV_SHUTDOWN | SEND_SHUTDOWN */
+ __u32 vdiag_src_cid;
+ __u32 vdiag_src_port;
+ __u32 vdiag_dst_cid;
+ __u32 vdiag_dst_port;
+ __u32 vdiag_ino;
+ __u32 vdiag_cookie[2];
+};
+
+#endif /* _UAPI__VM_SOCKETS_DIAG_H__ */
--
2.13.6
next prev parent reply other threads:[~2017-10-03 17:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-03 17:57 [PATCH iproute2 0/3] ss: add AF_VSOCK support Stefan Hajnoczi
2017-10-03 17:57 ` [PATCH iproute2 1/3] ss: allow AF_FAMILY constants >32 Stefan Hajnoczi
2017-10-03 18:26 ` Stephen Hemminger
2017-10-04 15:01 ` Stefan Hajnoczi
2017-10-04 15:03 ` David Laight
2017-10-04 15:14 ` Stephen Hemminger
2017-10-03 17:57 ` Stefan Hajnoczi [this message]
2017-10-03 18:24 ` [PATCH iproute2 2/3] include: add <linux/vm_sockets_diag.h> Stephen Hemminger
2017-10-04 15:03 ` Stefan Hajnoczi
2017-10-03 17:57 ` [PATCH iproute2 3/3] ss: add AF_VSOCK support Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171003175744.24987-3-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=decui@microsoft.com \
--cc=jhansen@vmware.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).