tcp_var.h revision d2ccf0a73e90713adb9e409b073c4af60325ad73
5539N/A * Copyright (c) 1982, 1986, 1993, 1994 0N/A * The Regents of the University of California. All rights reserved. 0N/A * Redistribution and use in source and binary forms, with or without 0N/A * modification, are permitted provided that the following conditions 0N/A * 1. Redistributions of source code must retain the above copyright 2362N/A * notice, this list of conditions and the following disclaimer. 0N/A * 2. Redistributions in binary form must reproduce the above copyright 0N/A * notice, this list of conditions and the following disclaimer in the 0N/A * documentation and/or other materials provided with the distribution. 0N/A * 3. All advertising materials mentioning features or use of this software 0N/A * must display the following acknowledgement: 0N/A * This product includes software developed by the University of 0N/A * California, Berkeley and its contributors. 0N/A * 4. Neither the name of the University nor the names of its contributors 0N/A * may be used to endorse or promote products derived from this software 0N/A * without specific prior written permission. 2362N/A * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2362N/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2362N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 0N/A * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 0N/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 0N/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 0N/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 0N/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 0N/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 0N/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 0N/A#
endif /* VBOX_WITH_BSD_REASS */ 0N/A#
else /* !VBOX_WITH_BSD_REASS */ 0N/A#
endif /* !VBOX_WITH_BSD_REASS */ 0N/A/* TCP segment queue entry */ 0N/A * Tcp control block, one per tcp; fields: 0N/A#
else /* VBOX_WITH_BSD_REASS */ 0N/A#
endif /* VBOX_WITH_BSD_REASS */ 0N/A /* Make it static for now */ 0N/A/* struct tcpiphdr *t_template; / * skeletal packet for transmit */ 0N/A * The following fields are used as in the protocol specification. 0N/A * See RFC783, Dec. 1981, page 21. 0N/A/* send sequence variables */ 0N/A/* receive sequence variables */ 0N/A * Additional variables for this implementation. 0N/A/* receive variables */ 0N/A/* retransmit variables */ 0N/A * used to recognize retransmits 0N/A/* congestion control (for slow start, source quench, retransmit after loss) */ 0N/A * for slow start exponential to 5539N/A * transmit timing stuff. See below for scale of srtt and rttvar. 0N/A * "Variance" is actually smoothed difference. 0N/A/* out-of-band data */ 0N/A/* RFC 1323 variables */ 0N/A#
endif /* VBOX_WITH_BSD_REASS */ 0N/A * The smoothed round-trip time and estimated variance 0N/A * are stored as fixed point numbers scaled by the values below. 0N/A * For convenience, these scales are also used in smoothing the average 0N/A * (smoothed = (1/scale)sample + ((scale-1)/scale)smoothed). 0N/A * With these scales, srtt has 3 bits to the right of the binary point, 0N/A * and thus an "ALPHA" of 0.875. rttvar has 2 bits to the right of the 0N/A * binary point, and is smoothed with an ALPHA of 0.75. 0N/A * The initial retransmission should happen at rtt + 4 * rttvar. 0N/A * Because of the way we do the smoothing, srtt and rttvar 0N/A * will each average +1/2 tick of bias. When we compute 0N/A * the retransmit timer, we want 1/2 tick of rounding and 0N/A * 1 extra tick because of +-1/2 tick uncertainty in the 0N/A * firing of the timer. The bias will give us exactly the 0N/A * 1.5 tick we need. But, because the bias is 0N/A * statistical, we have to test that we don't drop below 0N/A * the minimum feasible timer (which is 2 ticks). 0N/A * This macro assumes that the value of TCP_RTTVAR_SCALE 0N/A * is the same as the multiplier for rttvar. 0N/A * We want to avoid doing m_pullup on incoming packets but that 0N/A * means avoiding dtom on the tcp reassembly code. That in turn means 0N/A * keeping an mbuf pointer in the reassembly queue (since we might 0N/A * have a cluster). As a quick hack, the source & destination 0N/A * port numbers (which are no longer needed once we've located the 0N/A * tcpcb) are overlayed with an mbuf pointer. 0N/A/* VBox change which is too much bother to #ifdef */ 0N/A/* VBox change which is too much bother to #ifdef */ 0N/A * Many of these should be kept per connection, 0N/A * but that's inconvenient at the moment. 0N/A/* u_long tcps_rcvshort; */ /* packets received too short */ 0N/A/* u_long tcps_pawsdrop; */ /* segments dropped due to PAWS */ 0N/A#
endif /* VBOX_WITH_BSD_REASS */