• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.5.8/xnu-1228.15.4/bsd/netinet/

Lines Matching refs:th

288 static void tcp_newreno_partial_ack(struct tcpcb *tp, struct tcphdr *th);
292 tcp_reass(tp, th, tlenp, m)
294 register struct tcphdr *th;
307 * Call with th==0 after become established to
310 if (th == NULL)
320 if (th->th_seq != tp->rcv_nxt &&
343 if (SEQ_GT(q->tqe_th->th_seq, th->th_seq))
356 i = p->tqe_th->th_seq + p->tqe_len - th->th_seq;
374 th->th_seq += i;
385 register int i = (th->th_seq + *tlenp) - q->tqe_th->th_seq;
405 te->tqe_th = th;
528 register struct tcphdr *th;
605 th = (struct tcphdr *)((caddr_t)ip6 + off0);
607 KERNEL_DEBUG(DBG_LAYER_BEG, ((th->th_dport << 16) | th->th_sport),
609 th->th_seq, th->th_ack, th->th_win);
644 th = (struct tcphdr *)((caddr_t)ip + off0);
647 KERNEL_DEBUG(DBG_LAYER_BEG, ((th->th_dport << 16) | th->th_sport),
649 th->th_seq, th->th_ack, th->th_win);
668 th->th_sum = in_addword(pseudo, (m->m_pkthdr.csum_data & 0xFFFF));
671 th->th_sum = m->m_pkthdr.csum_data;
673 th->th_sum = in_pseudo(ip->ip_src.s_addr,
677 th->th_sum ^= 0xffff;
691 th->th_sum = in_cksum(m, len);
699 if (th->th_sum) {
714 off = th->th_off << 2;
725 th = (struct tcphdr *)((caddr_t)ip6 + off0);
736 th = (struct tcphdr *)((caddr_t)ip + off0);
740 optp = (u_char *)(th + 1);
752 (th->th_flags & TH_SYN) == 0) {
759 thflags = th->th_flags;
776 NTOHL(th->th_seq);
777 NTOHL(th->th_ack);
778 NTOHS(th->th_win);
779 NTOHS(th->th_urp);
805 inp = in_pcblookup_hash(&tcbinfo, ip->ip_src, th->th_sport,
806 ip->ip_dst, th->th_dport, 0, m->m_pkthdr.rcvif);
813 th->th_sport, next_hop->sin_addr,
814 th->th_dport, 1, m->m_pkthdr.rcvif);
817 ip->ip_src, th->th_sport,
828 inp = in6_pcblookup_hash(&tcbinfo, &ip6->ip6_src, th->th_sport,
829 &ip6->ip6_dst, th->th_dport, 1,
833 inp = in_pcblookup_hash(&tcbinfo, ip->ip_src, th->th_sport,
834 ip->ip_dst, th->th_dport, 1, m->m_pkthdr.rcvif);
891 dbuf, ntohs(th->th_dport),
893 ntohs(th->th_sport));
898 dbuf, ntohs(th->th_dport), sbuf,
899 ntohs(th->th_sport), thflags);
913 dbuf, ntohs(th->th_dport),
915 ntohs(th->th_sport)));
973 tiwin = th->th_win << tp->snd_scale;
975 tiwin = th->th_win;
993 tcp_savetcp = *th;
1081 sin6->sin6_port = th->th_sport;
1093 sin->sin_port = th->th_sport;
1162 inp->inp_lport = th->th_dport;
1362 SEQ_GEQ(th->th_seq, tp->last_ack_sent) &&
1363 SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) {
1388 tcp_dooptions(tp, optp, optlen, th, &to, ifscope);
1394 tp->snd_wnd = th->th_win << tp->snd_scale;
1434 th->th_seq == tp->rcv_nxt &&
1445 SEQ_LEQ(th->th_seq, tp->last_ack_sent)) {
1456 if (SEQ_GT(th->th_ack, tp->snd_una) &&
1457 SEQ_LEQ(th->th_ack, tp->snd_max) &&
1498 SEQ_GT(th->th_ack, tp->t_rtseq)) {
1504 acked = th->th_ack - tp->snd_una;
1520 SEQ_LEQ(th->th_ack, tp->snd_recover))
1521 tp->snd_recover = th->th_ack - 1;
1522 tp->snd_una = th->th_ack;
1527 tp->snd_wl2 = th->th_ack;
1555 } else if (th->th_ack == tp->snd_una &&
1572 tp->snd_wl1 = th->th_seq;
1589 KERNEL_DEBUG(DBG_LAYER_END, ((th->th_dport << 16) | th->th_sport),
1591 th->th_seq, th->th_ack, th->th_win);
1596 KERNEL_DEBUG(DBG_LAYER_END, ((th->th_dport << 16) | th->th_sport),
1598 th->th_seq, th->th_ack, th->th_win);
1669 if (th->th_dport == th->th_sport) {
1712 sin6->sin6_port = th->th_sport;
1736 sin->sin_port = th->th_sport;
1749 tcp_dooptions(tp, optp, optlen, th, &to, ifscope);
1763 tp->irs = th->th_seq;
1800 (SEQ_LEQ(th->th_ack, tp->snd_una) ||
1801 SEQ_GT(th->th_ack, tp->snd_max))) {
1821 (SEQ_LEQ(th->th_ack, tp->iss) ||
1822 SEQ_GT(th->th_ack, tp->snd_max))) {
1835 tp->snd_wnd = th->th_win; /* initial send window */
1837 tp->irs = th->th_seq;
1912 * Advance th->th_seq to correspond to first data byte.
1916 th->th_seq++;
1925 tp->snd_wl1 = th->th_seq - 1;
1926 tp->rcv_up = th->th_seq;
2028 if ((SEQ_GEQ(th->th_seq, tp->last_ack_sent) &&
2029 SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) ||
2031 ((tp->last_ack_sent == th->th_seq) || ((tp->last_ack_sent -1) == th->th_seq)))) {
2039 if (tp->last_ack_sent != th->th_seq) {
2111 if (tp->t_state == TCPS_SYN_RECEIVED && SEQ_LT(th->th_seq, tp->irs)) {
2116 todrop = tp->rcv_nxt - th->th_seq;
2120 th->th_seq++;
2121 if (th->th_urp > 1)
2122 th->th_urp--;
2153 th->th_seq += todrop;
2155 if (th->th_urp > todrop)
2156 th->th_urp -= todrop;
2159 th->th_urp = 0;
2179 todrop = (th->th_seq+tlen) - (tp->rcv_nxt+tp->rcv_wnd);
2192 SEQ_GT(th->th_seq, tp->rcv_nxt)) {
2205 if (tp->rcv_wnd == 0 && th->th_seq == tp->rcv_nxt) {
2237 SEQ_LEQ(th->th_seq, tp->last_ack_sent) &&
2238 SEQ_LEQ(tp->last_ack_sent, th->th_seq + tlen +
2310 tp->snd_wl1 = th->th_seq - 1;
2322 * tp->snd_una < th->th_ack <= tp->snd_max
2323 * then advance tp->snd_una to th->th_ack and drop
2334 if (SEQ_GT(th->th_ack, tp->snd_max)) {
2340 tcp_sack_doack(tp, &to, th->th_ack);
2341 if (SEQ_LEQ(th->th_ack, tp->snd_una)) {
2369 th->th_ack != tp->snd_una)
2412 if (SEQ_LEQ(th->th_ack,
2436 tp->snd_nxt = th->th_ack;
2464 if (SEQ_LT(th->th_ack, tp->snd_recover)) {
2466 tcp_sack_partialack(tp, th);
2468 tcp_newreno_partial_ack(tp, th);
2472 long ss = tp->snd_max - th->th_ack;
2539 acked = th->th_ack - tp->snd_una;
2580 } else if (tp->t_rtttime && SEQ_GT(th->th_ack, tp->t_rtseq)) {
2592 if (th->th_ack == tp->snd_max) {
2614 !(tcp_do_newreno && SEQ_LEQ(th->th_ack, tp->snd_recover))) {
2674 SEQ_LEQ(th->th_ack, tp->snd_recover))
2675 tp->snd_recover = th->th_ack - 1;
2678 SEQ_GEQ(th->th_ack, tp->snd_recover))
2680 tp->snd_una = th->th_ack;
2775 (SEQ_LT(tp->snd_wl1, th->th_seq) ||
2776 (tp->snd_wl1 == th->th_seq && (SEQ_LT(tp->snd_wl2, th->th_ack) ||
2777 (tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd))))) {
2780 tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd)
2783 tp->snd_wl1 = th->th_seq;
2784 tp->snd_wl2 = th->th_ack;
2793 if ((thflags & TH_URG) && th->th_urp &&
2801 if (th->th_urp + so->so_rcv.sb_cc > sb_max) {
2802 th->th_urp = 0; /* XXX */
2820 if (SEQ_GT(th->th_seq+th->th_urp, tp->rcv_up)) {
2821 tp->rcv_up = th->th_seq + th->th_urp;
2837 if (th->th_urp <= (u_long)tlen
2842 tcp_pulloutofband(so, th, m,
2864 tcp_seq save_start = th->th_seq;
2865 tcp_seq save_end = th->th_seq + tlen;
2868 * Insert segment which includes th into TCP reassembly queue
2879 if (th->th_seq == tp->rcv_nxt &&
2891 thflags = th->th_flags & TH_FIN;
2898 thflags = tcp_reass(tp, th, &tlen, m);
2910 KERNEL_DEBUG(DBG_LAYER_END, ((th->th_dport << 16) | th->th_sport),
2912 th->th_seq, th->th_ack, th->th_win);
2917 KERNEL_DEBUG(DBG_LAYER_END, ((th->th_dport << 16) | th->th_sport),
2919 th->th_seq, th->th_ack, th->th_win);
3050 (SEQ_GT(tp->snd_una, th->th_ack) ||
3051 SEQ_GT(th->th_ack, tp->snd_max)) ) {
3106 tcp_respond(tp, mtod(m, void *), th, m, (tcp_seq)0, th->th_ack,
3112 tcp_respond(tp, mtod(m, void *), th, m, th->th_seq+tlen,
3150 tcp_dooptions(tp, cp, cnt, th, to, input_ifscope)
3157 struct tcphdr *th;
3185 if (!(th->th_flags & TH_SYN))
3194 if (!(th->th_flags & TH_SYN))
3215 if (th->th_flags & TH_SYN) {
3225 if (th->th_flags & TH_SYN)
3238 if (th->th_flags & TH_SYN)
3249 tcp_pulloutofband(so, th, m, off)
3251 struct tcphdr *th;
3255 int cnt = off + th->th_urp - 1;
3709 tcp_newreno_partial_ack(tp, th)
3711 struct tcphdr *th;
3717 tp->snd_nxt = th->th_ack;
3723 tp->snd_cwnd = tp->t_maxseg + (th->th_ack - tp->snd_una);
3734 if (tp->snd_cwnd > th->th_ack - tp->snd_una)
3735 tp->snd_cwnd -= th->th_ack - tp->snd_una;