- return(1);
-}
-
-int printhave = 0;
-
-tcp_sndwin(tp)
- struct tcb *tp;
-{
- int ihave;
- int hehas;
-
- if (tp->rcv_adv) {
- /* figure out window we would advertise */
- ihave = tp->t_ucb->uc_rhiwat -
- (tp->t_ucb->uc_rcc + tp->seqcnt);
- hehas = tp->rcv_adv - tp->rcv_nxt;
- if (printhave)
- printf("ihave %d, hehas %d\n", ihave, hehas);
- if (hehas > 32 &&
- (100*(ihave-hehas)/tp->t_ucb->uc_rhiwat) < 35)
- return;
- if (printhave)
- printf("update him\n");
- }
- if (send(tp))
- return (1);
- tcp_sndnull(tp);
- return (0);
-}
-tcp_sndnull(tp) /* send only control information */
- register struct tcb *tp;
-{
-COUNT(SEND_NULL);
-
- tcp_output(tp, 0, 0, (struct mbuf *)0);
- tp->tc_flags &= ~TC_ACK_DUE;
-}
-
-tcp_sndrst(tp, n) /* send a reset */
- register struct tcb *tp;
- register struct th *n;
-{
-COUNT(SEND_RST);
- /* don't send a reset in response to a reset */
-
- if (n->th_flags&TH_RST)
- return;
-
- tp->tc_flags |= TC_SND_RST;
-
- if (n->th_flags&TH_ACK)
- tp->snd_nxt = n->t_ackno;
-
- tp->tc_flags &= ~TC_SYN_RCVD;
- tcp_sndnull(tp);
- tp->tc_flags &= ~TC_SND_RST;