Blame view
include/linux/inet_diag.h
2.69 KB
73c1f4a03
|
1 2 |
#ifndef _INET_DIAG_H_ #define _INET_DIAG_H_ 1 |
1da177e4c
|
3 |
|
2df005b75
|
4 |
#include <linux/types.h> |
1da177e4c
|
5 6 |
/* Just some random number */ #define TCPDIAG_GETSOCK 18 |
540722ffc
|
7 |
#define DCCPDIAG_GETSOCK 19 |
1da177e4c
|
8 |
|
4f5736c4c
|
9 |
#define INET_DIAG_GETSOCK_MAX 24 |
1da177e4c
|
10 |
/* Socket identity */ |
73c1f4a03
|
11 |
struct inet_diag_sockid { |
9f8552996
|
12 13 14 15 |
__be16 idiag_sport; __be16 idiag_dport; __be32 idiag_src[4]; __be32 idiag_dst[4]; |
73c1f4a03
|
16 17 18 |
__u32 idiag_if; __u32 idiag_cookie[2]; #define INET_DIAG_NOCOOKIE (~0U) |
1da177e4c
|
19 20 21 |
}; /* Request structure */ |
73c1f4a03
|
22 23 24 25 26 |
struct inet_diag_req { __u8 idiag_family; /* Family of addresses. */ __u8 idiag_src_len; __u8 idiag_dst_len; __u8 idiag_ext; /* Query extended information */ |
1da177e4c
|
27 |
|
73c1f4a03
|
28 |
struct inet_diag_sockid id; |
1da177e4c
|
29 |
|
73c1f4a03
|
30 31 |
__u32 idiag_states; /* States to dump */ __u32 idiag_dbs; /* Tables to dump (NI) */ |
1da177e4c
|
32 |
}; |
73c1f4a03
|
33 34 35 |
enum { INET_DIAG_REQ_NONE, INET_DIAG_REQ_BYTECODE, |
1da177e4c
|
36 |
}; |
73c1f4a03
|
37 |
#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE |
1da177e4c
|
38 39 40 41 42 43 44 |
/* 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. */ |
73c1f4a03
|
45 |
struct inet_diag_bc_op { |
1da177e4c
|
46 47 48 49 |
unsigned char code; unsigned char yes; unsigned short no; }; |
73c1f4a03
|
50 51 52 53 54 55 56 57 58 59 |
enum { INET_DIAG_BC_NOP, INET_DIAG_BC_JMP, INET_DIAG_BC_S_GE, INET_DIAG_BC_S_LE, INET_DIAG_BC_D_GE, INET_DIAG_BC_D_LE, INET_DIAG_BC_AUTO, INET_DIAG_BC_S_COND, INET_DIAG_BC_D_COND, |
1da177e4c
|
60 |
}; |
73c1f4a03
|
61 |
struct inet_diag_hostcond { |
1da177e4c
|
62 63 64 |
__u8 family; __u8 prefix_len; int port; |
9f8552996
|
65 |
__be32 addr[0]; |
1da177e4c
|
66 67 68 69 |
}; /* Base info structure. It contains socket identity (addrs/ports/cookie) * and, alas, the information shown by netstat. */ |
73c1f4a03
|
70 71 72 73 74 75 76 77 78 79 80 81 82 |
struct inet_diag_msg { __u8 idiag_family; __u8 idiag_state; __u8 idiag_timer; __u8 idiag_retrans; struct inet_diag_sockid id; __u32 idiag_expires; __u32 idiag_rqueue; __u32 idiag_wqueue; __u32 idiag_uid; __u32 idiag_inode; |
1da177e4c
|
83 84 85 |
}; /* Extensions */ |
73c1f4a03
|
86 87 88 89 90 91 |
enum { INET_DIAG_NONE, INET_DIAG_MEMINFO, INET_DIAG_INFO, INET_DIAG_VEGASINFO, INET_DIAG_CONG, |
1da177e4c
|
92 |
}; |
73c1f4a03
|
93 |
#define INET_DIAG_MAX INET_DIAG_CONG |
1da177e4c
|
94 |
|
73c1f4a03
|
95 |
/* INET_DIAG_MEM */ |
1da177e4c
|
96 |
|
73c1f4a03
|
97 98 99 100 101 |
struct inet_diag_meminfo { __u32 idiag_rmem; __u32 idiag_wmem; __u32 idiag_fmem; __u32 idiag_tmem; |
1da177e4c
|
102 |
}; |
73c1f4a03
|
103 |
/* INET_DIAG_VEGASINFO */ |
1da177e4c
|
104 105 106 107 108 109 110 |
struct tcpvegas_info { __u32 tcpv_enabled; __u32 tcpv_rttcnt; __u32 tcpv_rtt; __u32 tcpv_minrtt; }; |
4f5736c4c
|
111 112 113 114 115 116 117 |
#ifdef __KERNEL__ struct sock; struct inet_hashinfo; struct inet_diag_handler { struct inet_hashinfo *idiag_hashinfo; void (*idiag_get_info)(struct sock *sk, |
73c1f4a03
|
118 |
struct inet_diag_msg *r, |
4f5736c4c
|
119 120 121 122 123 124 125 126 |
void *info); __u16 idiag_info_size; __u16 idiag_type; }; extern int inet_diag_register(const struct inet_diag_handler *handler); extern void inet_diag_unregister(const struct inet_diag_handler *handler); #endif /* __KERNEL__ */ |
73c1f4a03
|
127 |
#endif /* _INET_DIAG_H_ */ |