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