Lines Matching +full:7 +full:th

153 	struct tcphdr *th = NULL;  in th_get()  local
162 if (!net_pkt_is_contiguous(pkt, sizeof(*th))) { in th_get()
163 if (tcp_pkt_linearize(pkt, ip_len, sizeof(*th)) < 0) { in th_get()
170 th = net_pkt_cursor_get_pos(pkt); in th_get()
172 return th; in th_get()
190 struct tcphdr *th; in tcp_endpoint_set() local
192 th = th_get(pkt); in tcp_endpoint_set()
193 if (!th) { in tcp_endpoint_set()
199 ep->sin.sin_port = src == TCP_EP_SRC ? th_sport(th) : in tcp_endpoint_set()
200 th_dport(th); in tcp_endpoint_set()
214 struct tcphdr *th; in tcp_endpoint_set() local
216 th = th_get(pkt); in tcp_endpoint_set()
217 if (!th) { in tcp_endpoint_set()
223 ep->sin6.sin6_port = src == TCP_EP_SRC ? th_sport(th) : in tcp_endpoint_set()
224 th_dport(th); in tcp_endpoint_set()
326 struct tcphdr *th = th_get(pkt); in tcp_data_len() local
327 size_t tcp_options_len = (th_off(th) - 5) * 4; in tcp_data_len()
329 net_pkt_ip_opts_len(pkt) - sizeof(*th) - tcp_options_len; in tcp_data_len()
339 struct tcphdr *th = th_get(pkt); in tcp_th() local
343 if (th_off(th) < 5) { in tcp_th()
345 "bogus th_off: %hu", (uint16_t)th_off(th)); in tcp_th()
350 "%s Seq=%u", tcp_flags(th_flags(th)), th_seq(th)); in tcp_th()
352 if (th_flags(th) & ACK) { in tcp_th()
354 " Ack=%u", th_ack(th)); in tcp_th()
1235 * 3 | 7 | 6 | 4 | 3+7-6 = 4 | 6-3-7=-4 | Drop queued data in tcp_check_pending_data()
1240 * 7 | 4 | 6 | 4 | 7+4-6 = 5 | 6-7-4=-5 | Should not happen, dropping queue in tcp_check_pending_data()
1241 * 11 | 2 | 6 | 4 | 11+2-6= 7 | 6-11-2=-7| Should not happen, dropping queue in tcp_check_pending_data()
1244 struct tcphdr *th = th_get(pkt); in tcp_check_pending_data() local
1245 uint32_t expected_seq = th_seq(th) + len; in tcp_check_pending_data()
1252 gap_size = (int32_t)(pending_seq - th_seq(th) - ((uint32_t)len)); in tcp_check_pending_data()
1344 struct tcphdr *th; in tcp_header_add() local
1346 th = (struct tcphdr *)net_pkt_get_data(pkt, &tcp_access); in tcp_header_add()
1347 if (!th) { in tcp_header_add()
1351 memset(th, 0, sizeof(struct tcphdr)); in tcp_header_add()
1353 UNALIGNED_PUT(conn->src.sin.sin_port, &th->th_sport); in tcp_header_add()
1354 UNALIGNED_PUT(conn->dst.sin.sin_port, &th->th_dport); in tcp_header_add()
1355 th->th_off = 5; in tcp_header_add()
1358 th->th_off++; in tcp_header_add()
1361 UNALIGNED_PUT(flags, &th->th_flags); in tcp_header_add()
1362 UNALIGNED_PUT(htons(conn->recv_win), &th->th_win); in tcp_header_add()
1363 UNALIGNED_PUT(htonl(seq), &th->th_seq); in tcp_header_add()
1366 UNALIGNED_PUT(htonl(conn->ack), &th->th_ack); in tcp_header_add()
2246 struct tcphdr *th; in tcp_recv() local
2257 th = th_get(pkt); in tcp_recv()
2259 if (th_flags(th) & SYN && !(th_flags(th) & ACK)) { in tcp_recv()
2615 * 3 | 7 | 6 | 4 | 3+7-6 = 4 | 6-3=3 | 6+4-3=7 | Drop queued data in tcp_queue_recv_data()
2616 * 3 | 8 | 6 | 4 | 3+8-6 = 5 | 6-3=3 | 6+4-3=7 | Drop queued data in tcp_queue_recv_data()
2619 * 7 | 2 | 6 | 4 | 7+2-6 = 3 | 6-7=MI | 6+4-7=3 | Drop packet in tcp_queue_recv_data()
2621 * 7 | 4 | 6 | 4 | 7+4-6 = 5 | 6-7 =MI | 6+4-7 =3 | Append, pull from packet in tcp_queue_recv_data()
2622 * 11 | 2 | 6 | 4 | 11+2-6= 7 | 6-11=MI-6| 6+4-11=MI-1 | Drop incoming packet in tcp_queue_recv_data()
2803 struct tcphdr *th = pkt ? th_get(pkt) : NULL; in tcp_in() local
2807 size_t tcp_options_len = th ? (th_off(th) - 5) * 4 : 0; in tcp_in()
2817 if (th) { in tcp_in()
2819 fl = th_flags(th) & ~(ECN | CWR); in tcp_in()
2836 if (th && th_off(th) < 5) { in tcp_in()
2845 if (!tcp_validate_seq(conn, th)) { in tcp_in()
2862 fl = th_flags(th); in tcp_in()
2880 if (th && (conn->state != TCP_LISTEN) && (conn->state != TCP_SYN_SENT) && in tcp_in()
2881 tcp_validate_seq(conn, th) && FL(&fl, &, SYN)) { in tcp_in()
2895 if (th) { in tcp_in()
2896 conn->send_win = ntohs(th_win(th)); in tcp_in()
2930 conn_ack(conn, th_seq(th) + 1); /* capture peer's isn */ in tcp_in()
2957 if (FL(&fl, &, ACK, th_ack(th) == conn->seq && in tcp_in()
2958 th_seq(th) == conn->ack)) { in tcp_in()
3053 if (FL(&fl, &, SYN | ACK, th && th_ack(th) == conn->seq)) { in tcp_in()
3055 conn_ack(conn, th_seq(th) + 1); in tcp_in()
3094 if (th && FL(&fl, &, FIN, th_seq(th) == conn->ack)) { in tcp_in()
3113 if (net_tcp_seq_cmp(th_ack(th), conn->seq) > 0) { in tcp_in()
3114 uint32_t len_acked = th_ack(th) - conn->seq; in tcp_in()
3139 if (th && (net_tcp_seq_cmp(th_ack(th), conn->seq) == 0)) { in tcp_in()
3180 if (th && (net_tcp_seq_cmp(th_ack(th), conn->seq) > 0)) { in tcp_in()
3181 uint32_t len_acked = th_ack(th) - conn->seq; in tcp_in()
3267 if (th) { in tcp_in()
3268 if (th_seq(th) == conn->ack) { in tcp_in()
3281 } else if (net_tcp_seq_greater(conn->ack, th_seq(th))) { in tcp_in()
3295 th_seq(th)); in tcp_in()
3326 if (th && FL(&fl, ==, ACK, th_ack(th) == conn->seq)) { in tcp_in()
3348 if (th) { in tcp_in()
3351 if (tcp_compute_new_length(conn, th, len, false) > 0) { in tcp_in()
3363 if (FL(&fl, &, ACK, th_ack(th) == conn->seq)) { in tcp_in()
3377 if (FL(&fl, &, FIN, net_tcp_seq_cmp(th_seq(th) + len, conn->ack) == 0)) { in tcp_in()
3424 if (th) { in tcp_in()
3431 if (tcp_compute_new_length(conn, th, len, false) > 0) { in tcp_in()
3447 if (FL(&fl, &, FIN, net_tcp_seq_cmp(th_seq(th) + len, conn->ack) == 0)) { in tcp_in()
3465 if (th) { in tcp_in()
3474 int32_t new_len = tcp_compute_new_length(conn, th, len, true); in tcp_in()
3490 if (FL(&fl, &, ACK, th_ack(th) == conn->seq)) { in tcp_in()
3508 net_tcp_seq_cmp(th_seq(th) + len + 1, conn->ack) == 0)) || in tcp_in()
3525 if (th) { in tcp_in()
3526 int32_t new_len = tcp_compute_new_length(conn, th, len, true); in tcp_in()
3547 net_tcp_seq_cmp(th_seq(th) + 1, conn->ack) == 0)) || in tcp_in()
3570 th = NULL; in tcp_in()
4135 struct tcphdr *th = th_get(pkt); in tcp_input() local
4138 if (th) { in tcp_input()
4141 if (conn == NULL && SYN == th_flags(th)) { in tcp_input()