tcp_output.c (58698) | tcp_output.c (60067) |
---|---|
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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95 | 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95 |
34 * $FreeBSD: head/sys/netinet/tcp_output.c 58698 2000-03-27 19:14:27Z jlemon $ | 34 * $FreeBSD: head/sys/netinet/tcp_output.c 60067 2000-05-06 03:31:09Z jlemon $ |
35 */ 36 37#include "opt_inet6.h" 38#include "opt_ipsec.h" 39#include "opt_tcpdebug.h" 40 41#include <stddef.h> 42 --- 50 unchanged lines hidden (view full) --- 93int ss_fltsz = 1; 94SYSCTL_INT(_net_inet_tcp, OID_AUTO, slowstart_flightsize, CTLFLAG_RW, 95 &ss_fltsz, 1, "Slow start flight size"); 96 97int ss_fltsz_local = TCP_MAXWIN; /* something large */ 98SYSCTL_INT(_net_inet_tcp, OID_AUTO, local_slowstart_flightsize, CTLFLAG_RW, 99 &ss_fltsz_local, 1, "Slow start flight size for local networks"); 100 | 35 */ 36 37#include "opt_inet6.h" 38#include "opt_ipsec.h" 39#include "opt_tcpdebug.h" 40 41#include <stddef.h> 42 --- 50 unchanged lines hidden (view full) --- 93int ss_fltsz = 1; 94SYSCTL_INT(_net_inet_tcp, OID_AUTO, slowstart_flightsize, CTLFLAG_RW, 95 &ss_fltsz, 1, "Slow start flight size"); 96 97int ss_fltsz_local = TCP_MAXWIN; /* something large */ 98SYSCTL_INT(_net_inet_tcp, OID_AUTO, local_slowstart_flightsize, CTLFLAG_RW, 99 &ss_fltsz_local, 1, "Slow start flight size for local networks"); 100 |
101int tcp_do_newreno = 1; 102SYSCTL_INT(_net_inet_tcp, OID_AUTO, newreno, CTLFLAG_RW, &tcp_do_newreno, 103 0, "Enable NewReno Algorithms"); |
|
101/* 102 * Tcp output routine: figure out what should be sent and send it. 103 */ 104int 105tcp_output(tp) 106 register struct tcpcb *tp; 107{ 108 register struct socket *so = tp->t_inpcb->inp_socket; --- 4 unchanged lines hidden (view full) --- 113 register struct ipovly *ipov = NULL; 114#ifdef INET6 115 struct ip6_hdr *ip6 = NULL; 116#endif /* INET6 */ 117 register struct tcphdr *th; 118 u_char opt[TCP_MAXOLEN]; 119 unsigned ipoptlen, optlen, hdrlen; 120 int idle, sendalot; | 104/* 105 * Tcp output routine: figure out what should be sent and send it. 106 */ 107int 108tcp_output(tp) 109 register struct tcpcb *tp; 110{ 111 register struct socket *so = tp->t_inpcb->inp_socket; --- 4 unchanged lines hidden (view full) --- 116 register struct ipovly *ipov = NULL; 117#ifdef INET6 118 struct ip6_hdr *ip6 = NULL; 119#endif /* INET6 */ 120 register struct tcphdr *th; 121 u_char opt[TCP_MAXOLEN]; 122 unsigned ipoptlen, optlen, hdrlen; 123 int idle, sendalot; |
124 int maxburst = TCP_MAXBURST; |
|
121 struct rmxp_tao *taop; 122 struct rmxp_tao tao_noncached; 123#ifdef INET6 124 int isipv6; 125#endif 126 127#ifdef INET6 128 isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) != 0; --- 644 unchanged lines hidden (view full) --- 773 * and not doing an ack or a keep-alive probe. 774 * Initial value for retransmit timer is smoothed 775 * round-trip time + 2 * round-trip time variance. 776 * Initialize shift counter which is used for backoff 777 * of retransmit time. 778 */ 779 if (!callout_active(tp->tt_rexmt) && 780 tp->snd_nxt != tp->snd_una) { | 125 struct rmxp_tao *taop; 126 struct rmxp_tao tao_noncached; 127#ifdef INET6 128 int isipv6; 129#endif 130 131#ifdef INET6 132 isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) != 0; --- 644 unchanged lines hidden (view full) --- 777 * and not doing an ack or a keep-alive probe. 778 * Initial value for retransmit timer is smoothed 779 * round-trip time + 2 * round-trip time variance. 780 * Initialize shift counter which is used for backoff 781 * of retransmit time. 782 */ 783 if (!callout_active(tp->tt_rexmt) && 784 tp->snd_nxt != tp->snd_una) { |
781 callout_reset(tp->tt_rexmt, tp->t_rxtcur, 782 tcp_timer_rexmt, tp); | |
783 if (callout_active(tp->tt_persist)) { 784 callout_stop(tp->tt_persist); 785 tp->t_rxtshift = 0; 786 } | 785 if (callout_active(tp->tt_persist)) { 786 callout_stop(tp->tt_persist); 787 tp->t_rxtshift = 0; 788 } |
789 callout_reset(tp->tt_rexmt, tp->t_rxtcur, 790 tcp_timer_rexmt, tp); |
|
787 } 788 } else 789 if (SEQ_GT(tp->snd_nxt + len, tp->snd_max)) 790 tp->snd_max = tp->snd_nxt + len; 791 792#ifdef TCPDEBUG 793 /* 794 * Trace. --- 89 unchanged lines hidden (view full) --- 884 * Any pending ACK has now been sent. 885 */ 886 if (win > 0 && SEQ_GT(tp->rcv_nxt+win, tp->rcv_adv)) 887 tp->rcv_adv = tp->rcv_nxt + win; 888 tp->last_ack_sent = tp->rcv_nxt; 889 tp->t_flags &= ~TF_ACKNOW; 890 if (tcp_delack_enabled) 891 callout_stop(tp->tt_delack); | 791 } 792 } else 793 if (SEQ_GT(tp->snd_nxt + len, tp->snd_max)) 794 tp->snd_max = tp->snd_nxt + len; 795 796#ifdef TCPDEBUG 797 /* 798 * Trace. --- 89 unchanged lines hidden (view full) --- 888 * Any pending ACK has now been sent. 889 */ 890 if (win > 0 && SEQ_GT(tp->rcv_nxt+win, tp->rcv_adv)) 891 tp->rcv_adv = tp->rcv_nxt + win; 892 tp->last_ack_sent = tp->rcv_nxt; 893 tp->t_flags &= ~TF_ACKNOW; 894 if (tcp_delack_enabled) 895 callout_stop(tp->tt_delack); |
892 if (sendalot) | 896 if (sendalot && (!tcp_do_newreno || --maxburst)) |
893 goto again; 894 return (0); 895} 896 897void 898tcp_setpersist(tp) 899 register struct tcpcb *tp; 900{ --- 14 unchanged lines hidden --- | 897 goto again; 898 return (0); 899} 900 901void 902tcp_setpersist(tp) 903 register struct tcpcb *tp; 904{ --- 14 unchanged lines hidden --- |