Lines Matching defs:to

23  * contract to Juniper Networks, Inc.
34 * may be used to endorse or promote products derived from this software
136 "Log all incoming TCP segments to closed ports");
142 "Do not send RST on segments to closed ports");
153 "Delay ACK to try and piggyback it onto a data packet");
193 "Cap the max cwnd increment during slow-start to this number of segments");
252 tcp_is_sack_recovery(struct tcpcb *tp, struct tcpopt *to)
255 ((to->to_flags & TOF_SACK) ||
264 hhook_run_tcp_est_in(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to)
271 hhook_data.to = to;
320 * to deal with chained VOIs.
344 /* XXXLAS: Find a way to live without this */
384 * buffer limit on the path. Use this to set
386 * threshold to no less than 2*mss.
395 * If a SYN or SYN/ACK was lost and retransmitted, we have to
396 * reduce the initial CWND to one segment as congestion is likely
397 * requiring us to be cautious.
428 * Allow ECN reaction on ACK to CWR, if
501 * - Our last ack wasn't a 0-sized window. We never want to delay
579 * draft-itojun-ipv6-tcp-to-anycast
580 * better place to put this in?
632 struct tcpopt to; /* options in this segment */
644 to.to_flags = 0;
671 * As we use all-zero to indicate unbounded/unconnected pcb,
672 * unspecified IPv6 address can be used to confuse us.
802 * Convert TCP protocol specific fields to host format.
812 * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain.
843 * Transparently forwarded. Pretend to be the destination.
851 * It's new. Try to find the ambushing socket.
875 * Transparently forwarded. Pretend to be the destination.
883 * It's new. Try to find the ambushing socket.
910 * Log communication attempts to ports that are not
917 "to closed port\n", s, __func__);
991 * A previous connection in TIMEWAIT state is supposed to catch
994 * removed and we can try again to find a listening socket.
996 tcp_dooptions(&to, optp, optlen,
1001 if (tcp_twcheck(inp, &to, th, m, tlen))
1064 * socket appended to the listen queue in SYN_RECEIVED state.
1069 * syncookies need access to the reflected
1072 tcp_dooptions(&to, optp, optlen, 0);
1076 rstreason = syncache_expand(&inc, &to, th, &so, m, port);
1082 * to the sender.
1093 * don't want to sent RST for the second ACK,
1095 * match, hoping to find the new socket. If
1113 * either due to memory shortage,
1122 "Socket allocation failed due to "
1137 * If we came here via jump to tfo_socket_result,
1164 * Check with syncache and remove entry to prevent
1222 * The data pointed to by TH_URG and th_urp is ignored.
1232 * we do not accept SYN to deprecated interface
1233 * address to prevent any new inbound connection from
1238 * to send a RST, and RST will be the final packet
1246 * communication is okay - "SHOULD continue to be
1268 "Connection attempt to deprecated "
1279 * broadcast according to RFC1122 4.2.3.10, p. 104.
1283 * Note that it is quite possible to receive unicast
1285 * in_broadcast() to find them.
1300 "Connection attempt to/from self "
1308 "Connection attempt from/to multicast "
1323 "Connection attempt from/to self "
1333 "Connection attempt from/to broad- "
1341 * SYN appears to be valid. Create compressed TCP state
1345 tcp_dooptions(&to, optp, optlen, TO_SYN);
1346 if ((so = syncache_add(&inc, &to, th, inp, so, m, NULL, NULL,
1351 * Entry added to syncache and mbuf consumed.
1367 tcp_dooptions(&to, optp, optlen, thflags);
1368 if ((to.to_flags & TOF_SIGNATURE) == 0) {
1373 TCPMD5_INPUT(m, th, to.to_signature) != 0)
1380 * Segment belongs to a connection in SYN_SENT, ESTABLISHED or later
1385 * TCP stacks won't need to modify the PCB, they would either drop
1387 * to upgrade the lock, because calling convention for stacks is
1436 * buffer size is not optimally adjusted to the actual network
1442 * used to any significant extent. This allows us to be much
1444 * the case that the buffer space is actually used to a large
1452 * The criteria to step up the receive buffer one notch are:
1460 * by a 1/2 (bounded by the max). This allows us to keep ahead
1470 * the buffer to better manage the socket buffer resources.
1533 struct tcpopt to;
1581 * validation to ignore broken/spoofed segs.
1611 tcp_dooptions(&to, (u_char *)(th + 1),
1618 * can subject us to an attack.
1620 to.to_flags &= ~TOF_SACK;
1624 (to.to_flags & TOF_SIGNATURE) == 0) {
1631 * fall back to non RFC1323 RTT calculation. Normalize
1635 if ((to.to_flags & TOF_TS) && (to.to_tsecr != 0)) {
1636 to.to_tsecr -= tp->ts_offset;
1637 if (TSTMP_GT(to.to_tsecr, tcp_ts_getticks())) {
1638 to.to_tsecr = 0;
1642 TSTMP_LT(to.to_tsecr, tp->t_badrxtwin)) {
1649 * According to RFC1323 the window field in a SYN (i.e., a <SYN>
1651 * XXX this is traditional behavior, may need to be cleaned up.
1656 if ((to.to_flags & TOF_SCALE) &&
1660 tp->snd_scale = to.to_wscale;
1666 * the next incoming segment to the scaled value.
1669 if ((to.to_flags & TOF_TS) &&
1673 tp->ts_recent = to.to_tsval;
1678 if (to.to_flags & TOF_MSS) {
1679 tcp_mss(tp, to.to_mss);
1682 (!(to.to_flags & TOF_SACKPERM) ||
1687 if ((to.to_flags & TOF_FASTOPEN) &&
1691 if (to.to_flags & TOF_MSS) {
1692 mss = to.to_mss;
1701 to.to_tfo_len, to.to_tfo_cookie);
1715 if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) {
1738 if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) {
1757 * (the reassembly queue is empty), add the data to
1770 ((to.to_flags & TOF_TS) == 0 ||
1771 TSTMP_GEQ(to.to_tsval, tp->ts_recent)) ) {
1775 * NOTE that the test is modified according to the latest
1778 if ((to.to_flags & TOF_TS) != 0 &&
1781 tp->ts_recent = to.to_tsval;
1788 (to.to_flags & TOF_SACK) == 0 &&
1798 if ((to.to_flags & TOF_TS) == 0 &&
1814 if ((to.to_flags & TOF_TS) != 0 &&
1815 to.to_tsecr) {
1818 t = tcp_ts_getticks() - to.to_tsecr;
1835 hhook_run_tcp_est_in(tp, th, &to);
1855 * Pull snd_wl2 up to prevent seq wrap relative
1856 * to th_ack.
1868 * are ready to send, let tcp_output
1890 * is new data available to be sent
1891 * or we need to send an ACK.
1907 * buffer space to take it.
1924 * Pull snd_wl1 up to prevent seq wrap relative to
1929 * Pull rcv_up up to prevent seq wrap relative to
1939 /* Add data to socket buffer. */
2029 * if SYN has been acked change to ESTABLISHED else SYN_RCVD state
2030 * arrange for segment to be acked (eventually)
2121 * Advance th->th_seq to correspond to first data byte.
2122 * If data, trim to stay within window,
2138 * If the remote host used T/TCP to validate the SYN,
2155 * to fall though and be processed (which gives forged reset
2171 * Note: to take into account delayed ACKs, we should
2244 if ((to.to_flags & TOF_TS) != 0 && tp->ts_recent &&
2245 TSTMP_LT(to.to_tsval, tp->ts_recent)) {
2246 /* Check to see if ts_recent is over 24 days old. */
2252 * ts_recent to zero will at least satisfy the
2256 * because we don't want out-of-order segments to be
2271 * In the SYN-RECEIVED state, validate that the packet belongs to
2272 * this connection before trimming the data to fit the receive
2300 * Any valid FIN must be to the left of the window.
2307 * Send an ACK to resynchronize and drop any data.
2375 * window edge, and have to drop data and PUSH from
2377 * remember to ack. Otherwise, drop segment
2401 * 3) That we modify the segment boundary check to be
2405 * This modified check allows us to overcome RFC1323's
2410 if ((to.to_flags & TOF_TS) != 0 &&
2415 tp->ts_recent = to.to_tsval;
2457 * to be set is a simultaneous open, a SYN_RECEIVED
2499 * Account for the ACK of our SYN prior to
2507 * later; if not, do so now to pass queued data to user.
2521 * then advance tp->snd_una to th->th_ack and drop
2523 * more up to date window information we update our window information.
2535 if (tcp_is_sack_recovery(tp, &to)) {
2536 sack_changed = tcp_sack_doack(tp, &to, th->th_ack);
2550 hhook_run_tcp_est_in(tp, th, &to);
2561 * duplicate and it needs to be processed
2586 * (set ssthresh to half the current window
2587 * and pull our congestion window back to
2593 * to keep a constant cwnd packets in the
2609 (tcp_is_sack_recovery(tp, &to) &&
2621 tcp_do_prr_ack(tp, th, &to,
2623 } else if (tcp_is_sack_recovery(tp, &to) &&
2668 * to see if we're already in sack
2670 * check to see if we're in newreno
2697 if (tcp_is_sack_recovery(tp, &to)) {
2713 if (tcp_is_sack_recovery(tp, &to)) {
2764 * is new data available to be sent
2765 * or we need to send an ACK.
2801 * sack_changed tracks all changes to the SACK
2807 if (tcp_is_sack_recovery(tp, &to) &&
2825 * If the congestion window was inflated to account
2832 (to.to_flags & TOF_SACK)) {
2836 tcp_do_prr_ack(tp, th, &to,
2856 tcp_do_prr_ack(tp, th, &to, SACK_CHANGE,
2869 * synchronized). Go to non-starred state,
2905 * to do the retransmit in the first place. Recover our
2906 * original cwnd and ssthresh, and proceed to transmit where
2912 to.to_flags & TOF_TS &&
2913 to.to_tsecr != 0 &&
2914 TSTMP_LT(to.to_tsecr, tp->t_badrxtwin))
2931 if ((to.to_flags & TOF_TS) != 0 && to.to_tsecr) {
2934 t = tcp_ts_getticks() - to.to_tsecr;
2960 * timer and remember to restart (more output or persist).
2961 * If there is more data to be acked, restart retransmit
3024 * In FIN_WAIT_1 STATE in addition to the processing
3033 * Starting the timer is contrary to the
3050 * In CLOSING STATE in addition to the processing for
3064 * In LAST_ACK, we may still be waiting for data to drain
3065 * and/or to be acked, as well as for the ack of our FIN.
3109 * soreceive. It's hard to imagine someone
3110 * actually wanting to send this much urgent data.
3126 * According to RFC961 (Assigned Protocols),
3127 * the urgent pointer points to the last octet
3129 * to consider it to indicate the first octet
3144 * Remove out of band data so doesn't get presented to user.
3170 * is presented to the user (this happens in tcp_usrreq.c,
3184 * with control block tp. Set thflags to whether reassembly now
3186 * inline (segment is the next to be received on an established
3223 * XXX: Due to the header drop above "th" is
3270 * our window, in order to estimate the sender's
3388 * paths to this code happen after packets containing
3432 * Issue RST and make ACK acceptable to originator of segment.
3502 tcp_dooptions(struct tcpopt *to, u_char *cp, int cnt, int flags)
3506 to->to_flags = 0;
3526 to->to_flags |= TOF_MSS;
3528 (char *)&to->to_mss, sizeof(to->to_mss));
3529 to->to_mss = ntohs(to->to_mss);
3536 to->to_flags |= TOF_SCALE;
3537 to->to_wscale = min(cp[2], TCP_MAX_WINSHIFT);
3542 to->to_flags |= TOF_TS;
3544 (char *)&to->to_tsval, sizeof(to->to_tsval));
3545 to->to_tsval = ntohl(to->to_tsval);
3547 (char *)&to->to_tsecr, sizeof(to->to_tsecr));
3548 to->to_tsecr = ntohl(to->to_tsecr);
3552 * In order to reply to a host which has set the
3554 * to record the fact that the option was observed
3555 * here for the syncache code to perform the correct
3560 to->to_flags |= TOF_SIGNATURE;
3561 to->to_signature = cp + 2;
3570 to->to_flags |= TOF_SACKPERM;
3577 to->to_flags |= TOF_SACK;
3578 to->to_nsacks = (optlen - 2) / TCPOLEN_SACK;
3579 to->to_sacks = cp + 2;
3593 to->to_flags |= TOF_FASTOPEN;
3594 to->to_tfo_len = optlen - 2;
3595 to->to_tfo_cookie = to->to_tfo_len ? cp + 2 : NULL;
3660 * is equivalent to the smoothing algorithm in rfc793 with
3662 * point). Adjust rtt to origin 0.
3673 * timer to smoothed rtt + 4 times the smoothed variance.
3676 * equivalent to rfc793 smoothing with an alpha of .75
3688 * Set the variance to half the rtt (so our first
3705 * statistical, we have to test that we don't drop below
3713 * it is probably safe to discard any error indications we've
3725 * without forcing IP to fragment. If no route is found, route has no mtu,
3730 * window to be a single segment if the destination isn't local.
3786 * No route to sender, stay with default mss and return.
3790 * In case we return early we need to initialize metrics
3791 * to a defined state as tcp_hc_get() would do for us
3805 * already assigned to t_maxseg above.
3819 * to at least minmss.
3861 * other end's MSS, we are supposed to use a conservative
3870 * SYN with options and data to a host we've never talked
3871 * to before. Then, they will reply with an MSS value which
3880 * enough to allow some data on segments even if the
3892 * SACK's since we are subject to attack in such a
3920 * If there's a pipesize, change the socket buffer to that size,
3944 * enough to allow some data on segments even if the
3954 * SACK's since we are subject to attack in such a
3986 * Determine the MSS option to send on an outgoing SYN.
4028 tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to,
4045 if (tcp_is_sack_recovery(tp, to) ||
4096 * Send snd_cnt new data into the network in response to this ack.
4097 * If there is going to be a SACK retransmission, adjust snd_cwnd
4101 if (tcp_is_sack_recovery(tp, to)) {
4118 * By setting snd_nxt to ti_ack, this forces retransmission timer to
4134 * Set snd_cwnd to one segment beyond acknowledged offset.
4175 * RFC6928 increases it to ten segments.