From be43ac7facfd4a7230116005871ee137645474e4 Mon Sep 17 00:00:00 2001 From: Bill Joy Date: Sun, 13 Dec 1981 02:05:35 -0800 Subject: [PATCH] clean out printf SCCS-vsn: sys/vax/if/if_en.c 4.22 SCCS-vsn: sys/netinet/ip_input.c 1.27 SCCS-vsn: sys/netinet/tcp_input.c 1.40 SCCS-vsn: sys/netinet/tcp_output.c 4.23 SCCS-vsn: sys/netinet/tcp_subr.c 4.8 SCCS-vsn: sys/netinet/tcp_timer.c 4.7 SCCS-vsn: sys/netinet/tcp_usrreq.c 1.41 --- usr/src/sys/netinet/ip_input.c | 3 +-- usr/src/sys/netinet/tcp_input.c | 38 ++------------------------------ usr/src/sys/netinet/tcp_output.c | 16 +++----------- usr/src/sys/netinet/tcp_subr.c | 9 +------- usr/src/sys/netinet/tcp_timer.c | 8 +------ usr/src/sys/netinet/tcp_usrreq.c | 13 +---------- usr/src/sys/vax/if/if_en.c | 3 +-- 7 files changed, 10 insertions(+), 80 deletions(-) diff --git a/usr/src/sys/netinet/ip_input.c b/usr/src/sys/netinet/ip_input.c index f29ac9d5e7..0c342855ef 100644 --- a/usr/src/sys/netinet/ip_input.c +++ b/usr/src/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* ip_input.c 1.26 81/12/12 */ +/* ip_input.c 1.27 81/12/12 */ #include "../h/param.h" #include "../h/systm.h" @@ -176,7 +176,6 @@ found: (*protosw[ip_protox[ip->ip_p]].pr_input)(m); goto next; bad: -printf("ip_input bad!\n"); m_freem(m); goto next; } diff --git a/usr/src/sys/netinet/tcp_input.c b/usr/src/sys/netinet/tcp_input.c index 22200f05df..fd4c37a0a4 100644 --- a/usr/src/sys/netinet/tcp_input.c +++ b/usr/src/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* tcp_input.c 1.39 81/12/12 */ +/* tcp_input.c 1.40 81/12/12 */ #include "../h/param.h" #include "../h/systm.h" @@ -50,9 +50,7 @@ COUNT(TCP_INPUT); if (((struct ip *)ti)->ip_hl > (sizeof (struct ip) >> 2)) ip_stripoptions((struct ip *)ti, (struct mbuf *)0); if (m->m_len < sizeof (struct tcpiphdr)) { -printf("m->m_len %d\n", m->m_len); if (m_pullup(m, sizeof (struct tcpiphdr)) == 0) { -printf("tcp_input: header drop\n"); tcpstat.tcps_hdrops++; goto drop; } @@ -84,7 +82,6 @@ printf("tcp_input: header drop\n"); */ off = ti->ti_off << 2; if (off < sizeof (struct tcphdr) || off > tlen) { -printf("tcp_input: bad offset\n"); tcpstat.tcps_badoff++; goto drop; } @@ -120,16 +117,6 @@ printf("tcp_input: bad offset\n"); tp = intotcpcb(inp); if (tp == 0) goto dropwithreset; -printf("tcp_input: segment seq %x ack %x win %x inp %x flags", -ti->ti_seq, ti->ti_ack, ti->ti_win, inp); -if (ti->ti_flags & TH_FIN) printf(" FIN"); -if (ti->ti_flags & TH_SYN) printf(" SYN"); -if (ti->ti_flags & TH_RST) printf(" RST"); -if (ti->ti_flags & TH_PUSH) printf(" PUSH"); -if (ti->ti_flags & TH_ACK) printf(" ACK"); -if (ti->ti_flags & TH_URG) printf(" URG"); -printf("\n"); -printf("tcp_input: "); pseqno(tp); so = inp->inp_socket; /* @@ -183,7 +170,6 @@ printf("tcp_input: "); pseqno(tp); tcp_rcvseqinit(tp); tp->t_state = TCPS_SYN_RECEIVED; tp->t_timer[TCPT_KEEP] = TCPTV_KEEP; -printf("tcp_input: out of LISTEN: "); goto trimthenstep6; /* @@ -222,7 +208,6 @@ printf("tcp_input: out of LISTEN: "); tp->snd_wl1 = ti->ti_seq; } else tp->t_state = TCPS_SYN_RECEIVED; -printf("tcp_input: out of SYN_SENT: "); goto trimthenstep6; trimthenstep6: @@ -238,8 +223,6 @@ trimthenstep6: ti->ti_len = tp->rcv_wnd; ti->ti_flags &= ~TH_FIN; } -printf("ti->ti_len %d\n", ti->ti_len); -pseqno(tp); goto step6; } @@ -260,7 +243,6 @@ pseqno(tp); ti->ti_len = 0; ti->ti_flags &= ~(TH_PUSH|TH_FIN); } -printf("tcp_input %x: window 0, drop text and FIN\n", tp); } else { /* * If segment begins before rcv_nxt, drop leading @@ -268,7 +250,6 @@ printf("tcp_input %x: window 0, drop text and FIN\n", tp); */ if (SEQ_GT(tp->rcv_nxt, ti->ti_seq)) { todrop = tp->rcv_nxt - ti->ti_seq; -printf("tcp_input %x: drop %d dup bytes\n", tp, todrop); if (tiflags & TH_SYN) { ti->ti_seq++; if (ti->ti_urp > 1) @@ -380,7 +361,6 @@ printf("tcp_input %x: drop %d dup bytes\n", tp, todrop); tp->t_state = TCPS_ESTABLISHED; (void) tcp_reass(tp, (struct tcpiphdr *)0); tp->snd_wl1 = ti->ti_seq - 1; -printf("tcp_input: to ESTAB:\n"); pseqno(tp); /* fall into ... */ /* @@ -405,7 +385,6 @@ printf("tcp_input: to ESTAB:\n"); pseqno(tp); if (SEQ_GT(ti->ti_ack, tp->snd_max)) goto dropafterack; acked = ti->ti_ack - tp->snd_una; -printf("tcp_input: got ack of %d bytes\n", acked); if (acked >= so->so_snd.sb_cc) { acked -= so->so_snd.sb_cc; /* if acked > 0 our FIN is acked */ @@ -430,7 +409,6 @@ printf("tcp_input: got ack of %d bytes\n", acked); tp->t_srtt = tcp_alpha * tp->t_srtt + (1 - tcp_alpha) * tp->t_rtt; -printf("tcp_input: rtt sampled %d, srtt now %d\n", tp->t_rtt, (int)(100* tp->t_srtt)); tp->t_rtt = 0; } @@ -468,10 +446,8 @@ printf("tcp_input: rtt sampled %d, srtt now %d\n", tp->t_rtt, (int)(100* tp->t_s * and return. */ case TCPS_LAST_ACK: - if (ourfinisacked) { -printf("tcp_input: LAST ACK close\n"); + if (ourfinisacked) tcp_close(tp); - } goto drop; /* @@ -480,7 +456,6 @@ printf("tcp_input: LAST ACK close\n"); * it and restart the finack timer. */ case TCPS_TIME_WAIT: -printf("tcp_input: TIME_WAIT restart timer\n"); tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL; goto dropafterack; } @@ -491,17 +466,14 @@ step6: /* * Update window information. */ -printf("update win wl1 %x ti->ti_seq %x wl2 %x?", tp->snd_wl1, ti->ti_seq, tp->snd_wl2); if (SEQ_LT(tp->snd_wl1, ti->ti_seq) || tp->snd_wl1==ti->ti_seq && SEQ_LEQ(tp->snd_wl2,ti->ti_seq)) { -printf("yes\n"); tp->snd_wnd = ti->ti_win; tp->snd_wl1 = ti->ti_seq; tp->snd_wl2 = ti->ti_ack; if (tp->snd_wnd > 0) tp->t_timer[TCPT_PERSIST] = 0; } -else printf("no\n"); /* * If an URG bit is set in the segment and is greater than the @@ -550,7 +522,6 @@ else printf("no\n"); tp->t_flags |= TF_ACKNOW; tp->rcv_nxt++; } -printf("tcp_input: %x got FIN\n", tp); switch (tp->t_state) { /* @@ -602,14 +573,12 @@ dropafterack: * Generate an ACK dropping incoming segment. * Make ACK reflect our state. */ -printf("tcp_input: dropafterack\n"); if (tiflags & TH_RST) goto drop; tcp_respond(ti, tp->rcv_nxt, tp->snd_nxt, TH_ACK); return; dropwithreset: -printf("tcp_input: dropwithreset\n"); /* * Generate a RST, dropping incoming segment. * Make ACK acceptable to originator of segment. @@ -626,7 +595,6 @@ printf("tcp_input: dropwithreset\n"); return; drop: -printf("tcp_input: drop\n"); /* * Drop space held by incoming segment and return. */ @@ -715,7 +683,6 @@ present: while (ti != (struct tcpiphdr *)tp && ti->ti_seq == tp->rcv_nxt) { tp->rcv_nxt += ti->ti_len; flags = ti->ti_flags & TH_FIN; -printf("move %d bytes to user; rcv_nxt now %x\n", ti->ti_len, tp->rcv_nxt); remque(ti); sbappend(&so->so_rcv, dtom(ti)); ti = (struct tcpiphdr *)ti->ti_next; @@ -726,7 +693,6 @@ printf("move %d bytes to user; rcv_nxt now %x\n", ti->ti_len, tp->rcv_nxt); sorwakeup(so); return (flags); drop: -printf("tcp_reass drop\n"); m_freem(dtom(ti)); return (flags); } diff --git a/usr/src/sys/netinet/tcp_output.c b/usr/src/sys/netinet/tcp_output.c index 49582c273b..4b8d6b5a3b 100644 --- a/usr/src/sys/netinet/tcp_output.c +++ b/usr/src/sys/netinet/tcp_output.c @@ -1,4 +1,4 @@ -/* tcp_output.c 4.22 81/12/12 */ +/* tcp_output.c 4.23 81/12/12 */ #include "../h/param.h" #include "../h/systm.h" @@ -78,7 +78,6 @@ COUNT(TCP_OUTPUT); /* * No reason to send a segment, just return. */ -printf("tcp_output: nothing to send\n"); return (0); send: @@ -96,7 +95,6 @@ send: m->m_next = m_copy(so->so_snd.sb_mb, off, len); if (m->m_next == 0) len = 0; -if (m->m_next) printf("copy *mtod()=%x\n", *mtod(m->m_next, char *)); } ti = mtod(m, struct tcpiphdr *); if (tp->t_template == 0) @@ -153,9 +151,6 @@ if (m->m_next) printf("copy *mtod()=%x\n", *mtod(m->m_next, char *)); ti->ti_len = htons((u_short)(len + sizeof (struct tcphdr))); ti->ti_sum = in_cksum(m, sizeof (struct tcpiphdr) + len); -printf("tcp_output: ti %x flags %x seq %x ack %x win %d len %d sum %x\n", -ti, ti->ti_flags, htonl(ti->ti_seq), htonl(ti->ti_ack), htons(ti->ti_win), ti->ti_len, ti->ti_sum); - /* * Advance snd_nxt over sequence space of this segment */ @@ -191,10 +186,8 @@ ti, ti->ti_flags, htonl(ti->ti_seq), htonl(ti->ti_ack), htons(ti->ti_win), ti->t if (tp->t_timer[TCPT_REXMT] == 0 && tp->snd_nxt != tp->snd_una) { TCPT_RANGESET(tp->t_timer[TCPT_REXMT], tcp_beta * tp->t_srtt, TCPTV_MIN, TCPTV_MAX); -printf("rexmt timer set to %d\n", tp->t_timer[TCPT_REXMT]); tp->t_rxtshift = 0; } -else printf("REXMT timer is already %d, snd_nxt %x snd_una %x\n", tp->t_timer[TCPT_REXMT], tp->snd_nxt, tp->snd_una); /* * Fill in IP length and desired time to live and @@ -202,10 +195,8 @@ else printf("REXMT timer is already %d, snd_nxt %x snd_una %x\n", tp->t_timer[TC */ ((struct ip *)ti)->ip_len = len + sizeof (struct tcpiphdr); ((struct ip *)ti)->ip_ttl = TCP_TTL; - if (ip_output(m, tp->t_ipopt) == 0) { -printf("ip_output failed\n"); + if (ip_output(m, tp->t_ipopt) == 0) return (0); - } /* * Data sent (as far as we can tell). @@ -213,9 +204,8 @@ printf("ip_output failed\n"); * then remember the size of the advertised window. * Drop send for purpose of ACK requirements. */ - if (win > 0 && SEQ_GT(tp->rcv_nxt+win, tp->rcv_adv)) { + if (win > 0 && SEQ_GT(tp->rcv_nxt+win, tp->rcv_adv)) tp->rcv_adv = tp->rcv_nxt + win; - } tp->t_flags &= ~(TF_ACKNOW|TF_DELACK); if (SEQ_GT(tp->snd_nxt, tp->snd_max)) tp->snd_max = tp->snd_nxt; diff --git a/usr/src/sys/netinet/tcp_subr.c b/usr/src/sys/netinet/tcp_subr.c index b146531f9b..b7d8629b0b 100644 --- a/usr/src/sys/netinet/tcp_subr.c +++ b/usr/src/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* tcp_subr.c 4.7 81/12/12 */ +/* tcp_subr.c 4.8 81/12/12 */ #include "../h/param.h" #include "../h/systm.h" @@ -48,7 +48,6 @@ tcp_template(tp) register struct tcpiphdr *n; COUNT(TCP_TEMPLATE); -printf("tcp_template %x\n", tp); m = m_get(1); if (m == 0) return (0); @@ -95,7 +94,6 @@ tcp_respond(ti, ack, seq, flags) struct mbuf *m; COUNT(TCP_RESPOND); -printf("tcp_respond ack %x seq %x flags %x\n", ack, seq, flags); if (flags == 0) { m = m_get(0); if (m == 0) @@ -129,11 +127,9 @@ printf("tcp_respond ack %x seq %x flags %x\n", ack, seq, flags); ti->ti_off = sizeof (struct tcphdr) >> 2; ti->ti_flags = flags; ti->ti_win = ti->ti_urp = 0; -printf("before cksum m->m_len %d\n", m->m_len); ti->ti_sum = in_cksum(m, sizeof(struct tcpiphdr)); ((struct ip *)ti)->ip_len = sizeof(struct tcpiphdr); ((struct ip *)ti)->ip_ttl = TCP_TTL; -printf("to ip_output ip_len %d, m %x\n", ((struct ip *)ti)->ip_len, m); (void) ip_output(m, (struct mbuf *)0); } @@ -150,7 +146,6 @@ tcp_newtcpcb(inp) register struct tcpcb *tp; COUNT(TCP_NEWTCPCB); -printf("tcp_newtcpcb %x\n", inp); if (m == 0) return (0); tp = mtod(m, struct tcpcb *); @@ -173,7 +168,6 @@ tcp_drop(tp, errno) struct socket *so = tp->t_inpcb->inp_socket; COUNT(TCP_DROP); -printf("tcp_drop %x %d\n", tp, errno); if (TCPS_HAVERCVDSYN(tp->t_state) && TCPS_OURFINNOTACKED(tp->t_state)) { tp->t_state = TCPS_CLOSED; @@ -197,7 +191,6 @@ tcp_close(tp) struct socket *so = tp->t_inpcb->inp_socket; COUNT(TCP_CLOSE); -printf("tcp_close %x\n", tp); t = tp->seg_next; for (; t != (struct tcpiphdr *)tp; t = (struct tcpiphdr *)t->ti_next) m_freem(dtom(t)); diff --git a/usr/src/sys/netinet/tcp_timer.c b/usr/src/sys/netinet/tcp_timer.c index 22e77f1203..57d4f71901 100644 --- a/usr/src/sys/netinet/tcp_timer.c +++ b/usr/src/sys/netinet/tcp_timer.c @@ -1,4 +1,4 @@ -/* tcp_timer.c 4.6 81/12/12 */ +/* tcp_timer.c 4.7 81/12/12 */ #include "../h/param.h" #include "../h/systm.h" @@ -75,7 +75,6 @@ tcp_canceltimers(tp) register int i; COUNT(TCP_CANCELTIMERS); -printf("tcp_canceltimers %x\n", tp); for (i = 0; i < TCPT_NTIMERS; i++) tp->t_timer[i] = 0; } @@ -89,7 +88,6 @@ tcp_timers(tp, timer) { COUNT(TCP_TIMERS); -printf("tcp_timers %x %d\n", tp, timer); switch (timer) { /* @@ -111,7 +109,6 @@ printf("tcp_timers %x %d\n", tp, timer); TCPT_RANGESET(tp->t_timer[TCPT_REXMT], ((int)(2 * tp->t_srtt)) << tp->t_rxtshift, TCPTV_MIN, TCPTV_MAX); -printf("rexmt timer now %d\n", tp->t_timer[TCPT_REXMT]); tp->snd_nxt = tp->snd_una; /* this only transmits one segment! */ (void) tcp_output(tp); @@ -127,7 +124,6 @@ printf("rexmt timer now %d\n", tp->t_timer[TCPT_REXMT]); tp->t_force = 0; TCPT_RANGESET(tp->t_timer[TCPT_PERSIST], 2 * tp->t_srtt, TCPTV_PERSMIN, TCPTV_MAX); -printf("persist timer now %d\n", tp->t_timer[TCPT_PERSIST]); return; /* @@ -137,11 +133,9 @@ printf("persist timer now %d\n", tp->t_timer[TCPT_PERSIST]); case TCPT_KEEP: if (tp->t_state < TCPS_ESTABLISHED || tp->t_idle >= TCPTV_MAXIDLE) { -printf("drop because of keep alive\n"); tcp_drop(tp, ETIMEDOUT); return; } -printf("send keep alive\n"); tcp_respond(tp->t_template, tp->rcv_nxt, tp->snd_una-1, 0); tp->t_timer[TCPT_KEEP] = TCPTV_KEEP; return; diff --git a/usr/src/sys/netinet/tcp_usrreq.c b/usr/src/sys/netinet/tcp_usrreq.c index 3f5efa253c..17007fa328 100644 --- a/usr/src/sys/netinet/tcp_usrreq.c +++ b/usr/src/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* tcp_usrreq.c 1.40 81/12/12 */ +/* tcp_usrreq.c 1.41 81/12/12 */ #include "../h/param.h" #include "../h/systm.h" @@ -43,7 +43,6 @@ COUNT(TCP_USRREQ); * Make sure attached. If not, * only PRU_ATTACH is valid. */ -printf("tcp_usrreq %d so %x inp %x\n", req, so, inp); if (inp == 0 && req != PRU_ATTACH) { splx(s); return (EINVAL); @@ -174,19 +173,10 @@ badcon: return (error); } -pseqno(tp) -struct tcpcb *tp; -{ -printf("tp %x state %s rcv_nxt %x rcv_wnd %d irs %x\n", tp, tcpstates[tp->t_state],tp->rcv_nxt, tp->rcv_wnd, tp->irs); -printf("snd_una %x snd_nxt %x snd_wnd %d snd_wl1 %x snd_wl2 %x iss %x\n", -tp->snd_una, tp->snd_nxt, tp->snd_wnd, tp->snd_wl1, tp->snd_wl2, tp->iss); -} - tcp_usrclosed(tp) struct tcpcb *tp; { -printf("usrclosed in %s\n", tcpstates[tp->t_state]); switch (tp->t_state) { case TCPS_LISTEN: @@ -204,5 +194,4 @@ printf("usrclosed in %s\n", tcpstates[tp->t_state]); tp->t_state = TCPS_LAST_ACK; break; } -printf("after usrclosed state %s\n", tcpstates[tp->t_state]); } diff --git a/usr/src/sys/vax/if/if_en.c b/usr/src/sys/vax/if/if_en.c index 3db76cb96f..dee9fd367a 100644 --- a/usr/src/sys/vax/if/if_en.c +++ b/usr/src/sys/vax/if/if_en.c @@ -1,4 +1,4 @@ -/* if_en.c 4.21 81/12/12 */ +/* if_en.c 4.22 81/12/12 */ #include "en.h" @@ -348,7 +348,6 @@ COUNT(ENRINT); len = htons((u_short)endataaddr(en, off ? off+2 : 0, struct ip *)->ip_len); if (off) len += 2; -printf("enet rcvd len %d\n", len); setipintr(); inq = &ipintrq; break; -- 2.20.1