xref: /linux/include/uapi/linux/tcp_metrics.h (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /* tcp_metrics.h - TCP Metrics Interface */
3 
4 #ifndef _UAPI_LINUX_TCP_METRICS_H
5 #define _UAPI_LINUX_TCP_METRICS_H
6 
7 #include <linux/types.h>
8 
9 /* NETLINK_GENERIC related info
10  */
11 #define TCP_METRICS_GENL_NAME		"tcp_metrics"
12 #define TCP_METRICS_GENL_VERSION	0x1
13 
14 enum tcp_metric_index {
15 	TCP_METRIC_RTT,		/* in ms units */
16 	TCP_METRIC_RTTVAR,	/* in ms units */
17 	TCP_METRIC_SSTHRESH,
18 	TCP_METRIC_CWND,
19 	TCP_METRIC_REORDERING,
20 
21 	TCP_METRIC_RTT_US,	/* in usec units */
22 	TCP_METRIC_RTTVAR_US,	/* in usec units */
23 
24 	/* Always last.  */
25 	__TCP_METRIC_MAX,
26 };
27 
28 #define TCP_METRIC_MAX	(__TCP_METRIC_MAX - 1)
29 
30 /* Re-define enum tcp_metric_index, again, using the values carried
31  * as netlink attribute types.
32  */
33 enum {
34 	TCP_METRICS_A_METRICS_RTT = 1,
35 	TCP_METRICS_A_METRICS_RTTVAR,
36 	TCP_METRICS_A_METRICS_SSTHRESH,
37 	TCP_METRICS_A_METRICS_CWND,
38 	TCP_METRICS_A_METRICS_REODERING,
39 	TCP_METRICS_A_METRICS_RTT_US,
40 	TCP_METRICS_A_METRICS_RTTVAR_US,
41 
42 	__TCP_METRICS_A_METRICS_MAX
43 };
44 #define TCP_METRICS_A_METRICS_MAX (__TCP_METRICS_A_METRICS_MAX - 1)
45 
46 enum {
47 	TCP_METRICS_ATTR_UNSPEC,
48 	TCP_METRICS_ATTR_ADDR_IPV4,		/* u32 */
49 	TCP_METRICS_ATTR_ADDR_IPV6,		/* binary */
50 	TCP_METRICS_ATTR_AGE,			/* msecs */
51 	TCP_METRICS_ATTR_TW_TSVAL,		/* u32, raw, rcv tsval */
52 	TCP_METRICS_ATTR_TW_TS_STAMP,		/* s32, sec age */
53 	TCP_METRICS_ATTR_VALS,			/* nested +1, u32 */
54 	TCP_METRICS_ATTR_FOPEN_MSS,		/* u16 */
55 	TCP_METRICS_ATTR_FOPEN_SYN_DROPS,	/* u16, count of drops */
56 	TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS,	/* msecs age */
57 	TCP_METRICS_ATTR_FOPEN_COOKIE,		/* binary */
58 	TCP_METRICS_ATTR_SADDR_IPV4,		/* u32 */
59 	TCP_METRICS_ATTR_SADDR_IPV6,		/* binary */
60 	TCP_METRICS_ATTR_PAD,
61 
62 	__TCP_METRICS_ATTR_MAX,
63 };
64 
65 #define TCP_METRICS_ATTR_MAX	(__TCP_METRICS_ATTR_MAX - 1)
66 
67 enum {
68 	TCP_METRICS_CMD_UNSPEC,
69 	TCP_METRICS_CMD_GET,
70 	TCP_METRICS_CMD_DEL,
71 
72 	__TCP_METRICS_CMD_MAX,
73 };
74 
75 #define TCP_METRICS_CMD_MAX	(__TCP_METRICS_CMD_MAX - 1)
76 
77 #endif /* _UAPI_LINUX_TCP_METRICS_H */
78