Lines Matching defs:th

610 syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th, struct mbuf *m,
631 if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
641 if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
675 if ((SEQ_GEQ(th->th_seq, sc->sc_irs + 1) &&
676 SEQ_LT(th->th_seq, sc->sc_irs + 1 + sc->sc_wnd)) ||
677 (sc->sc_wnd == 0 && th->th_seq == sc->sc_irs + 1)) {
679 th->th_seq == sc->sc_irs + 1) {
681 if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
691 if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
696 th->th_seq, sc->sc_irs + 1, sc->sc_wnd);
706 if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
710 th->th_seq, sc->sc_irs + 1, sc->sc_wnd);
1052 syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
1062 KASSERT((tcp_get_flags(th) & (TH_RST|TH_ACK|TH_SYN)) == TH_ACK,
1081 syncookie_cmp(inc, sch, sc, th, to, *lsop, port);
1098 if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
1113 if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
1127 if (syncookie_expand(inc, sch, &scs, th, to, *lsop, port)) {
1132 if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
1142 TCPMD5_INPUT(m, th, to->to_signature) != 0)) {
1144 if ((s = tcp_log_addrs(inc, th, NULL, NULL))) {
1164 * If not, drop the ACK and leave sc entry in th cache,
1172 if ((s = tcp_log_addrs(inc, th, NULL, NULL))) {
1181 TCPMD5_INPUT(m, th, to->to_signature) != 0) {
1184 if ((s = tcp_log_addrs(inc, th, NULL, NULL))) {
1206 if ((s = tcp_log_addrs(inc, th, NULL, NULL))) {
1224 if ((s = tcp_log_addrs(inc, th, NULL, NULL))) {
1242 if ((s = tcp_log_addrs(inc, th, NULL, NULL))) {
1251 if ((s = tcp_log_addrs(inc, th, NULL, NULL))) {
1277 if (th->th_ack != sc->sc_iss + 1) {
1278 if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
1280 "rejected\n", s, __func__, th->th_ack, sc->sc_iss);
1288 if (SEQ_LEQ(th->th_seq, sc->sc_irs) ||
1289 SEQ_GT(th->th_seq, sc->sc_irs + sc->sc_wnd)) {
1290 if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
1292 "rejected\n", s, __func__, th->th_seq, sc->sc_irs);
1371 syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
1397 KASSERT((tcp_get_flags(th) & (TH_RST|TH_ACK|TH_SYN)) == TH_SYN,
1494 TCPMD5_INPUT(m, th, to->to_signature) != 0)
1551 sc->sc_flags |= tcp_ecn_syncache_add(tcp_get_flags(th), iptos);
1561 TCP_PROBE5(receive, NULL, NULL, m, NULL, th);
1563 if ((s = tcp_log_addrs(&sc->sc_inc, th, NULL, NULL))) {
1654 sc->sc_irs = th->th_seq;
1726 sc->sc_flags |= tcp_ecn_syncache_add(tcp_get_flags(th), iptos);
1750 TCP_PROBE5(receive, NULL, NULL, m, NULL, th);
1767 TCP_PROBE5(receive, NULL, NULL, m, NULL, th);
1800 struct tcphdr *th = NULL;
1861 th = (struct tcphdr *)(udp + 1);
1864 th = (struct tcphdr *)(ip6 + 1);
1897 th = (struct tcphdr *)(ip + 1);
1904 th = (struct tcphdr *)(udp + 1);
1908 th->th_sport = sc->sc_inc.inc_lport;
1909 th->th_dport = sc->sc_inc.inc_fport;
1912 th->th_seq = htonl(sc->sc_iss);
1914 th->th_seq = htonl(sc->sc_iss + 1);
1915 th->th_ack = htonl(sc->sc_irs + 1);
1916 th->th_off = sizeof(struct tcphdr) >> 2;
1917 th->th_win = htons(sc->sc_wnd);
1918 th->th_urp = 0;
1921 tcp_set_flags(th, flags);
1953 optlen = tcp_addoptions(&to, (u_char *)(th + 1));
1956 th->th_off = (sizeof(struct tcphdr) + optlen) >> 2;
1972 TCPMD5_OUTPUT(m, th, to.to_signature) != 0) {
2002 th->th_sum = htons(0);
2006 th->th_sum = in6_cksum_pseudo(ip6, tlen + optlen - hlen,
2019 TCP_PROBE5(send, NULL, NULL, ip6, NULL, th);
2033 th->th_sum = htons(0);
2037 th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
2049 TCP_PROBE5(send, NULL, NULL, ip, NULL, th);
2268 struct syncache *sc, struct tcphdr *th, struct tcpopt *to,
2281 ack = th->th_ack - 1;
2282 seq = th->th_seq - 1;
2365 struct syncache *sc, struct tcphdr *th, struct tcpopt *to,
2372 if (syncookie_expand(inc, sch, &scs, th, to, lso, port) &&
2378 if ((s = tcp_log_addrs(inc, th, NULL, NULL)) == NULL)