Lines Matching +full:16 +full:th
150 struct tcphdr *th = NULL; in th_get() local
159 if (!net_pkt_is_contiguous(pkt, sizeof(*th))) { in th_get()
160 if (tcp_pkt_linearize(pkt, ip_len, sizeof(*th)) < 0) { in th_get()
167 th = net_pkt_cursor_get_pos(pkt); in th_get()
169 return th; in th_get()
187 struct tcphdr *th; in tcp_endpoint_set() local
189 th = th_get(pkt); in tcp_endpoint_set()
190 if (!th) { in tcp_endpoint_set()
196 ep->sin.sin_port = src == TCP_EP_SRC ? th_sport(th) : in tcp_endpoint_set()
197 th_dport(th); in tcp_endpoint_set()
211 struct tcphdr *th; in tcp_endpoint_set() local
213 th = th_get(pkt); in tcp_endpoint_set()
214 if (!th) { in tcp_endpoint_set()
220 ep->sin6.sin6_port = src == TCP_EP_SRC ? th_sport(th) : in tcp_endpoint_set()
221 th_dport(th); in tcp_endpoint_set()
278 struct tcphdr *th = th_get(pkt); in tcp_data_len() local
279 size_t tcp_options_len = (th_off(th) - 5) * 4; in tcp_data_len()
281 net_pkt_ip_opts_len(pkt) - sizeof(*th) - tcp_options_len; in tcp_data_len()
291 struct tcphdr *th = th_get(pkt); in tcp_th() local
295 if (th_off(th) < 5) { in tcp_th()
297 "bogus th_off: %hu", (uint16_t)th_off(th)); in tcp_th()
302 "%s Seq=%u", tcp_flags(th_flags(th)), th_seq(th)); in tcp_th()
304 if (th_flags(th) & ACK) { in tcp_th()
306 " Ack=%u", th_ack(th)); in tcp_th()
952 struct tcphdr *th = th_get(pkt); in tcp_check_pending_data() local
953 uint32_t expected_seq = th_seq(th) + len; in tcp_check_pending_data()
960 gap_size = (int32_t)(pending_seq - th_seq(th) - ((uint32_t)len)); in tcp_check_pending_data()
1047 struct tcphdr *th; in tcp_header_add() local
1049 th = (struct tcphdr *)net_pkt_get_data(pkt, &tcp_access); in tcp_header_add()
1050 if (!th) { in tcp_header_add()
1054 memset(th, 0, sizeof(struct tcphdr)); in tcp_header_add()
1056 UNALIGNED_PUT(conn->src.sin.sin_port, &th->th_sport); in tcp_header_add()
1057 UNALIGNED_PUT(conn->dst.sin.sin_port, &th->th_dport); in tcp_header_add()
1058 th->th_off = 5; in tcp_header_add()
1061 th->th_off++; in tcp_header_add()
1064 UNALIGNED_PUT(flags, &th->th_flags); in tcp_header_add()
1065 UNALIGNED_PUT(htons(conn->recv_win), &th->th_win); in tcp_header_add()
1066 UNALIGNED_PUT(htonl(seq), &th->th_seq); in tcp_header_add()
1069 UNALIGNED_PUT(htonl(conn->ack), &th->th_ack); in tcp_header_add()
1135 recv_mss |= (NET_TCP_MSS_OPT << 24) | (NET_TCP_MSS_SIZE << 16); in net_tcp_set_mss_opt()
1757 struct tcphdr *th; in tcp_recv() local
1768 th = th_get(pkt); in tcp_recv()
1770 if (th_flags(th) & SYN && !(th_flags(th) & ACK)) { in tcp_recv()
1796 static uint8_t unique_key[16]; /* MD5 128 bits as described in RFC6528 */
1816 uint8_t hash[16]; in tcpv6_init_isn()
1851 uint8_t hash[16]; in tcpv4_init_isn()
2297 struct tcphdr *th = pkt ? th_get(pkt) : NULL; in tcp_in() local
2301 size_t tcp_options_len = th ? (th_off(th) - 5) * 4 : 0; in tcp_in()
2311 if (th) { in tcp_in()
2313 fl = th_flags(th) & ~(ECN | CWR); in tcp_in()
2324 if (th && th_off(th) < 5) { in tcp_in()
2333 if (!tcp_validate_seq(conn, th)) { in tcp_in()
2356 if (th && (conn->state != TCP_LISTEN) && (conn->state != TCP_SYN_SENT) && in tcp_in()
2357 tcp_validate_seq(conn, th) && FL(&fl, &, SYN)) { in tcp_in()
2371 if (th) { in tcp_in()
2372 conn->send_win = ntohs(th_win(th)); in tcp_in()
2406 conn_ack(conn, th_seq(th) + 1); /* capture peer's isn */ in tcp_in()
2427 if (FL(&fl, &, ACK, th_ack(th) == conn->seq && in tcp_in()
2428 th_seq(th) == conn->ack)) { in tcp_in()
2483 if (FL(&fl, &, SYN | ACK, th && th_ack(th) == conn->seq)) { in tcp_in()
2485 conn_ack(conn, th_seq(th) + 1); in tcp_in()
2516 if (th && FL(&fl, ==, (FIN | ACK), th_seq(th) == conn->ack)) { in tcp_in()
2517 if (net_tcp_seq_cmp(th_ack(th), conn->seq) > 0) { in tcp_in()
2518 uint32_t len_acked = th_ack(th) - conn->seq; in tcp_in()
2528 } else if (th && FL(&fl, ==, FIN, th_seq(th) == conn->ack)) { in tcp_in()
2534 } else if (th && FL(&fl, ==, (FIN | ACK | PSH), in tcp_in()
2535 th_seq(th) == conn->ack)) { in tcp_in()
2553 if (th && (net_tcp_seq_cmp(th_ack(th), conn->seq) == 0)) { in tcp_in()
2594 if (th && (net_tcp_seq_cmp(th_ack(th), conn->seq) > 0)) { in tcp_in()
2595 uint32_t len_acked = th_ack(th) - conn->seq; in tcp_in()
2670 if (th) { in tcp_in()
2671 if (th_seq(th) == conn->ack) { in tcp_in()
2682 } else if (net_tcp_seq_greater(conn->ack, th_seq(th))) { in tcp_in()
2696 th_seq(th)); in tcp_in()
2725 if (th && FL(&fl, ==, ACK, th_seq(th) == conn->ack)) { in tcp_in()
2744 if (th) { in tcp_in()
2747 if (tcp_compute_new_length(conn, th, len, false) > 0) { in tcp_in()
2759 if (FL(&fl, &, ACK, th_ack(th) == conn->seq)) { in tcp_in()
2773 if (FL(&fl, &, FIN, net_tcp_seq_cmp(th_seq(th) + len, conn->ack) == 0)) { in tcp_in()
2820 if (th) { in tcp_in()
2827 if (tcp_compute_new_length(conn, th, len, false) > 0) { in tcp_in()
2843 if (FL(&fl, &, FIN, net_tcp_seq_cmp(th_seq(th) + len, conn->ack) == 0)) { in tcp_in()
2861 if (th) { in tcp_in()
2870 int32_t new_len = tcp_compute_new_length(conn, th, len, true); in tcp_in()
2886 if (FL(&fl, &, ACK, th_ack(th) == conn->seq)) { in tcp_in()
2904 net_tcp_seq_cmp(th_seq(th) + len + 1, conn->ack) == 0)) || in tcp_in()
2921 if (th) { in tcp_in()
2922 int32_t new_len = tcp_compute_new_length(conn, th, len, true); in tcp_in()
2943 net_tcp_seq_cmp(th_seq(th) + 1, conn->ack) == 0)) || in tcp_in()
2966 th = NULL; in tcp_in()
3509 struct tcphdr *th = th_get(pkt); in tcp_input() local
3512 if (th) { in tcp_input()
3515 if (conn == NULL && SYN == th_flags(th)) { in tcp_input()