tcp_output.c (242b24828472137ec4411826b86e753d49bd2c39) | tcp_output.c (bd79708dbffde195226ade494aa72c345328e745) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 26 unchanged lines hidden (view full) --- 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_ipsec.h" 38#include "opt_tcpdebug.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/domain.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 26 unchanged lines hidden (view full) --- 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_ipsec.h" 38#include "opt_tcpdebug.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/domain.h> |
43#ifdef TCP_HHOOK |
|
43#include <sys/hhook.h> | 44#include <sys/hhook.h> |
45#endif |
|
44#include <sys/kernel.h> 45#include <sys/lock.h> 46#include <sys/mbuf.h> 47#include <sys/mutex.h> 48#include <sys/protosw.h> 49#include <sys/sdt.h> 50#include <sys/socket.h> 51#include <sys/socketvar.h> --- 83 unchanged lines hidden (view full) --- 135 * non-ACK. 136 */ 137#define TCP_XMIT_TIMER_ASSERT(tp, len, th_flags) \ 138 KASSERT(((len) == 0 && ((th_flags) & (TH_SYN | TH_FIN)) == 0) ||\ 139 tcp_timer_active((tp), TT_REXMT) || \ 140 tcp_timer_active((tp), TT_PERSIST), \ 141 ("neither rexmt nor persist timer is set")) 142 | 46#include <sys/kernel.h> 47#include <sys/lock.h> 48#include <sys/mbuf.h> 49#include <sys/mutex.h> 50#include <sys/protosw.h> 51#include <sys/sdt.h> 52#include <sys/socket.h> 53#include <sys/socketvar.h> --- 83 unchanged lines hidden (view full) --- 137 * non-ACK. 138 */ 139#define TCP_XMIT_TIMER_ASSERT(tp, len, th_flags) \ 140 KASSERT(((len) == 0 && ((th_flags) & (TH_SYN | TH_FIN)) == 0) ||\ 141 tcp_timer_active((tp), TT_REXMT) || \ 142 tcp_timer_active((tp), TT_PERSIST), \ 143 ("neither rexmt nor persist timer is set")) 144 |
145#ifdef TCP_HHOOK |
|
143static void inline hhook_run_tcp_est_out(struct tcpcb *tp, 144 struct tcphdr *th, struct tcpopt *to, 145 uint32_t len, int tso); | 146static void inline hhook_run_tcp_est_out(struct tcpcb *tp, 147 struct tcphdr *th, struct tcpopt *to, 148 uint32_t len, int tso); |
149#endif |
|
146static void inline cc_after_idle(struct tcpcb *tp); 147 | 150static void inline cc_after_idle(struct tcpcb *tp); 151 |
152#ifdef TCP_HHOOK |
|
148/* 149 * Wrapper for the TCP established output helper hook. 150 */ 151static void inline 152hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr *th, 153 struct tcpopt *to, uint32_t len, int tso) 154{ 155 struct tcp_hhook_data hhook_data; --- 4 unchanged lines hidden (view full) --- 160 hhook_data.to = to; 161 hhook_data.len = len; 162 hhook_data.tso = tso; 163 164 hhook_run_hooks(V_tcp_hhh[HHOOK_TCP_EST_OUT], &hhook_data, 165 tp->osd); 166 } 167} | 153/* 154 * Wrapper for the TCP established output helper hook. 155 */ 156static void inline 157hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr *th, 158 struct tcpopt *to, uint32_t len, int tso) 159{ 160 struct tcp_hhook_data hhook_data; --- 4 unchanged lines hidden (view full) --- 165 hhook_data.to = to; 166 hhook_data.len = len; 167 hhook_data.tso = tso; 168 169 hhook_run_hooks(V_tcp_hhh[HHOOK_TCP_EST_OUT], &hhook_data, 170 tp->osd); 171 } 172} |
173#endif |
|
168 169/* 170 * CC wrapper hook functions 171 */ 172static void inline 173cc_after_idle(struct tcpcb *tp) 174{ 175 INP_WLOCK_ASSERT(tp->t_inpcb); --- 1125 unchanged lines hidden (view full) --- 1301 ("%s: mbuf chain shorter than expected: %d + %u + %u - %u != %u", 1302 __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL))); 1303#else 1304 KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), 1305 ("%s: mbuf chain shorter than expected: %d + %u + %u != %u", 1306 __func__, len, hdrlen, ipoptlen, m_length(m, NULL))); 1307#endif 1308 | 174 175/* 176 * CC wrapper hook functions 177 */ 178static void inline 179cc_after_idle(struct tcpcb *tp) 180{ 181 INP_WLOCK_ASSERT(tp->t_inpcb); --- 1125 unchanged lines hidden (view full) --- 1307 ("%s: mbuf chain shorter than expected: %d + %u + %u - %u != %u", 1308 __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL))); 1309#else 1310 KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), 1311 ("%s: mbuf chain shorter than expected: %d + %u + %u != %u", 1312 __func__, len, hdrlen, ipoptlen, m_length(m, NULL))); 1313#endif 1314 |
1315#ifdef TCP_HHOOK |
|
1309 /* Run HHOOK_TCP_ESTABLISHED_OUT helper hooks. */ 1310 hhook_run_tcp_est_out(tp, th, &to, len, tso); | 1316 /* Run HHOOK_TCP_ESTABLISHED_OUT helper hooks. */ 1317 hhook_run_tcp_est_out(tp, th, &to, len, tso); |
1318#endif |
|
1311 1312#ifdef TCPDEBUG 1313 /* 1314 * Trace. 1315 */ 1316 if (so->so_options & SO_DEBUG) { 1317 u_short save = 0; 1318#ifdef INET6 --- 498 unchanged lines hidden --- | 1319 1320#ifdef TCPDEBUG 1321 /* 1322 * Trace. 1323 */ 1324 if (so->so_options & SO_DEBUG) { 1325 u_short save = 0; 1326#ifdef INET6 --- 498 unchanged lines hidden --- |