aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_var.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/tcp_var.h')
-rw-r--r--sys/netinet/tcp_var.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 2f238814bbb8..d60ad9f50d3d 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -364,7 +364,7 @@ struct tcpcb {
* options in tcp_addoptions.
*/
struct tcpopt {
- u_int64_t to_flags; /* which options are present */
+ u_int32_t to_flags; /* which options are present */
#define TOF_MSS 0x0001 /* maximum segment size */
#define TOF_SCALE 0x0002 /* window scaling */
#define TOF_SACKPERM 0x0004 /* SACK permitted */
@@ -588,9 +588,6 @@ struct tcpstat {
uint64_t tcps_sig_err_sigopt; /* No signature expected by socket */
uint64_t tcps_sig_err_nosigopt; /* No signature provided by segment */
- /* Running connection count. */
- uint64_t tcps_states[TCP_NSTATES];
-
uint64_t _pad[12]; /* 6 UTO, 6 TBD */
};
@@ -609,9 +606,6 @@ VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */
#define TCPSTAT_ADD(name, val) \
VNET_PCPUSTAT_ADD(struct tcpstat, tcpstat, name, (val))
#define TCPSTAT_INC(name) TCPSTAT_ADD(name, 1)
-#define TCPSTAT_DEC(name) TCPSTAT_ADD(name, -1)
-#define TCPSTAT_FETCH(name) VNET_PCPUSTAT_FETCH(struct tcpstat, tcpstat, \
- name)
/*
* Kernel module consumers must use this accessor macro.
@@ -621,6 +615,13 @@ void kmod_tcpstat_inc(int statnum);
kmod_tcpstat_inc(offsetof(struct tcpstat, name) / sizeof(uint64_t))
/*
+ * Running TCP connection count by state.
+ */
+VNET_DECLARE(counter_u64_t, tcps_states[TCP_NSTATES]);
+#define TCPSTATES_INC(state) counter_u64_add(VNET(tcps_states)[state], 1)
+#define TCPSTATES_DEC(state) counter_u64_add(VNET(tcps_states)[state], -1)
+
+/*
* TCP specific helper hook point identifiers.
*/
#define HHOOK_TCP_EST_IN 0
@@ -678,6 +679,7 @@ struct xtcpcb {
#define TCPCTL_V6MSSDFLT 13 /* MSS default for IPv6 */
#define TCPCTL_SACK 14 /* Selective Acknowledgement,rfc 2018 */
#define TCPCTL_DROP 15 /* drop tcp connection */
+#define TCPCTL_STATES 16 /* connection counts by TCP state */
#ifdef _KERNEL
#ifdef SYSCTL_DECL