aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/tcp_diag.h135
2 files changed, 64 insertions, 73 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 1c50fea8995b..d5e09bcd80f9 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -8,7 +8,7 @@
8#define NETLINK_W1 1 /* 1-wire subsystem */ 8#define NETLINK_W1 1 /* 1-wire subsystem */
9#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ 9#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
10#define NETLINK_FIREWALL 3 /* Firewalling hook */ 10#define NETLINK_FIREWALL 3 /* Firewalling hook */
11#define NETLINK_TCPDIAG 4 /* TCP socket monitoring */ 11#define NETLINK_INET_DIAG 4 /* INET socket monitoring */
12#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */ 12#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
13#define NETLINK_XFRM 6 /* ipsec */ 13#define NETLINK_XFRM 6 /* ipsec */
14#define NETLINK_SELINUX 7 /* SELinux event notifications */ 14#define NETLINK_SELINUX 7 /* SELinux event notifications */
diff --git a/include/linux/tcp_diag.h b/include/linux/tcp_diag.h
index 910c34ba19c0..a4606e5810e5 100644
--- a/include/linux/tcp_diag.h
+++ b/include/linux/tcp_diag.h
@@ -1,5 +1,5 @@
1#ifndef _TCP_DIAG_H_ 1#ifndef _INET_DIAG_H_
2#define _TCP_DIAG_H_ 1 2#define _INET_DIAG_H_ 1
3 3
4/* Just some random number */ 4/* Just some random number */
5#define TCPDIAG_GETSOCK 18 5#define TCPDIAG_GETSOCK 18
@@ -8,39 +8,36 @@
8#define INET_DIAG_GETSOCK_MAX 24 8#define INET_DIAG_GETSOCK_MAX 24
9 9
10/* Socket identity */ 10/* Socket identity */
11struct tcpdiag_sockid 11struct inet_diag_sockid {
12{ 12 __u16 idiag_sport;
13 __u16 tcpdiag_sport; 13 __u16 idiag_dport;
14 __u16 tcpdiag_dport; 14 __u32 idiag_src[4];
15 __u32 tcpdiag_src[4]; 15 __u32 idiag_dst[4];
16 __u32 tcpdiag_dst[4]; 16 __u32 idiag_if;
17 __u32 tcpdiag_if; 17 __u32 idiag_cookie[2];
18 __u32 tcpdiag_cookie[2]; 18#define INET_DIAG_NOCOOKIE (~0U)
19#define TCPDIAG_NOCOOKIE (~0U)
20}; 19};
21 20
22/* Request structure */ 21/* Request structure */
23 22
24struct tcpdiagreq 23struct inet_diag_req {
25{ 24 __u8 idiag_family; /* Family of addresses. */
26 __u8 tcpdiag_family; /* Family of addresses. */ 25 __u8 idiag_src_len;
27 __u8 tcpdiag_src_len; 26 __u8 idiag_dst_len;
28 __u8 tcpdiag_dst_len; 27 __u8 idiag_ext; /* Query extended information */
29 __u8 tcpdiag_ext; /* Query extended information */
30 28
31 struct tcpdiag_sockid id; 29 struct inet_diag_sockid id;
32 30
33 __u32 tcpdiag_states; /* States to dump */ 31 __u32 idiag_states; /* States to dump */
34 __u32 tcpdiag_dbs; /* Tables to dump (NI) */ 32 __u32 idiag_dbs; /* Tables to dump (NI) */
35}; 33};
36 34
37enum 35enum {
38{ 36 INET_DIAG_REQ_NONE,
39 TCPDIAG_REQ_NONE, 37 INET_DIAG_REQ_BYTECODE,
40 TCPDIAG_REQ_BYTECODE,
41}; 38};
42 39
43#define TCPDIAG_REQ_MAX TCPDIAG_REQ_BYTECODE 40#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
44 41
45/* Bytecode is sequence of 4 byte commands followed by variable arguments. 42/* Bytecode is sequence of 4 byte commands followed by variable arguments.
46 * All the commands identified by "code" are conditional jumps forward: 43 * All the commands identified by "code" are conditional jumps forward:
@@ -48,28 +45,25 @@ enum
48 * length of the command and its arguments. 45 * length of the command and its arguments.
49 */ 46 */
50 47
51struct tcpdiag_bc_op 48struct inet_diag_bc_op {
52{
53 unsigned char code; 49 unsigned char code;
54 unsigned char yes; 50 unsigned char yes;
55 unsigned short no; 51 unsigned short no;
56}; 52};
57 53
58enum 54enum {
59{ 55 INET_DIAG_BC_NOP,
60 TCPDIAG_BC_NOP, 56 INET_DIAG_BC_JMP,
61 TCPDIAG_BC_JMP, 57 INET_DIAG_BC_S_GE,
62 TCPDIAG_BC_S_GE, 58 INET_DIAG_BC_S_LE,
63 TCPDIAG_BC_S_LE, 59 INET_DIAG_BC_D_GE,
64 TCPDIAG_BC_D_GE, 60 INET_DIAG_BC_D_LE,
65 TCPDIAG_BC_D_LE, 61 INET_DIAG_BC_AUTO,
66 TCPDIAG_BC_AUTO, 62 INET_DIAG_BC_S_COND,
67 TCPDIAG_BC_S_COND, 63 INET_DIAG_BC_D_COND,
68 TCPDIAG_BC_D_COND,
69}; 64};
70 65
71struct tcpdiag_hostcond 66struct inet_diag_hostcond {
72{
73 __u8 family; 67 __u8 family;
74 __u8 prefix_len; 68 __u8 prefix_len;
75 int port; 69 int port;
@@ -78,47 +72,44 @@ struct tcpdiag_hostcond
78 72
79/* Base info structure. It contains socket identity (addrs/ports/cookie) 73/* Base info structure. It contains socket identity (addrs/ports/cookie)
80 * and, alas, the information shown by netstat. */ 74 * and, alas, the information shown by netstat. */
81struct tcpdiagmsg 75struct inet_diag_msg {
82{ 76 __u8 idiag_family;
83 __u8 tcpdiag_family; 77 __u8 idiag_state;
84 __u8 tcpdiag_state; 78 __u8 idiag_timer;
85 __u8 tcpdiag_timer; 79 __u8 idiag_retrans;
86 __u8 tcpdiag_retrans; 80
87 81 struct inet_diag_sockid id;
88 struct tcpdiag_sockid id; 82
89 83 __u32 idiag_expires;
90 __u32 tcpdiag_expires; 84 __u32 idiag_rqueue;
91 __u32 tcpdiag_rqueue; 85 __u32 idiag_wqueue;
92 __u32 tcpdiag_wqueue; 86 __u32 idiag_uid;
93 __u32 tcpdiag_uid; 87 __u32 idiag_inode;
94 __u32 tcpdiag_inode;
95}; 88};
96 89
97/* Extensions */ 90/* Extensions */
98 91
99enum 92enum {
100{ 93 INET_DIAG_NONE,
101 TCPDIAG_NONE, 94 INET_DIAG_MEMINFO,
102 TCPDIAG_MEMINFO, 95 INET_DIAG_INFO,
103 TCPDIAG_INFO, 96 INET_DIAG_VEGASINFO,
104 TCPDIAG_VEGASINFO, 97 INET_DIAG_CONG,
105 TCPDIAG_CONG,
106}; 98};
107 99
108#define TCPDIAG_MAX TCPDIAG_CONG 100#define INET_DIAG_MAX INET_DIAG_CONG
109 101
110 102
111/* TCPDIAG_MEM */ 103/* INET_DIAG_MEM */
112 104
113struct tcpdiag_meminfo 105struct inet_diag_meminfo {
114{ 106 __u32 idiag_rmem;
115 __u32 tcpdiag_rmem; 107 __u32 idiag_wmem;
116 __u32 tcpdiag_wmem; 108 __u32 idiag_fmem;
117 __u32 tcpdiag_fmem; 109 __u32 idiag_tmem;
118 __u32 tcpdiag_tmem;
119}; 110};
120 111
121/* TCPDIAG_VEGASINFO */ 112/* INET_DIAG_VEGASINFO */
122 113
123struct tcpvegas_info { 114struct tcpvegas_info {
124 __u32 tcpv_enabled; 115 __u32 tcpv_enabled;
@@ -134,7 +125,7 @@ struct inet_hashinfo;
134struct inet_diag_handler { 125struct inet_diag_handler {
135 struct inet_hashinfo *idiag_hashinfo; 126 struct inet_hashinfo *idiag_hashinfo;
136 void (*idiag_get_info)(struct sock *sk, 127 void (*idiag_get_info)(struct sock *sk,
137 struct tcpdiagmsg *r, 128 struct inet_diag_msg *r,
138 void *info); 129 void *info);
139 __u16 idiag_info_size; 130 __u16 idiag_info_size;
140 __u16 idiag_type; 131 __u16 idiag_type;
@@ -144,4 +135,4 @@ extern int inet_diag_register(const struct inet_diag_handler *handler);
144extern void inet_diag_unregister(const struct inet_diag_handler *handler); 135extern void inet_diag_unregister(const struct inet_diag_handler *handler);
145#endif /* __KERNEL__ */ 136#endif /* __KERNEL__ */
146 137
147#endif /* _TCP_DIAG_H_ */ 138#endif /* _INET_DIAG_H_ */