Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


inet_diag.h
001: #ifndef _INET_DIAG_H_
002: #define _INET_DIAG_H_ 1
003: 
004: #include <linux/types.h>
005: 
006: /* Just some random number */
007: #define TCPDIAG_GETSOCK 18
008: #define DCCPDIAG_GETSOCK 19
009: 
010: #define INET_DIAG_GETSOCK_MAX 24
011: 
012: /* Socket identity */
013: struct inet_diag_sockid {
014:         __be16  idiag_sport;
015:         __be16  idiag_dport;
016:         __be32  idiag_src[4];
017:         __be32  idiag_dst[4];
018:         __u32   idiag_if;
019:         __u32   idiag_cookie[2];
020: #define INET_DIAG_NOCOOKIE (~0U)
021: };
022: 
023: /* Request structure */
024: 
025: struct inet_diag_req {
026:         __u8    idiag_family;           /* Family of addresses. */
027:         __u8    idiag_src_len;
028:         __u8    idiag_dst_len;
029:         __u8    idiag_ext;              /* Query extended information */
030: 
031:         struct inet_diag_sockid id;
032: 
033:         __u32   idiag_states;           /* States to dump */
034:         __u32   idiag_dbs;              /* Tables to dump (NI) */
035: };
036: 
037: enum {
038:         INET_DIAG_REQ_NONE,
039:         INET_DIAG_REQ_BYTECODE,
040: };
041: 
042: #define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
043: 
044: /* Bytecode is sequence of 4 byte commands followed by variable arguments.
045:  * All the commands identified by "code" are conditional jumps forward:
046:  * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
047:  * length of the command and its arguments.
048:  */
049:  
050: struct inet_diag_bc_op {
051:         unsigned char   code;
052:         unsigned char   yes;
053:         unsigned short  no;
054: };
055: 
056: enum {
057:         INET_DIAG_BC_NOP,
058:         INET_DIAG_BC_JMP,
059:         INET_DIAG_BC_S_GE,
060:         INET_DIAG_BC_S_LE,
061:         INET_DIAG_BC_D_GE,
062:         INET_DIAG_BC_D_LE,
063:         INET_DIAG_BC_AUTO,
064:         INET_DIAG_BC_S_COND,
065:         INET_DIAG_BC_D_COND,
066: };
067: 
068: struct inet_diag_hostcond {
069:         __u8    family;
070:         __u8    prefix_len;
071:         int     port;
072:         __be32  addr[0];
073: };
074: 
075: /* Base info structure. It contains socket identity (addrs/ports/cookie)
076:  * and, alas, the information shown by netstat. */
077: struct inet_diag_msg {
078:         __u8    idiag_family;
079:         __u8    idiag_state;
080:         __u8    idiag_timer;
081:         __u8    idiag_retrans;
082: 
083:         struct inet_diag_sockid id;
084: 
085:         __u32   idiag_expires;
086:         __u32   idiag_rqueue;
087:         __u32   idiag_wqueue;
088:         __u32   idiag_uid;
089:         __u32   idiag_inode;
090: };
091: 
092: /* Extensions */
093: 
094: enum {
095:         INET_DIAG_NONE,
096:         INET_DIAG_MEMINFO,
097:         INET_DIAG_INFO,
098:         INET_DIAG_VEGASINFO,
099:         INET_DIAG_CONG,
100:         INET_DIAG_TOS,
101:         INET_DIAG_TCLASS,
102: };
103: 
104: #define INET_DIAG_MAX INET_DIAG_TCLASS
105: 
106: 
107: /* INET_DIAG_MEM */
108: 
109: struct inet_diag_meminfo {
110:         __u32   idiag_rmem;
111:         __u32   idiag_wmem;
112:         __u32   idiag_fmem;
113:         __u32   idiag_tmem;
114: };
115: 
116: /* INET_DIAG_VEGASINFO */
117: 
118: struct tcpvegas_info {
119:         __u32   tcpv_enabled;
120:         __u32   tcpv_rttcnt;
121:         __u32   tcpv_rtt;
122:         __u32   tcpv_minrtt;
123: };
124: 
125: 
126: #endif /* _INET_DIAG_H_ */
127: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/