diff options
-rw-r--r-- | sys/netinet/in_pcb.c | 22 | ||||
-rw-r--r-- | sys/netinet/in_proto.c | 8 | ||||
-rw-r--r-- | sys/netinet/tcp_input.c | 190 | ||||
-rw-r--r-- | sys/netinet/tcp_output.c | 24 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 190 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 10 | ||||
-rw-r--r-- | sys/netinet/tcp_timer.c | 6 | ||||
-rw-r--r-- | sys/netinet/tcp_timewait.c | 10 | ||||
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 48 | ||||
-rw-r--r-- | sys/netinet/tcp_var.h | 5 |
10 files changed, 9 insertions, 504 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 1080fbe..3f6343b 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_pcb.c 8.2 (Berkeley) 1/4/94 - * $Id: in_pcb.c,v 1.3 1994/08/02 07:48:18 davidg Exp $ + * $Id: in_pcb.c,v 1.4 1995/02/08 20:22:07 wollman Exp $ */ #include <sys/param.h> @@ -151,7 +151,6 @@ in_pcbbind(inp, nam) return (0); } -#ifdef TTCP /* * Transform old in_pcbconnect() into an inner subroutine for new * in_pcbconnect(): Do some validity-checking on the remote @@ -170,20 +169,6 @@ in_pcbladdr(inp, nam, plocal_sin) struct mbuf *nam; struct sockaddr_in **plocal_sin; { -#else /* TTCP */ -/* - * Connect from a socket to a specified address. - * Both address and port must be specified in argument sin. - * If don't have a local address for this socket yet, - * then pick one. - */ - -int -in_pcbconnect(inp, nam) - register struct inpcb *inp; - struct mbuf *nam; -{ -#endif /* TTCP */ struct in_ifaddr *ia; struct sockaddr_in *ifaddr = 0; register struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *); @@ -278,7 +263,6 @@ in_pcbconnect(inp, nam) return (EADDRNOTAVAIL); } } -#ifdef TTCP /* * Don't do pcblookup call here; return interface in plocal_sin * and exit to caller, that will do the lookup. @@ -311,10 +295,6 @@ in_pcbconnect(inp, nam) if (error = in_pcbladdr(inp, nam, &ifaddr)) return(error); -#else /* TTCP */ - ifaddr = (struct sockaddr_in *)&ia->ia_addr; - } -#endif /* TTCP */ if (in_pcblookup(inp->inp_head, sin->sin_addr, sin->sin_port, diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index e14e9d8..fe9aa55 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_proto.c 8.1 (Berkeley) 6/10/93 - * $Id: in_proto.c,v 1.9 1995/02/08 20:22:09 wollman Exp $ + * $Id: in_proto.c,v 1.11 1995/02/09 23:13:20 wollman Exp $ */ #include <sys/param.h> @@ -94,12 +94,8 @@ struct protosw inetsw[] = { udp_usrreq, udp_init, 0, 0, 0, udp_sysctl }, -#ifdef TTCP { SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_IMPLOPCL|PR_WANTRCVD, -#else -{ SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD, -#endif tcp_input, 0, tcp_ctlinput, tcp_ctloutput, tcp_usrreq, tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, tcp_sysctl @@ -117,7 +113,7 @@ struct protosw inetsw[] = { { SOCK_RAW, &inetdomain, IPPROTO_IGMP, PR_ATOMIC|PR_ADDR, igmp_input, rip_output, 0, rip_ctloutput, rip_usrreq, - igmp_init, igmp_fasttimo, igmp_slowtimo, 0, + igmp_init, igmp_fasttimo, igmp_slowtimo, 0, igmp_sysctl }, { SOCK_RAW, &inetdomain, IPPROTO_RSVP, PR_ATOMIC|PR_ADDR, rip_input, rip_output, 0, rip_ctloutput, diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index d0a2195..2503a9c 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.5 (Berkeley) 4/10/94 - * $Id: tcp_input.c,v 1.12 1995/02/14 02:35:16 wollman Exp $ + * $Id: tcp_input.c,v 1.13 1995/02/14 06:23:56 phk Exp $ */ #ifndef TUBA_INCLUDE @@ -141,7 +141,6 @@ tcp_reass(tp, ti, m) tcpstat.tcps_rcvduppack++; tcpstat.tcps_rcvdupbyte += ti->ti_len; m_freem(m); -#ifdef TTCP /* * Try to present any queued data * at the left window edge to the user. @@ -149,9 +148,6 @@ tcp_reass(tp, ti, m) * completes. */ goto present; /* ??? */ -#else - return (0); -#endif } m_adj(m, i); ti->ti_len -= i; @@ -236,22 +232,15 @@ tcp_input(m, iphlen) struct in_addr laddr; int dropsocket = 0; int iss = 0; -#ifdef TTCP u_long tiwin; struct tcpopt to; /* options in this segment */ struct rmxp_tao *taop; /* pointer to our TAO cache entry */ struct rmxp_tao tao_noncached; /* in case there's no cached entry */ -#else - u_long tiwin, ts_val, ts_ecr; - int ts_present = 0; -#endif #ifdef TCPDEBUG short ostate = 0; #endif -#ifdef TTCP bzero((char *)&to, sizeof(to)); -#endif tcpstat.tcps_rcvtotal++; /* @@ -318,15 +307,9 @@ tcp_input(m, iphlen) optp[TCPOLEN_TSTAMP_APPA] == TCPOPT_EOL)) && *(u_long *)optp == htonl(TCPOPT_TSTAMP_HDR) && (ti->ti_flags & TH_SYN) == 0) { -#ifdef TTCP to.to_flag |= TOF_TS; to.to_tsval = ntohl(*(u_long *)(optp + 4)); to.to_tsecr = ntohl(*(u_long *)(optp + 8)); -#else - ts_present = 1; - ts_val = ntohl(*(u_long *)(optp + 4)); - ts_ecr = ntohl(*(u_long *)(optp + 8)); -#endif optp = NULL; /* we've parsed the options */ } } @@ -385,9 +368,7 @@ findpcb: } #endif if (so->so_options & SO_ACCEPTCONN) { -#ifdef TTCP register struct tcpcb *tp0 = tp; -#endif so = sonewconn(so, 0); if (so == 0) goto drop; @@ -411,9 +392,7 @@ findpcb: #endif tp = intotcpcb(inp); tp->t_state = TCPS_LISTEN; -#ifdef TTCP tp->t_flags |= tp0->t_flags & (TF_NOPUSH|TF_NOOPT); -#endif /* Compute proper scaling value from buffer space */ while (tp->request_r_scale < TCP_MAX_WINSHIFT && @@ -435,11 +414,7 @@ findpcb: */ if (optp && tp->t_state != TCPS_LISTEN) tcp_dooptions(tp, optp, optlen, ti, -#ifdef TTCP &to); -#else - &ts_present, &ts_val, &ts_ecr); -#endif /* * Header prediction: check for the two common cases @@ -454,15 +429,12 @@ findpcb: * receiver side. If we're getting packets in-order * (the reassembly queue is empty), add the data to * the socket buffer and note that we need a delayed ack. -#ifdef TTCP * Make sure that the hidden state-flags are also off. * Since we check for TCPS_ESTABLISHED above, it can only * be TH_NEEDSYN. -#endif */ if (tp->t_state == TCPS_ESTABLISHED && (tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ACK)) == TH_ACK && -#ifdef TTCP ((tp->t_flags & (TF_NEEDSYN|TF_NEEDFIN)) == 0) && ((to.to_flag & TOF_TS) == 0 || TSTMP_GEQ(to.to_tsval, tp->ts_recent)) && @@ -473,9 +445,6 @@ findpcb: */ ((tp->t_flags & (TF_REQ_CC|TF_RCVD_CC)) != (TF_REQ_CC|TF_RCVD_CC) || (to.to_flag & TOF_CC) != 0 && to.to_cc == tp->cc_recv) && -#else - (!ts_present || TSTMP_GEQ(ts_val, tp->ts_recent)) && -#endif ti->ti_seq == tp->rcv_nxt && tiwin && tiwin == tp->snd_wnd && tp->snd_nxt == tp->snd_max) { @@ -486,16 +455,10 @@ findpcb: * NOTE that the test is modified according to the latest * proposal of the tcplw@cray.com list (Braden 1993/04/26). */ -#ifdef TTCP if ((to.to_flag & TOF_TS) != 0 && SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) { tp->ts_recent_age = tcp_now; tp->ts_recent = to.to_tsval; -#else - if (ts_present && SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) { - tp->ts_recent_age = tcp_now; - tp->ts_recent = ts_val; -#endif } if (ti->ti_len == 0) { @@ -506,14 +469,9 @@ findpcb: * this is a pure ack for outstanding data. */ ++tcpstat.tcps_predack; -#ifdef TTCP if ((to.to_flag & TOF_TS) != 0) tcp_xmit_timer(tp, tcp_now - to.to_tsecr + 1); -#else - if (ts_present) - tcp_xmit_timer(tp, tcp_now-ts_ecr+1); -#endif else if (tp->t_rtt && SEQ_GT(ti->ti_ack, tp->t_rtseq)) tcp_xmit_timer(tp, tp->t_rtt); @@ -647,19 +605,13 @@ findpcb: dropsocket = 0; /* socket is already gone */ goto drop; } -#ifdef TTCP if ((taop = tcp_gettaocache(inp)) == NULL) { taop = &tao_noncached; bzero(taop, sizeof(*taop)); } -#endif /* TTCP */ if (optp) tcp_dooptions(tp, optp, optlen, ti, -#ifdef TTCP &to); -#else - &ts_present, &ts_val, &ts_ecr); -#endif if (iss) tp->iss = iss; else @@ -668,7 +620,6 @@ findpcb: tp->irs = ti->ti_seq; tcp_sendseqinit(tp); tcp_rcvseqinit(tp); -#ifdef TTCP /* * Initialization of the tcpcb for transaction; * set SND.WND = SEG.WND, @@ -727,7 +678,6 @@ findpcb: * TAO test failed or there was no CC option, * do a standard 3-way handshake. */ -#endif /* TTCP */ tp->t_flags |= TF_ACKNOW; tp->t_state = TCPS_SYN_RECEIVED; tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT; @@ -749,7 +699,6 @@ findpcb: * continue processing rest of data/controls, beginning with URG */ case TCPS_SYN_SENT: -#ifdef TTCP if ((taop = tcp_gettaocache(inp)) == NULL) { taop = &tao_noncached; bzero(taop, sizeof(*taop)); @@ -771,12 +720,6 @@ findpcb: else goto dropwithreset; } -#else - if ((tiflags & TH_ACK) && - (SEQ_LEQ(ti->ti_ack, tp->iss) || - SEQ_GT(ti->ti_ack, tp->snd_max))) - goto dropwithreset; -#endif if (tiflags & TH_RST) { if (tiflags & TH_ACK) tp = tcp_drop(tp, ECONNREFUSED); @@ -784,26 +727,12 @@ findpcb: } if ((tiflags & TH_SYN) == 0) goto drop; -#ifdef TTCP tp->snd_wnd = ti->ti_win; /* initial send window */ tp->cc_recv = to.to_cc; /* foreign CC */ -#else - if (tiflags & TH_ACK) { - tp->snd_una = ti->ti_ack; - if (SEQ_LT(tp->snd_nxt, tp->snd_una)) - tp->snd_nxt = tp->snd_una; - } - tp->t_timer[TCPT_REXMT] = 0; -#endif tp->irs = ti->ti_seq; tcp_rcvseqinit(tp); -#ifndef TTCP - tp->t_flags |= TF_ACKNOW; - if (tiflags & TH_ACK && SEQ_GT(tp->snd_una, tp->iss)) { -#else if (tiflags & TH_ACK && SEQ_GT(ti->ti_ack, tp->iss)) { -#endif tcpstat.tcps_connects++; soisconnected(so); /* Do window scaling on this connection? */ @@ -812,7 +741,6 @@ findpcb: tp->snd_scale = tp->requested_s_scale; tp->rcv_scale = tp->request_r_scale; } -#ifdef TTCP /* * Our SYN was acked. If segment contains CC.ECHO * option, check it to make sure this segment really @@ -853,19 +781,7 @@ findpcb: tiflags &= ~TH_SYN; } else tp->t_state = TCPS_ESTABLISHED; -#else - tp->t_state = TCPS_ESTABLISHED; - (void) tcp_reass(tp, (struct tcpiphdr *)0, - (struct mbuf *)0); - /* - * if we didn't have to retransmit the SYN, - * use its rtt as our initial srtt & rtt var. - */ - if (tp->t_rtt) - tcp_xmit_timer(tp, tp->t_rtt); -#endif -#ifdef TTCP } else { /* * Received initial SYN in SYN-SENT[*] state => simul- @@ -901,10 +817,6 @@ findpcb: tp->t_state = TCPS_SYN_RECEIVED; } } -#else - } else - tp->t_state = TCPS_SYN_RECEIVED; -#endif trimthenstep6: /* @@ -923,7 +835,6 @@ trimthenstep6: } tp->snd_wl1 = ti->ti_seq - 1; tp->rcv_up = ti->ti_seq; -#ifdef TTCP /* * Client side of transaction: already sent SYN and data. * If the remote host used T/TCP to validate the SYN, @@ -933,9 +844,7 @@ trimthenstep6: */ if (tiflags & TH_ACK) goto process_ACK; -#endif goto step6; -#ifdef TTCP /* * If the state is LAST_ACK or CLOSING or TIME_WAIT: * if segment contains a SYN and CC [not CC.NEW] option: @@ -966,15 +875,12 @@ trimthenstep6: goto drop; } break; /* continue normal processing */ -#endif } /* * States other than LISTEN or SYN_SENT. * First check timestamp, if present. -#ifdef TTCP * Then check the connection count, if present. -#endif * Then check that at least some bytes of segment are within * receive window. If segment begins before rcv_nxt, * drop leading data (and SYN); if nothing left, just ack. @@ -982,13 +888,8 @@ trimthenstep6: * RFC 1323 PAWS: If we have a timestamp reply on this segment * and it's less than ts_recent, drop it. */ -#ifdef TTCP if ((to.to_flag & TOF_TS) != 0 && (tiflags & TH_RST) == 0 && tp->ts_recent && TSTMP_LT(to.to_tsval, tp->ts_recent)) { -#else - if (ts_present && (tiflags & TH_RST) == 0 && tp->ts_recent && - TSTMP_LT(ts_val, tp->ts_recent)) { -#endif /* Check to see if ts_recent is over 24 days old. */ if ((int)(tcp_now - tp->ts_recent_age) > TCP_PAWS_IDLE) { @@ -1012,7 +913,6 @@ trimthenstep6: } } -#ifdef TTCP /* * T/TCP mechanism * If T/TCP was negotiated and the segment doesn't have CC, @@ -1023,7 +923,6 @@ trimthenstep6: ((to.to_flag & TOF_CC) == 0 || tp->cc_recv != to.to_cc) && (tiflags & TH_RST) == 0) goto dropafterack; -#endif todrop = tp->rcv_nxt - ti->ti_seq; if (todrop > 0) { @@ -1139,16 +1038,10 @@ trimthenstep6: * NOTE that the test is modified according to the latest * proposal of the tcplw@cray.com list (Braden 1993/04/26). */ -#ifdef TTCP if ((to.to_flag & TOF_TS) != 0 && SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) { tp->ts_recent_age = tcp_now; tp->ts_recent = to.to_tsval; -#else - if (ts_present && SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) { - tp->ts_recent_age = tcp_now; - tp->ts_recent = ts_val; -#endif } /* @@ -1194,7 +1087,6 @@ trimthenstep6: goto dropwithreset; } -#ifdef TTCP /* * If the ACK bit is off: if in SYN-RECEIVED state or SENDSYN * flag is on (half-synchronized state), then queue data for @@ -1207,13 +1099,6 @@ trimthenstep6: else goto drop; } -#else - /* - * If the ACK bit is off we drop the segment and return. - */ - if ((tiflags & TH_ACK) == 0) - goto drop; -#endif /* * Ack processing. @@ -1238,7 +1123,6 @@ trimthenstep6: tp->snd_scale = tp->requested_s_scale; tp->rcv_scale = tp->request_r_scale; } -#ifdef TTCP /* * Upon successful completion of 3-way handshake, * update cache.CC if it was undefined, pass any queued @@ -1265,10 +1149,6 @@ trimthenstep6: if (ti->ti_len == 0 && (tiflags & TH_FIN) == 0) (void) tcp_reass(tp, (struct tcpiphdr *)0, (struct mbuf *)0); -#else /* TTCP */ - tp->t_state = TCPS_ESTABLISHED; - (void) tcp_reass(tp, (struct tcpiphdr *)0, (struct mbuf *)0); -#endif /* TTCP */ tp->snd_wl1 = ti->ti_seq - 1; /* fall into ... */ @@ -1358,7 +1238,6 @@ trimthenstep6: tcpstat.tcps_rcvacktoomuch++; goto dropafterack; } -#ifdef TTCP /* * If we reach this point, ACK is not a duplicate, * i.e., it ACKs something we sent. @@ -1375,7 +1254,6 @@ trimthenstep6: } process_ACK: -#endif acked = ti->ti_ack - tp->snd_una; tcpstat.tcps_rcvackpack++; tcpstat.tcps_rcvackbyte += acked; @@ -1389,13 +1267,8 @@ process_ACK: * timer backoff (cf., Phil Karn's retransmit alg.). * Recompute the initial retransmit timer. */ -#ifdef TTCP if (to.to_flag & TOF_TS) tcp_xmit_timer(tp, tcp_now - to.to_tsecr + 1); -#else - if (ts_present) - tcp_xmit_timer(tp, tcp_now-ts_ecr+1); -#endif else if (tp->t_rtt && SEQ_GT(ti->ti_ack, tp->t_rtseq)) tcp_xmit_timer(tp,tp->t_rtt); @@ -1411,14 +1284,12 @@ process_ACK: } else if (tp->t_timer[TCPT_PERSIST] == 0) tp->t_timer[TCPT_REXMT] = tp->t_rxtcur; -#ifdef TTCP /* * If no data (only SYN) was ACK'd, * skip rest of ACK processing. */ if (acked == 0) goto step6; -#endif /* * When new data is acked, open the congestion window. @@ -1484,14 +1355,12 @@ process_ACK: if (ourfinisacked) { tp->t_state = TCPS_TIME_WAIT; tcp_canceltimers(tp); -#ifdef TTCP /* Shorten TIME_WAIT [RFC-1644, p.28] */ if (tp->cc_recv != 0 && tp->t_duration < TCPTV_MSL) tp->t_timer[TCPT_2MSL] = tp->t_rxtcur * TCPTV_TWTRUNC; else -#endif tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL; soisdisconnected(so); } @@ -1632,7 +1501,6 @@ dodata: /* XXX */ if (tiflags & TH_FIN) { if (TCPS_HAVERCVDFIN(tp->t_state) == 0) { socantrcvmore(so); -#ifdef TTCP /* * If connection is half-synchronized * (ie SEND_SYN flag on) then delay ACK, @@ -1643,7 +1511,6 @@ dodata: /* XXX */ if (tp->t_flags & TF_NEEDSYN) tp->t_flags |= TF_DELACK; else -#endif /* TTCP */ tp->t_flags |= TF_ACKNOW; tp->rcv_nxt++; } @@ -1674,7 +1541,6 @@ dodata: /* XXX */ case TCPS_FIN_WAIT_2: tp->t_state = TCPS_TIME_WAIT; tcp_canceltimers(tp); -#ifdef TTCP /* Shorten TIME_WAIT [RFC-1644, p.28] */ if (tp->cc_recv != 0 && tp->t_duration < TCPTV_MSL) { @@ -1684,7 +1550,6 @@ dodata: /* XXX */ tp->t_flags |= TF_ACKNOW; } else -#endif tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL; soisdisconnected(so); break; @@ -1716,12 +1581,10 @@ dropafterack: */ if (tiflags & TH_RST) goto drop; -#ifdef TTCP #ifdef TCPDEBUG if (so->so_options & SO_DEBUG) tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0); #endif -#endif m_freem(m); tp->t_flags |= TF_ACKNOW; (void) tcp_output(tp); @@ -1736,12 +1599,10 @@ dropwithreset: if ((tiflags & TH_RST) || m->m_flags & (M_BCAST|M_MCAST) || IN_MULTICAST(ntohl(ti->ti_dst.s_addr))) goto drop; -#ifdef TTCP #ifdef TCPDEBUG if (tp == 0 || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0); #endif -#endif if (tiflags & TH_ACK) tcp_respond(tp, ti, m, (tcp_seq)0, ti->ti_ack, TH_RST); else { @@ -1760,13 +1621,8 @@ drop: * Drop space held by incoming segment and return. */ #ifdef TCPDEBUG -#ifdef TTCP if (tp == 0 || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0); -#else - if (tp && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) - tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0); -#endif #endif m_freem(m); /* destroy temporarily created socket */ @@ -1777,21 +1633,12 @@ drop: } void -#ifdef TTCP tcp_dooptions(tp, cp, cnt, ti, to) -#else -tcp_dooptions(tp, cp, cnt, ti, ts_present, ts_val, ts_ecr) -#endif struct tcpcb *tp; u_char *cp; int cnt; struct tcpiphdr *ti; -#ifdef TTCP struct tcpopt *to; -#else - int *ts_present; - u_long *ts_val, *ts_ecr; -#endif { u_short mss = 0; int opt, optlen; @@ -1833,7 +1680,6 @@ tcp_dooptions(tp, cp, cnt, ti, ts_present, ts_val, ts_ecr) case TCPOPT_TIMESTAMP: if (optlen != TCPOLEN_TIMESTAMP) continue; -#ifdef TTCP to->to_flag |= TOF_TS; bcopy((char *)cp + 2, (char *)&to->to_tsval, sizeof(to->to_tsval)); @@ -1841,13 +1687,6 @@ tcp_dooptions(tp, cp, cnt, ti, ts_present, ts_val, ts_ecr) bcopy((char *)cp + 6, (char *)&to->to_tsecr, sizeof(to->to_tsecr)); NTOHL(to->to_tsecr); -#else - *ts_present = 1; - bcopy((char *)cp + 2, (char *) ts_val, sizeof(*ts_val)); - NTOHL(*ts_val); - bcopy((char *)cp + 6, (char *) ts_ecr, sizeof(*ts_ecr)); - NTOHL(*ts_ecr); -#endif /* * A timestamp received in a SYN makes @@ -1855,15 +1694,10 @@ tcp_dooptions(tp, cp, cnt, ti, ts_present, ts_val, ts_ecr) */ if (ti->ti_flags & TH_SYN) { tp->t_flags |= TF_RCVD_TSTMP; -#ifdef TTCP tp->ts_recent = to->to_tsval; -#else - tp->ts_recent = *ts_val; -#endif tp->ts_recent_age = tcp_now; } break; -#ifdef TTCP case TCPOPT_CC: if (optlen != TCPOLEN_CC) continue; @@ -1903,7 +1737,6 @@ tcp_dooptions(tp, cp, cnt, ti, ts_present, ts_val, ts_ecr) (char *)&to->to_ccecho, sizeof(to->to_ccecho)); NTOHL(to->to_ccecho); break; -#endif /* TTCP*/ } } if (ti->ti_flags & TH_SYN) @@ -2041,11 +1874,9 @@ tcp_xmit_timer(tp, rtt) * NOTE that this routine is only called when we process an incoming * segment, for outgoing segments only tcp_mssopt is called. * -#ifdef TTCP * In case of T/TCP, we call this routine during implicit connection * setup as well (offer = -1), to initialize maxseg from the cached * MSS of our peer. -#endif */ void tcp_mss(tp, offer) @@ -2058,11 +1889,9 @@ tcp_mss(tp, offer) u_long bufsize; struct inpcb *inp; struct socket *so; -#ifdef TTCP struct rmxp_tao *taop; int origoffer = offer; extern int tcp_do_rfc1644; -#endif extern int tcp_mssdflt; inp = tp->t_inpcb; @@ -2073,7 +1902,6 @@ tcp_mss(tp, offer) ifp = rt->rt_ifp; so = inp->inp_socket; -#ifdef TTCP taop = rmx_taop(rt->rt_rmx); /* * Offer == -1 means that we didn't receive SYN yet, @@ -2081,7 +1909,6 @@ tcp_mss(tp, offer) */ if (offer == -1) offer = taop->tao_mssopt; -#endif /* TTCP */ /* * Offer == 0 means that there was no MSS on the SYN segment, * in this case we use tcp_mssdflt. @@ -2096,9 +1923,7 @@ tcp_mss(tp, offer) * funny things may happen in tcp_output. */ offer = max(offer, 64); -#ifdef TTCP taop->tao_mssopt = offer; -#endif /* TTCP */ #ifdef RTV_MTU /* if route characteristics exist ... */ /* @@ -2147,7 +1972,6 @@ tcp_mss(tp, offer) */ tp->t_maxopd = mss; -#ifdef TTCP /* * In case of T/TCP, origoffer==-1 indicates, that no segments * were received yet. In this case we just guess, otherwise @@ -2161,16 +1985,6 @@ tcp_mss(tp, offer) (origoffer == -1 || (tp->t_flags & TF_RCVD_CC) == TF_RCVD_CC)) mss -= TCPOLEN_CC_APPA; -#else /* TTCP */ - /* - * Adjust mss to leave space for the usual options. We're - * called from the end of tcp_dooptions so we can use the - * REQ/RCVD flags to see if options will be used. - */ - if ((tp->t_flags & (TF_REQ_TSTMP|TF_RCVD_TSTMP|TF_NOOPT)) == - (TF_REQ_TSTMP|TF_RCVD_TSTMP)) - mss -= TCPOLEN_TSTAMP_APPA; -#endif /* TTCP */ #if (MCLBYTES & (MCLBYTES - 1)) == 0 if (mss > MCLBYTES) @@ -2209,12 +2023,10 @@ tcp_mss(tp, offer) bufsize = sb_max; (void)sbreserve(&so->so_rcv, bufsize); } -#ifdef TTCP /* * Don't force slow-start on local network. */ if (!in_localaddr(inp->inp_faddr)) -#endif /* TTCP */ tp->snd_cwnd = mss; #ifdef RTV_SSTHRESH diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 3af7caa..ca60732 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_output.c 8.3 (Berkeley) 12/30/93 - * $Id: tcp_output.c,v 1.6 1995/01/26 03:56:20 davidg Exp $ + * $Id: tcp_output.c,v 1.7 1995/02/09 23:13:24 wollman Exp $ */ #include <sys/param.h> @@ -81,10 +81,8 @@ tcp_output(tp) u_char opt[TCP_MAXOLEN]; unsigned optlen, hdrlen; int idle, sendalot; -#ifdef TTCP struct rmxp_tao *taop; struct rmxp_tao tao_noncached; -#endif /* * Determine length of data that should be transmitted, @@ -106,7 +104,6 @@ again: win = min(tp->snd_wnd, tp->snd_cwnd); flags = tcp_outflags[tp->t_state]; -#ifdef TTCP /* * Get standard flags, and add SYN or FIN if requested by 'hidden' * state flags. @@ -115,7 +112,6 @@ again: flags |= TH_FIN; if (tp->t_flags & TF_NEEDSYN) flags |= TH_SYN; -#endif /* TTCP */ /* * If in persist timeout with window of 0, send 1 byte. @@ -152,7 +148,6 @@ again: len = min(so->so_snd.sb_cc, win) - off; -#ifdef TTCP if ((taop = tcp_gettaocache(tp->t_inpcb)) == NULL) { taop = &tao_noncached; bzero(taop, sizeof(*taop)); @@ -170,7 +165,6 @@ again: taop->tao_ccsent == 0) return 0; } -#endif /* TTCP */ if (len < 0) { /* @@ -212,18 +206,12 @@ again: if (len == tp->t_maxseg) goto send; if ((idle || tp->t_flags & TF_NODELAY) && -#ifdef TTCP (tp->t_flags & TF_NOPUSH) == 0 && -#endif len + off >= so->so_snd.sb_cc) goto send; if (tp->t_force) goto send; -#ifdef TTCP if (len >= tp->max_sndwnd / 2 && tp->max_sndwnd > 0) -#else - if (len >= tp->max_sndwnd / 2) -#endif goto send; if (SEQ_LT(tp->snd_nxt, tp->snd_max)) goto send; @@ -256,12 +244,8 @@ again: */ if (tp->t_flags & TF_ACKNOW) goto send; -#ifdef TTCP if ((flags & TH_RST) || ((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0)) -#else - if (flags & (TH_SYN|TH_RST)) -#endif goto send; if (SEQ_GT(tp->snd_up, tp->snd_una)) goto send; @@ -349,11 +333,7 @@ send: */ if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP && (flags & TH_RST) == 0 && -#ifdef TTCP ((flags & TH_ACK) == 0 || -#else - ((flags & (TH_SYN|TH_ACK)) == TH_SYN || -#endif (tp->t_flags & TF_RCVD_TSTMP))) { u_long *lp = (u_long *)(opt + optlen); @@ -364,7 +344,6 @@ send: optlen += TCPOLEN_TSTAMP_APPA; } -#ifdef TTCP /* * Send `CC-family' options if our side wants to use them (TF_REQ_CC), * options are allowed (!TF_NOOPT) and it's not a RST. @@ -442,7 +421,6 @@ send: break; } } -#endif /* TTCP */ hdrlen += optlen; diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index d0a2195..2503a9c 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.5 (Berkeley) 4/10/94 - * $Id: tcp_input.c,v 1.12 1995/02/14 02:35:16 wollman Exp $ + * $Id: tcp_input.c,v 1.13 1995/02/14 06:23:56 phk Exp $ */ #ifndef TUBA_INCLUDE @@ -141,7 +141,6 @@ tcp_reass(tp, ti, m) tcpstat.tcps_rcvduppack++; tcpstat.tcps_rcvdupbyte += ti->ti_len; m_freem(m); -#ifdef TTCP /* * Try to present any queued data * at the left window edge to the user. @@ -149,9 +148,6 @@ tcp_reass(tp, ti, m) * completes. */ goto present; /* ??? */ -#else - return (0); -#endif } m_adj(m, i); ti->ti_len -= i; @@ -236,22 +232,15 @@ tcp_input(m, iphlen) struct in_addr laddr; int dropsocket = 0; int iss = 0; -#ifdef TTCP u_long tiwin; struct tcpopt to; /* options in this segment */ struct rmxp_tao *taop; /* pointer to our TAO cache entry */ struct rmxp_tao tao_noncached; /* in case there's no cached entry */ -#else - u_long tiwin, ts_val, ts_ecr; - int ts_present = 0; -#endif #ifdef TCPDEBUG short ostate = 0; #endif -#ifdef TTCP bzero((char *)&to, sizeof(to)); -#endif tcpstat.tcps_rcvtotal++; /* @@ -318,15 +307,9 @@ tcp_input(m, iphlen) optp[TCPOLEN_TSTAMP_APPA] == TCPOPT_EOL)) && *(u_long *)optp == htonl(TCPOPT_TSTAMP_HDR) && (ti->ti_flags & TH_SYN) == 0) { -#ifdef TTCP to.to_flag |= TOF_TS; to.to_tsval = ntohl(*(u_long *)(optp + 4)); to.to_tsecr = ntohl(*(u_long *)(optp + 8)); -#else - ts_present = 1; - ts_val = ntohl(*(u_long *)(optp + 4)); - ts_ecr = ntohl(*(u_long *)(optp + 8)); -#endif optp = NULL; /* we've parsed the options */ } } @@ -385,9 +368,7 @@ findpcb: } #endif if (so->so_options & SO_ACCEPTCONN) { -#ifdef TTCP register struct tcpcb *tp0 = tp; -#endif so = sonewconn(so, 0); if (so == 0) goto drop; @@ -411,9 +392,7 @@ findpcb: #endif tp = intotcpcb(inp); tp->t_state = TCPS_LISTEN; -#ifdef TTCP tp->t_flags |= tp0->t_flags & (TF_NOPUSH|TF_NOOPT); -#endif /* Compute proper scaling value from buffer space */ while (tp->request_r_scale < TCP_MAX_WINSHIFT && @@ -435,11 +414,7 @@ findpcb: */ if (optp && tp->t_state != TCPS_LISTEN) tcp_dooptions(tp, optp, optlen, ti, -#ifdef TTCP &to); -#else - &ts_present, &ts_val, &ts_ecr); -#endif /* * Header prediction: check for the two common cases @@ -454,15 +429,12 @@ findpcb: * receiver side. If we're getting packets in-order * (the reassembly queue is empty), add the data to * the socket buffer and note that we need a delayed ack. -#ifdef TTCP * Make sure that the hidden state-flags are also off. * Since we check for TCPS_ESTABLISHED above, it can only * be TH_NEEDSYN. -#endif */ if (tp->t_state == TCPS_ESTABLISHED && (tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ACK)) == TH_ACK && -#ifdef TTCP ((tp->t_flags & (TF_NEEDSYN|TF_NEEDFIN)) == 0) && ((to.to_flag & TOF_TS) == 0 || TSTMP_GEQ(to.to_tsval, tp->ts_recent)) && @@ -473,9 +445,6 @@ findpcb: */ ((tp->t_flags & (TF_REQ_CC|TF_RCVD_CC)) != (TF_REQ_CC|TF_RCVD_CC) || (to.to_flag & TOF_CC) != 0 && to.to_cc == tp->cc_recv) && -#else - (!ts_present || TSTMP_GEQ(ts_val, tp->ts_recent)) && -#endif ti->ti_seq == tp->rcv_nxt && tiwin && tiwin == tp->snd_wnd && tp->snd_nxt == tp->snd_max) { @@ -486,16 +455,10 @@ findpcb: * NOTE that the test is modified according to the latest * proposal of the tcplw@cray.com list (Braden 1993/04/26). */ -#ifdef TTCP if ((to.to_flag & TOF_TS) != 0 && SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) { tp->ts_recent_age = tcp_now; tp->ts_recent = to.to_tsval; -#else - if (ts_present && SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) { - tp->ts_recent_age = tcp_now; - tp->ts_recent = ts_val; -#endif } if (ti->ti_len == 0) { @@ -506,14 +469,9 @@ findpcb: * this is a pure ack for outstanding data. */ ++tcpstat.tcps_predack; -#ifdef TTCP if ((to.to_flag & TOF_TS) != 0) tcp_xmit_timer(tp, tcp_now - to.to_tsecr + 1); -#else - if (ts_present) - tcp_xmit_timer(tp, tcp_now-ts_ecr+1); -#endif else if (tp->t_rtt && SEQ_GT(ti->ti_ack, tp->t_rtseq)) tcp_xmit_timer(tp, tp->t_rtt); @@ -647,19 +605,13 @@ findpcb: dropsocket = 0; /* socket is already gone */ goto drop; } -#ifdef TTCP if ((taop = tcp_gettaocache(inp)) == NULL) { taop = &tao_noncached; bzero(taop, sizeof(*taop)); } -#endif /* TTCP */ if (optp) tcp_dooptions(tp, optp, optlen, ti, -#ifdef TTCP &to); -#else - &ts_present, &ts_val, &ts_ecr); -#endif if (iss) tp->iss = iss; else @@ -668,7 +620,6 @@ findpcb: tp->irs = ti->ti_seq; tcp_sendseqinit(tp); tcp_rcvseqinit(tp); -#ifdef TTCP /* * Initialization of the tcpcb for transaction; * set SND.WND = SEG.WND, @@ -727,7 +678,6 @@ findpcb: * TAO test failed or there was no CC option, * do a standard 3-way handshake. */ -#endif /* TTCP */ tp->t_flags |= TF_ACKNOW; tp->t_state = TCPS_SYN_RECEIVED; tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT; @@ -749,7 +699,6 @@ findpcb: * continue processing rest of data/controls, beginning with URG */ case TCPS_SYN_SENT: -#ifdef TTCP if ((taop = tcp_gettaocache(inp)) == NULL) { taop = &tao_noncached; bzero(taop, sizeof(*taop)); @@ -771,12 +720,6 @@ findpcb: else goto dropwithreset; } -#else - if ((tiflags & TH_ACK) && - (SEQ_LEQ(ti->ti_ack, tp->iss) || - SEQ_GT(ti->ti_ack, tp->snd_max))) - goto dropwithreset; -#endif if (tiflags & TH_RST) { if (tiflags & TH_ACK) tp = tcp_drop(tp, ECONNREFUSED); @@ -784,26 +727,12 @@ findpcb: } if ((tiflags & TH_SYN) == 0) goto drop; -#ifdef TTCP tp->snd_wnd = ti->ti_win; /* initial send window */ tp->cc_recv = to.to_cc; /* foreign CC */ -#else - if (tiflags & TH_ACK) { - tp->snd_una = ti->ti_ack; - if (SEQ_LT(tp->snd_nxt, tp->snd_una)) - tp->snd_nxt = tp->snd_una; - } - tp->t_timer[TCPT_REXMT] = 0; -#endif tp->irs = ti->ti_seq; tcp_rcvseqinit(tp); -#ifndef TTCP - tp->t_flags |= TF_ACKNOW; - if (tiflags & TH_ACK && SEQ_GT(tp->snd_una, tp->iss)) { -#else if (tiflags & TH_ACK && SEQ_GT(ti->ti_ack, tp->iss)) { -#endif tcpstat.tcps_connects++; soisconnected(so); /* Do window scaling on this connection? */ @@ -812,7 +741,6 @@ findpcb: tp->snd_scale = tp->requested_s_scale; tp->rcv_scale = tp->request_r_scale; } -#ifdef TTCP /* * Our SYN was acked. If segment contains CC.ECHO * option, check it to make sure this segment really @@ -853,19 +781,7 @@ findpcb: tiflags &= ~TH_SYN; } else tp->t_state = TCPS_ESTABLISHED; -#else - tp->t_state = TCPS_ESTABLISHED; - (void) tcp_reass(tp, (struct tcpiphdr *)0, - (struct mbuf *)0); - /* - * if we didn't have to retransmit the SYN, - * use its rtt as our initial srtt & rtt var. - */ - if (tp->t_rtt) - tcp_xmit_timer(tp, tp->t_rtt); -#endif -#ifdef TTCP } else { /* * Received initial SYN in SYN-SENT[*] state => simul- @@ -901,10 +817,6 @@ findpcb: tp->t_state = TCPS_SYN_RECEIVED; } } -#else - } else - tp->t_state = TCPS_SYN_RECEIVED; -#endif trimthenstep6: /* @@ -923,7 +835,6 @@ trimthenstep6: } tp->snd_wl1 = ti->ti_seq - 1; tp->rcv_up = ti->ti_seq; -#ifdef TTCP /* * Client side of transaction: already sent SYN and data. * If the remote host used T/TCP to validate the SYN, @@ -933,9 +844,7 @@ trimthenstep6: */ if (tiflags & TH_ACK) goto process_ACK; -#endif goto step6; -#ifdef TTCP /* * If the state is LAST_ACK or CLOSING or TIME_WAIT: * if segment contains a SYN and CC [not CC.NEW] option: @@ -966,15 +875,12 @@ trimthenstep6: goto drop; } break; /* continue normal processing */ -#endif } /* * States other than LISTEN or SYN_SENT. * First check timestamp, if present. -#ifdef TTCP * Then check the connection count, if present. -#endif * Then check that at least some bytes of segment are within * receive window. If segment begins before rcv_nxt, * drop leading data (and SYN); if nothing left, just ack. @@ -982,13 +888,8 @@ trimthenstep6: * RFC 1323 PAWS: If we have a timestamp reply on this segment * and it's less than ts_recent, drop it. */ -#ifdef TTCP if ((to.to_flag & TOF_TS) != 0 && (tiflags & TH_RST) == 0 && tp->ts_recent && TSTMP_LT(to.to_tsval, tp->ts_recent)) { -#else - if (ts_present && (tiflags & TH_RST) == 0 && tp->ts_recent && - TSTMP_LT(ts_val, tp->ts_recent)) { -#endif /* Check to see if ts_recent is over 24 days old. */ if ((int)(tcp_now - tp->ts_recent_age) > TCP_PAWS_IDLE) { @@ -1012,7 +913,6 @@ trimthenstep6: } } -#ifdef TTCP /* * T/TCP mechanism * If T/TCP was negotiated and the segment doesn't have CC, @@ -1023,7 +923,6 @@ trimthenstep6: ((to.to_flag & TOF_CC) == 0 || tp->cc_recv != to.to_cc) && (tiflags & TH_RST) == 0) goto dropafterack; -#endif todrop = tp->rcv_nxt - ti->ti_seq; if (todrop > 0) { @@ -1139,16 +1038,10 @@ trimthenstep6: * NOTE that the test is modified according to the latest * proposal of the tcplw@cray.com list (Braden 1993/04/26). */ -#ifdef TTCP if ((to.to_flag & TOF_TS) != 0 && SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) { tp->ts_recent_age = tcp_now; tp->ts_recent = to.to_tsval; -#else - if (ts_present && SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) { - tp->ts_recent_age = tcp_now; - tp->ts_recent = ts_val; -#endif } /* @@ -1194,7 +1087,6 @@ trimthenstep6: goto dropwithreset; } -#ifdef TTCP /* * If the ACK bit is off: if in SYN-RECEIVED state or SENDSYN * flag is on (half-synchronized state), then queue data for @@ -1207,13 +1099,6 @@ trimthenstep6: else goto drop; } -#else - /* - * If the ACK bit is off we drop the segment and return. - */ - if ((tiflags & TH_ACK) == 0) - goto drop; -#endif /* * Ack processing. @@ -1238,7 +1123,6 @@ trimthenstep6: tp->snd_scale = tp->requested_s_scale; tp->rcv_scale = tp->request_r_scale; } -#ifdef TTCP /* * Upon successful completion of 3-way handshake, * update cache.CC if it was undefined, pass any queued @@ -1265,10 +1149,6 @@ trimthenstep6: if (ti->ti_len == 0 && (tiflags & TH_FIN) == 0) (void) tcp_reass(tp, (struct tcpiphdr *)0, (struct mbuf *)0); -#else /* TTCP */ - tp->t_state = TCPS_ESTABLISHED; - (void) tcp_reass(tp, (struct tcpiphdr *)0, (struct mbuf *)0); -#endif /* TTCP */ tp->snd_wl1 = ti->ti_seq - 1; /* fall into ... */ @@ -1358,7 +1238,6 @@ trimthenstep6: tcpstat.tcps_rcvacktoomuch++; goto dropafterack; } -#ifdef TTCP /* * If we reach this point, ACK is not a duplicate, * i.e., it ACKs something we sent. @@ -1375,7 +1254,6 @@ trimthenstep6: } process_ACK: -#endif acked = ti->ti_ack - tp->snd_una; tcpstat.tcps_rcvackpack++; tcpstat.tcps_rcvackbyte += acked; @@ -1389,13 +1267,8 @@ process_ACK: * timer backoff (cf., Phil Karn's retransmit alg.). * Recompute the initial retransmit timer. */ -#ifdef TTCP if (to.to_flag & TOF_TS) tcp_xmit_timer(tp, tcp_now - to.to_tsecr + 1); -#else - if (ts_present) - tcp_xmit_timer(tp, tcp_now-ts_ecr+1); -#endif else if (tp->t_rtt && SEQ_GT(ti->ti_ack, tp->t_rtseq)) tcp_xmit_timer(tp,tp->t_rtt); @@ -1411,14 +1284,12 @@ process_ACK: } else if (tp->t_timer[TCPT_PERSIST] == 0) tp->t_timer[TCPT_REXMT] = tp->t_rxtcur; -#ifdef TTCP /* * If no data (only SYN) was ACK'd, * skip rest of ACK processing. */ if (acked == 0) goto step6; -#endif /* * When new data is acked, open the congestion window. @@ -1484,14 +1355,12 @@ process_ACK: if (ourfinisacked) { tp->t_state = TCPS_TIME_WAIT; tcp_canceltimers(tp); -#ifdef TTCP /* Shorten TIME_WAIT [RFC-1644, p.28] */ if (tp->cc_recv != 0 && tp->t_duration < TCPTV_MSL) tp->t_timer[TCPT_2MSL] = tp->t_rxtcur * TCPTV_TWTRUNC; else -#endif tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL; soisdisconnected(so); } @@ -1632,7 +1501,6 @@ dodata: /* XXX */ if (tiflags & TH_FIN) { if (TCPS_HAVERCVDFIN(tp->t_state) == 0) { socantrcvmore(so); -#ifdef TTCP /* * If connection is half-synchronized * (ie SEND_SYN flag on) then delay ACK, @@ -1643,7 +1511,6 @@ dodata: /* XXX */ if (tp->t_flags & TF_NEEDSYN) tp->t_flags |= TF_DELACK; else -#endif /* TTCP */ tp->t_flags |= TF_ACKNOW; tp->rcv_nxt++; } @@ -1674,7 +1541,6 @@ dodata: /* XXX */ case TCPS_FIN_WAIT_2: tp->t_state = TCPS_TIME_WAIT; tcp_canceltimers(tp); -#ifdef TTCP /* Shorten TIME_WAIT [RFC-1644, p.28] */ if (tp->cc_recv != 0 && tp->t_duration < TCPTV_MSL) { @@ -1684,7 +1550,6 @@ dodata: /* XXX */ tp->t_flags |= TF_ACKNOW; } else -#endif tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL; soisdisconnected(so); break; @@ -1716,12 +1581,10 @@ dropafterack: */ if (tiflags & TH_RST) goto drop; -#ifdef TTCP #ifdef TCPDEBUG if (so->so_options & SO_DEBUG) tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0); #endif -#endif m_freem(m); tp->t_flags |= TF_ACKNOW; (void) tcp_output(tp); @@ -1736,12 +1599,10 @@ dropwithreset: if ((tiflags & TH_RST) || m->m_flags & (M_BCAST|M_MCAST) || IN_MULTICAST(ntohl(ti->ti_dst.s_addr))) goto drop; -#ifdef TTCP #ifdef TCPDEBUG if (tp == 0 || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0); #endif -#endif if (tiflags & TH_ACK) tcp_respond(tp, ti, m, (tcp_seq)0, ti->ti_ack, TH_RST); else { @@ -1760,13 +1621,8 @@ drop: * Drop space held by incoming segment and return. */ #ifdef TCPDEBUG -#ifdef TTCP if (tp == 0 || (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0); -#else - if (tp && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) - tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0); -#endif #endif m_freem(m); /* destroy temporarily created socket */ @@ -1777,21 +1633,12 @@ drop: } void -#ifdef TTCP tcp_dooptions(tp, cp, cnt, ti, to) -#else -tcp_dooptions(tp, cp, cnt, ti, ts_present, ts_val, ts_ecr) -#endif struct tcpcb *tp; u_char *cp; int cnt; struct tcpiphdr *ti; -#ifdef TTCP struct tcpopt *to; -#else - int *ts_present; - u_long *ts_val, *ts_ecr; -#endif { u_short mss = 0; int opt, optlen; @@ -1833,7 +1680,6 @@ tcp_dooptions(tp, cp, cnt, ti, ts_present, ts_val, ts_ecr) case TCPOPT_TIMESTAMP: if (optlen != TCPOLEN_TIMESTAMP) continue; -#ifdef TTCP to->to_flag |= TOF_TS; bcopy((char *)cp + 2, (char *)&to->to_tsval, sizeof(to->to_tsval)); @@ -1841,13 +1687,6 @@ tcp_dooptions(tp, cp, cnt, ti, ts_present, ts_val, ts_ecr) bcopy((char *)cp + 6, (char *)&to->to_tsecr, sizeof(to->to_tsecr)); NTOHL(to->to_tsecr); -#else - *ts_present = 1; - bcopy((char *)cp + 2, (char *) ts_val, sizeof(*ts_val)); - NTOHL(*ts_val); - bcopy((char *)cp + 6, (char *) ts_ecr, sizeof(*ts_ecr)); - NTOHL(*ts_ecr); -#endif /* * A timestamp received in a SYN makes @@ -1855,15 +1694,10 @@ tcp_dooptions(tp, cp, cnt, ti, ts_present, ts_val, ts_ecr) */ if (ti->ti_flags & TH_SYN) { tp->t_flags |= TF_RCVD_TSTMP; -#ifdef TTCP tp->ts_recent = to->to_tsval; -#else - tp->ts_recent = *ts_val; -#endif tp->ts_recent_age = tcp_now; } break; -#ifdef TTCP case TCPOPT_CC: if (optlen != TCPOLEN_CC) continue; @@ -1903,7 +1737,6 @@ tcp_dooptions(tp, cp, cnt, ti, ts_present, ts_val, ts_ecr) (char *)&to->to_ccecho, sizeof(to->to_ccecho)); NTOHL(to->to_ccecho); break; -#endif /* TTCP*/ } } if (ti->ti_flags & TH_SYN) @@ -2041,11 +1874,9 @@ tcp_xmit_timer(tp, rtt) * NOTE that this routine is only called when we process an incoming * segment, for outgoing segments only tcp_mssopt is called. * -#ifdef TTCP * In case of T/TCP, we call this routine during implicit connection * setup as well (offer = -1), to initialize maxseg from the cached * MSS of our peer. -#endif */ void tcp_mss(tp, offer) @@ -2058,11 +1889,9 @@ tcp_mss(tp, offer) u_long bufsize; struct inpcb *inp; struct socket *so; -#ifdef TTCP struct rmxp_tao *taop; int origoffer = offer; extern int tcp_do_rfc1644; -#endif extern int tcp_mssdflt; inp = tp->t_inpcb; @@ -2073,7 +1902,6 @@ tcp_mss(tp, offer) ifp = rt->rt_ifp; so = inp->inp_socket; -#ifdef TTCP taop = rmx_taop(rt->rt_rmx); /* * Offer == -1 means that we didn't receive SYN yet, @@ -2081,7 +1909,6 @@ tcp_mss(tp, offer) */ if (offer == -1) offer = taop->tao_mssopt; -#endif /* TTCP */ /* * Offer == 0 means that there was no MSS on the SYN segment, * in this case we use tcp_mssdflt. @@ -2096,9 +1923,7 @@ tcp_mss(tp, offer) * funny things may happen in tcp_output. */ offer = max(offer, 64); -#ifdef TTCP taop->tao_mssopt = offer; -#endif /* TTCP */ #ifdef RTV_MTU /* if route characteristics exist ... */ /* @@ -2147,7 +1972,6 @@ tcp_mss(tp, offer) */ tp->t_maxopd = mss; -#ifdef TTCP /* * In case of T/TCP, origoffer==-1 indicates, that no segments * were received yet. In this case we just guess, otherwise @@ -2161,16 +1985,6 @@ tcp_mss(tp, offer) (origoffer == -1 || (tp->t_flags & TF_RCVD_CC) == TF_RCVD_CC)) mss -= TCPOLEN_CC_APPA; -#else /* TTCP */ - /* - * Adjust mss to leave space for the usual options. We're - * called from the end of tcp_dooptions so we can use the - * REQ/RCVD flags to see if options will be used. - */ - if ((tp->t_flags & (TF_REQ_TSTMP|TF_RCVD_TSTMP|TF_NOOPT)) == - (TF_REQ_TSTMP|TF_RCVD_TSTMP)) - mss -= TCPOLEN_TSTAMP_APPA; -#endif /* TTCP */ #if (MCLBYTES & (MCLBYTES - 1)) == 0 if (mss > MCLBYTES) @@ -2209,12 +2023,10 @@ tcp_mss(tp, offer) bufsize = sb_max; (void)sbreserve(&so->so_rcv, bufsize); } -#ifdef TTCP /* * Don't force slow-start on local network. */ if (!in_localaddr(inp->inp_faddr)) -#endif /* TTCP */ tp->snd_cwnd = mss; #ifdef RTV_SSTHRESH diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index d05052f..88d18ec 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: tcp_subr.c,v 1.5 1994/10/08 22:39:58 phk Exp $ + * $Id: tcp_subr.c,v 1.6 1995/02/09 23:13:25 wollman Exp $ */ #include <sys/param.h> @@ -68,10 +68,8 @@ int tcp_mssdflt = TCP_MSS; int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ; int tcp_do_rfc1323 = 1; -#ifdef TTCP int tcp_do_rfc1644 = 1; static void tcp_cleartaocache(void); -#endif extern struct inpcb *tcp_last_inpcb; @@ -83,10 +81,8 @@ tcp_init() { tcp_iss = 1; /* wrong */ -#ifdef TTCP tcp_ccgen = 1; tcp_cleartaocache(); -#endif tcb.inp_next = tcb.inp_prev = &tcb; if (max_protohdr < sizeof(struct tcpiphdr)) max_protohdr = sizeof(struct tcpiphdr); @@ -235,10 +231,8 @@ tcp_newtcpcb(inp) if (tcp_do_rfc1323) tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP); -#ifdef TTCP if (tcp_do_rfc1644) tp->t_flags |= TF_REQ_CC; -#endif tp->t_inpcb = inp; /* * Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no @@ -495,7 +489,6 @@ tcp_rtlookup(inp) return rt; } -#ifdef TTCP /* * Return a pointer to the cached information about the remote host. * The cached information is stored in the protocol specific part of @@ -526,4 +519,3 @@ tcp_gettaocache(inp) static void tcp_cleartaocache(void) { } -#endif /* TTCP */ diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 72448f1..e302003 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_timer.c 8.1 (Berkeley) 6/10/93 - * $Id: tcp_timer.c,v 1.2 1994/08/02 07:49:10 davidg Exp $ + * $Id: tcp_timer.c,v 1.3 1995/02/09 23:13:26 wollman Exp $ */ #ifndef TUBA_INCLUDE @@ -123,9 +123,7 @@ tcp_slowtimo() } } tp->t_idle++; -#ifdef TTCP tp->t_duration++; -#endif if (tp->t_rtt) tp->t_rtt++; tpgone: @@ -215,12 +213,10 @@ tcp_timers(tp, timer) tp->t_srtt = 0; } tp->snd_nxt = tp->snd_una; -#ifdef TTCP /* * Force a segment to be sent. */ tp->t_flags |= TF_ACKNOW; -#endif /* * If timing a segment in this window, stop the timer. */ diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index d05052f..88d18ec 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: tcp_subr.c,v 1.5 1994/10/08 22:39:58 phk Exp $ + * $Id: tcp_subr.c,v 1.6 1995/02/09 23:13:25 wollman Exp $ */ #include <sys/param.h> @@ -68,10 +68,8 @@ int tcp_mssdflt = TCP_MSS; int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ; int tcp_do_rfc1323 = 1; -#ifdef TTCP int tcp_do_rfc1644 = 1; static void tcp_cleartaocache(void); -#endif extern struct inpcb *tcp_last_inpcb; @@ -83,10 +81,8 @@ tcp_init() { tcp_iss = 1; /* wrong */ -#ifdef TTCP tcp_ccgen = 1; tcp_cleartaocache(); -#endif tcb.inp_next = tcb.inp_prev = &tcb; if (max_protohdr < sizeof(struct tcpiphdr)) max_protohdr = sizeof(struct tcpiphdr); @@ -235,10 +231,8 @@ tcp_newtcpcb(inp) if (tcp_do_rfc1323) tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP); -#ifdef TTCP if (tcp_do_rfc1644) tp->t_flags |= TF_REQ_CC; -#endif tp->t_inpcb = inp; /* * Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no @@ -495,7 +489,6 @@ tcp_rtlookup(inp) return rt; } -#ifdef TTCP /* * Return a pointer to the cached information about the remote host. * The cached information is stored in the protocol specific part of @@ -526,4 +519,3 @@ tcp_gettaocache(inp) static void tcp_cleartaocache(void) { } -#endif /* TTCP */ diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 2ee6b95..f81e5dd 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -203,35 +203,8 @@ tcp_usrreq(so, req, m, nam, control) break; } -#ifdef TTCP if ((error = tcp_connect(tp, nam)) != 0) break; -#else /* TTCP */ - if (inp->inp_lport == 0) { - error = in_pcbbind(inp, (struct mbuf *)0); - if (error) - break; - } - error = in_pcbconnect(inp, nam); - if (error) - break; - tp->t_template = tcp_template(tp); - if (tp->t_template == 0) { - in_pcbdisconnect(inp); - error = ENOBUFS; - break; - } - /* Compute window scaling to request. */ - while (tp->request_r_scale < TCP_MAX_WINSHIFT && - (TCP_MAXWIN << tp->request_r_scale) < so->so_rcv.sb_hiwat) - tp->request_r_scale++; - soisconnecting(so); - tcpstat.tcps_connattempt++; - tp->t_state = TCPS_SYN_SENT; - tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT; - tp->iss = tcp_iss; tcp_iss += TCP_ISSINCR/2; - tcp_sendseqinit(tp); -#endif /* TTCP */ error = tcp_output(tp); break; @@ -287,12 +260,9 @@ tcp_usrreq(so, req, m, nam, control) * Do a send by putting data in output queue and updating urgent * marker if URG set. Possibly send more data. */ -#ifdef TTCP case PRU_SEND_EOF: -#endif case PRU_SEND: sbappend(&so->so_snd, m); -#ifdef TTCP if (nam && tp->t_state < TCPS_SYN_SENT) { /* * Do implied connect if not yet connected, @@ -316,7 +286,6 @@ tcp_usrreq(so, req, m, nam, control) tp = tcp_usrclosed(tp); } if (tp != NULL) -#endif TTCP error = tcp_output(tp); break; @@ -401,7 +370,6 @@ tcp_usrreq(so, req, m, nam, control) return (error); } -#ifdef TTCP /* * Common subroutine to open a TCP connection to remote host specified * by struct sockaddr_in in mbuf *nam. Call in_pcbbind to assign a local @@ -476,7 +444,6 @@ tcp_connect(tp, nam) return 0; } -#endif /* TTCP */ int tcp_ctloutput(op, so, level, optname, mp) @@ -528,7 +495,6 @@ tcp_ctloutput(op, so, level, optname, mp) error = EINVAL; break; -#ifdef TTCP case TCP_NOOPT: if (m == NULL || m->m_len < sizeof (int)) error = EINVAL; @@ -546,7 +512,6 @@ tcp_ctloutput(op, so, level, optname, mp) else tp->t_flags &= ~TF_NOPUSH; break; -#endif /* TTCP */ default: error = ENOPROTOOPT; @@ -567,14 +532,12 @@ tcp_ctloutput(op, so, level, optname, mp) case TCP_MAXSEG: *mtod(m, int *) = tp->t_maxseg; break; -#ifdef TTCP case TCP_NOOPT: *mtod(m, int *) = tp->t_flags & TF_NOOPT; break; case TCP_NOPUSH: *mtod(m, int *) = tp->t_flags & TF_NOPUSH; break; -#endif /* TTCP */ default: error = ENOPROTOOPT; break; @@ -675,22 +638,15 @@ tcp_usrclosed(tp) case TCPS_CLOSED: case TCPS_LISTEN: -#ifndef TTCP - case TCPS_SYN_SENT: -#endif tp->t_state = TCPS_CLOSED; tp = tcp_close(tp); break; -#ifdef TTCP case TCPS_SYN_SENT: case TCPS_SYN_RECEIVED: tp->t_flags |= TF_NEEDFIN; break; -#else - case TCPS_SYN_RECEIVED: -#endif case TCPS_ESTABLISHED: tp->t_state = TCPS_FIN_WAIT_1; break; @@ -717,9 +673,7 @@ tcp_sysctl(name, namelen, oldp, oldlenp, newp, newlen) size_t newlen; { extern int tcp_do_rfc1323; /* XXX */ -#ifdef TTCP extern int tcp_do_rfc1644; /* XXX */ -#endif extern int tcp_mssdflt; /* XXX */ extern int tcp_rttdflt; /* XXX */ @@ -731,11 +685,9 @@ tcp_sysctl(name, namelen, oldp, oldlenp, newp, newlen) case TCPCTL_DO_RFC1323: return (sysctl_int(oldp, oldlenp, newp, newlen, &tcp_do_rfc1323)); -#ifdef TTCP case TCPCTL_DO_RFC1644: return (sysctl_int(oldp, oldlenp, newp, newlen, &tcp_do_rfc1644)); -#endif case TCPCTL_MSSDFLT: return (sysctl_int(oldp, oldlenp, newp, newlen, &tcp_mssdflt)); diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index df1937d..460a370 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -322,13 +322,8 @@ struct tcpcb * tcp_disconnect __P((struct tcpcb *)); struct tcpcb * tcp_drop __P((struct tcpcb *, int)); -#ifdef TTCP void tcp_dooptions __P((struct tcpcb *, u_char *, int, struct tcpiphdr *, struct tcpopt *)); -#else -void tcp_dooptions __P((struct tcpcb *, - u_char *, int, struct tcpiphdr *, int *, u_long *, u_long *)); -#endif void tcp_drain __P((void)); void tcp_fasttimo __P((void)); struct rmxp_tao * |