2 #define _INET_DIAG_H_ 1
4 #include <linux/types.h>
6 /* Just some random number */
7 #define TCPDIAG_GETSOCK 18
8 #define DCCPDIAG_GETSOCK 19
9 #define SOCK_DIAG_BY_FAMILY 20
11 #define INET_DIAG_GETSOCK_MAX 24
14 struct inet_diag_sockid {
20 __u32 idiag_cookie[2];
21 #define INET_DIAG_NOCOOKIE (~0U)
24 /* Request structure */
26 struct inet_diag_req_compat {
27 __u8 idiag_family; /* Family of addresses. */
30 __u8 idiag_ext; /* Query extended information */
32 struct inet_diag_sockid id;
34 __u32 idiag_states; /* States to dump */
35 __u32 idiag_dbs; /* Tables to dump (NI) */
38 struct inet_diag_req {
44 struct inet_diag_sockid id;
49 INET_DIAG_REQ_BYTECODE,
52 #define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
54 /* Bytecode is sequence of 4 byte commands followed by variable arguments.
55 * All the commands identified by "code" are conditional jumps forward:
56 * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
57 * length of the command and its arguments.
60 struct inet_diag_bc_op {
78 struct inet_diag_hostcond {
85 /* Base info structure. It contains socket identity (addrs/ports/cookie)
86 * and, alas, the information shown by netstat. */
87 struct inet_diag_msg {
93 struct inet_diag_sockid id;
114 #define INET_DIAG_MAX INET_DIAG_TCLASS
119 struct inet_diag_meminfo {
126 /* INET_DIAG_VEGASINFO */
128 struct tcpvegas_info {
137 struct inet_hashinfo;
140 struct inet_diag_handler {
141 struct inet_hashinfo *idiag_hashinfo;
142 void (*idiag_get_info)(struct sock *sk,
143 struct inet_diag_msg *r,
148 int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
149 int inet_diag_check_cookie(struct sock *sk, struct inet_diag_req *req);
151 extern int inet_diag_register(const struct inet_diag_handler *handler);
152 extern void inet_diag_unregister(const struct inet_diag_handler *handler);
153 #endif /* __KERNEL__ */
155 #endif /* _INET_DIAG_H_ */