]> git.proxmox.com Git - mirror_iproute2.git/blame - include/tcp_diag.h
(Logical change 1.3)
[mirror_iproute2.git] / include / tcp_diag.h
CommitLineData
aba5acdf
SH
1#ifndef _TCP_DIAG_H_
2#define _TCP_DIAG_H_ 1
3
4/* Replace with dymanically allocated value */
5#define NETLINK_TCPDIAG 4
6
7/* Just some random number */
8#define TCPDIAG_GETSOCK 18
9
10/* Socket identity */
11struct tcpdiag_sockid
12{
13 __u16 tcpdiag_sport;
14 __u16 tcpdiag_dport;
15 __u32 tcpdiag_src[4];
16 __u32 tcpdiag_dst[4];
17 __u32 tcpdiag_if;
18 __u32 tcpdiag_cookie[2];
19#define TCPDIAG_NOCOOKIE (~0U)
20};
21
22/* Request structure */
23
24struct tcpdiagreq
25{
26 __u8 tcpdiag_family; /* Family of addresses. */
27 __u8 tcpdiag_src_len;
28 __u8 tcpdiag_dst_len;
29 __u8 tcpdiag_ext; /* Query extended information */
30
31 struct tcpdiag_sockid id;
32
33 __u32 tcpdiag_states; /* States to dump */
34 __u32 tcpdiag_dbs; /* Tables to dump (NI) */
35};
36
37enum
38{
39 TCPDIAG_REQ_NONE,
40 TCPDIAG_REQ_BYTECODE,
41};
42
43#define TCPDIAG_REQ_MAX TCPDIAG_REQ_BYTECODE
44
45/* Bytecode is sequence of 4 byte commands followed by variable arguments.
46 * All the commands identified by "code" are conditional jumps forward:
47 * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
48 * length of the command and its arguments.
49 */
50
51struct tcpdiag_bc_op
52{
53 unsigned char code;
54 unsigned char yes;
55 unsigned short no;
56};
57
58enum
59{
60 TCPDIAG_BC_NOP,
61 TCPDIAG_BC_JMP,
62 TCPDIAG_BC_S_GE,
63 TCPDIAG_BC_S_LE,
64 TCPDIAG_BC_D_GE,
65 TCPDIAG_BC_D_LE,
66 TCPDIAG_BC_AUTO,
67 TCPDIAG_BC_S_COND,
68 TCPDIAG_BC_D_COND,
69};
70
71struct tcpdiag_hostcond
72{
73 __u8 family;
74 __u8 prefix_len;
75 int port;
76 __u32 addr[0];
77};
78
79/* Base info structure. It contains socket identity (addrs/ports/cookie)
80 * and, alas, the information shown by netstat. */
81struct tcpdiagmsg
82{
83 __u8 tcpdiag_family;
84 __u8 tcpdiag_state;
85 __u8 tcpdiag_timer;
86 __u8 tcpdiag_retrans;
87
88 struct tcpdiag_sockid id;
89
90 __u32 tcpdiag_expires;
91 __u32 tcpdiag_rqueue;
92 __u32 tcpdiag_wqueue;
93 __u32 tcpdiag_uid;
94 __u32 tcpdiag_inode;
95};
96
97/* Extensions */
98
99enum
100{
101 TCPDIAG_NONE,
102 TCPDIAG_MEMINFO,
103 TCPDIAG_INFO,
104};
105
106#define TCPDIAG_MAX TCPDIAG_INFO
107
108
109/* TCPDIAG_MEM */
110
111struct tcpdiag_meminfo
112{
113 __u32 tcpdiag_rmem;
114 __u32 tcpdiag_wmem;
115 __u32 tcpdiag_fmem;
116 __u32 tcpdiag_tmem;
117};
118
119#endif /* _TCP_DIAG_H_ */