]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - include/tcp_diag.h
(Logical change 1.3)
[mirror_iproute2.git] / include / tcp_diag.h
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..23014df3a4503ea9446cbecaa0366e984b14aab2 100644 (file)
@@ -0,0 +1,119 @@
+#ifndef _TCP_DIAG_H_
+#define _TCP_DIAG_H_ 1
+
+/* Replace with dymanically allocated value */
+#define NETLINK_TCPDIAG 4
+
+/* Just some random number */
+#define TCPDIAG_GETSOCK 18
+
+/* Socket identity */
+struct tcpdiag_sockid
+{
+       __u16   tcpdiag_sport;
+       __u16   tcpdiag_dport;
+       __u32   tcpdiag_src[4];
+       __u32   tcpdiag_dst[4];
+       __u32   tcpdiag_if;
+       __u32   tcpdiag_cookie[2];
+#define TCPDIAG_NOCOOKIE (~0U)
+};
+
+/* Request structure */
+
+struct tcpdiagreq
+{
+       __u8    tcpdiag_family;         /* Family of addresses. */
+       __u8    tcpdiag_src_len;
+       __u8    tcpdiag_dst_len;
+       __u8    tcpdiag_ext;            /* Query extended information */
+
+       struct tcpdiag_sockid id;
+
+       __u32   tcpdiag_states;         /* States to dump */
+       __u32   tcpdiag_dbs;            /* Tables to dump (NI) */
+};
+
+enum
+{
+       TCPDIAG_REQ_NONE,
+       TCPDIAG_REQ_BYTECODE,
+};
+
+#define TCPDIAG_REQ_MAX TCPDIAG_REQ_BYTECODE
+
+/* Bytecode is sequence of 4 byte commands followed by variable arguments.
+ * All the commands identified by "code" are conditional jumps forward:
+ * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
+ * length of the command and its arguments.
+ */
+struct tcpdiag_bc_op
+{
+       unsigned char   code;
+       unsigned char   yes;
+       unsigned short  no;
+};
+
+enum
+{
+       TCPDIAG_BC_NOP,
+       TCPDIAG_BC_JMP,
+       TCPDIAG_BC_S_GE,
+       TCPDIAG_BC_S_LE,
+       TCPDIAG_BC_D_GE,
+       TCPDIAG_BC_D_LE,
+       TCPDIAG_BC_AUTO,
+       TCPDIAG_BC_S_COND,
+       TCPDIAG_BC_D_COND,
+};
+
+struct tcpdiag_hostcond
+{
+       __u8    family;
+       __u8    prefix_len;
+       int     port;
+       __u32   addr[0];
+};
+
+/* Base info structure. It contains socket identity (addrs/ports/cookie)
+ * and, alas, the information shown by netstat. */
+struct tcpdiagmsg
+{
+       __u8    tcpdiag_family;
+       __u8    tcpdiag_state;
+       __u8    tcpdiag_timer;
+       __u8    tcpdiag_retrans;
+
+       struct tcpdiag_sockid id;
+
+       __u32   tcpdiag_expires;
+       __u32   tcpdiag_rqueue;
+       __u32   tcpdiag_wqueue;
+       __u32   tcpdiag_uid;
+       __u32   tcpdiag_inode;
+};
+
+/* Extensions */
+
+enum
+{
+       TCPDIAG_NONE,
+       TCPDIAG_MEMINFO,
+       TCPDIAG_INFO,
+};
+
+#define TCPDIAG_MAX TCPDIAG_INFO
+
+
+/* TCPDIAG_MEM */
+
+struct tcpdiag_meminfo
+{
+       __u32   tcpdiag_rmem;
+       __u32   tcpdiag_wmem;
+       __u32   tcpdiag_fmem;
+       __u32   tcpdiag_tmem;
+};
+
+#endif /* _TCP_DIAG_H_ */