Lines Matching refs:tcks

248 tcp_cache_hash_src(struct tcp_cache_key_src *tcks, struct tcp_heuristic_key *key)  in tcp_cache_hash_src()  argument
250 struct ifnet *ifp = tcks->ifp; in tcp_cache_hash_src()
254 if (tcks->af == AF_INET6) { in tcp_cache_hash_src()
267 memcpy(&key->thk_ip.addr6, &tcks->laddr.addr6, sizeof(struct in6_addr)); in tcp_cache_hash_src()
282 memcpy(&key->thk_ip.addr, &tcks->laddr.addr, sizeof(struct in_addr)); in tcp_cache_hash_src()
288 tcp_cache_hash(struct tcp_cache_key_src *tcks, struct tcp_cache_key *key) in tcp_cache_hash() argument
294 tcp_cache_hash_src(tcks, &key->tck_src); in tcp_cache_hash()
296 if (tcks->af == AF_INET6) { in tcp_cache_hash()
298 memcpy(&key->tck_dst.addr6, &tcks->faddr.addr6, in tcp_cache_hash()
302 memcpy(&key->tck_dst.addr, &tcks->faddr.addr, in tcp_cache_hash()
329 tcp_getcache_with_lock(struct tcp_cache_key_src *tcks, in tcp_getcache_with_lock() argument
338 hash = tcp_cache_hash(tcks, &key); in tcp_getcache_with_lock()
405 tcp_cache_key_src_create(struct tcpcb *tp, struct tcp_cache_key_src *tcks) in tcp_cache_key_src_create() argument
408 memset(tcks, 0, sizeof(*tcks)); in tcp_cache_key_src_create()
410 tcks->ifp = inp->inp_last_outifp; in tcp_cache_key_src_create()
413 memcpy(&tcks->laddr.addr6, &inp->in6p_laddr, sizeof(struct in6_addr)); in tcp_cache_key_src_create()
414 memcpy(&tcks->faddr.addr6, &inp->in6p_faddr, sizeof(struct in6_addr)); in tcp_cache_key_src_create()
415 tcks->af = AF_INET6; in tcp_cache_key_src_create()
417 memcpy(&tcks->laddr.addr, &inp->inp_laddr, sizeof(struct in_addr)); in tcp_cache_key_src_create()
418 memcpy(&tcks->faddr.addr, &inp->inp_faddr, sizeof(struct in_addr)); in tcp_cache_key_src_create()
419 tcks->af = AF_INET; in tcp_cache_key_src_create()
426 mptcp_version_cache_key_src_init(struct sockaddr *dst, struct tcp_cache_key_src *tcks) in mptcp_version_cache_key_src_init() argument
428 memset(tcks, 0, sizeof(*tcks)); in mptcp_version_cache_key_src_init()
431 memcpy(&tcks->faddr.addr, &SIN(dst)->sin_addr, sizeof(struct in_addr)); in mptcp_version_cache_key_src_init()
432 tcks->af = AF_INET; in mptcp_version_cache_key_src_init()
434 memcpy(&tcks->faddr.addr6, &SIN6(dst)->sin6_addr, sizeof(struct in6_addr)); in mptcp_version_cache_key_src_init()
435 tcks->af = AF_INET6; in mptcp_version_cache_key_src_init()
442 tcp_cache_set_cookie_common(struct tcp_cache_key_src *tcks, u_char *__counted_by(len) cookie, uint8… in tcp_cache_set_cookie_common() argument
448 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_set_cookie_common()
463 struct tcp_cache_key_src tcks; in tcp_cache_set_cookie() local
465 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_set_cookie()
466 tcp_cache_set_cookie_common(&tcks, cookie, len); in tcp_cache_set_cookie()
470 tcp_cache_get_cookie_common(struct tcp_cache_key_src *tcks, in tcp_cache_get_cookie_common() argument
478 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_common()
514 struct tcp_cache_key_src tcks; in tcp_cache_get_cookie() local
516 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_get_cookie()
517 return tcp_cache_get_cookie_common(&tcks, cookie, maxlen, len); in tcp_cache_get_cookie()
521 tcp_cache_get_cookie_len_common(struct tcp_cache_key_src *tcks) in tcp_cache_get_cookie_len_common() argument
528 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_len_common()
543 struct tcp_cache_key_src tcks; in tcp_cache_get_cookie_len() local
545 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_get_cookie_len()
546 return tcp_cache_get_cookie_len_common(&tcks); in tcp_cache_get_cookie_len()
557 struct tcp_cache_key_src tcks; in tcp_cache_get_mptcp_version() local
558 mptcp_version_cache_key_src_init(dst, &tcks); in tcp_cache_get_mptcp_version()
565 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_get_mptcp_version()
588 struct tcp_cache_key_src tcks; in tcp_cache_update_mptcp_version() local
598 mptcp_version_cache_key_src_init(SA(&dst), &tcks); in tcp_cache_update_mptcp_version()
605 mptcp_version_cache_key_src_init(SA(&dst), &tcks); in tcp_cache_update_mptcp_version()
609 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_update_mptcp_version()
650 tcp_heuristics_hash(struct tcp_cache_key_src *tcks, struct tcp_heuristic_key *key) in tcp_heuristics_hash() argument
656 tcp_cache_hash_src(tcks, key); in tcp_heuristics_hash()
685 tcp_getheuristic_with_lock(struct tcp_cache_key_src *tcks, in tcp_getheuristic_with_lock() argument
694 hash = tcp_heuristics_hash(tcks, &key); in tcp_getheuristic_with_lock()
770 tcp_heuristic_reset_counters(struct tcp_cache_key_src *tcks, uint8_t flags) in tcp_heuristic_reset_counters() argument
779 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_reset_counters()
845 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_success() local
848 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_success()
858 tcp_heuristic_reset_counters(&tcks, flag); in tcp_heuristic_tfo_success()
864 struct tcp_cache_key_src tcks; in tcp_heuristic_mptcp_success() local
866 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_mptcp_success()
867 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_MPTCP); in tcp_heuristic_mptcp_success()
873 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_success() local
875 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_success()
876 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristic_ecn_success()
911 tcp_heuristic_tfo_middlebox_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_tfo_middlebox_common() argument
916 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_tfo_middlebox_common()
927 tcp_heuristic_inc_counters(struct tcp_cache_key_src *tcks, in tcp_heuristic_inc_counters() argument
933 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_inc_counters()
977 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, ecn_fallback_synloss); in tcp_heuristic_inc_counters()
1014 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, in tcp_heuristic_inc_counters()
1032 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, in tcp_heuristic_inc_counters()
1048 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, in tcp_heuristic_inc_counters()
1065 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_loss() local
1073 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_loss()
1082 tcp_heuristic_inc_counters(&tcks, flag); in tcp_heuristic_tfo_loss()
1088 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_rst() local
1091 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_rst()
1100 tcp_heuristic_inc_counters(&tcks, flag); in tcp_heuristic_tfo_rst()
1106 struct tcp_cache_key_src tcks; in tcp_heuristic_mptcp_loss() local
1113 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_mptcp_loss()
1115 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_MPTCP); in tcp_heuristic_mptcp_loss()
1121 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_loss() local
1128 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_loss()
1130 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristic_ecn_loss()
1136 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_droprst() local
1138 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_droprst()
1140 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRST); in tcp_heuristic_ecn_droprst()
1146 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_droprxmt() local
1148 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_droprxmt()
1150 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRXMT); in tcp_heuristic_ecn_droprxmt()
1156 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_synrst() local
1158 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_synrst()
1160 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_SYNRST); in tcp_heuristic_ecn_synrst()
1166 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_middlebox() local
1170 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_middlebox()
1171 tcp_heuristic_tfo_middlebox_common(&tcks); in tcp_heuristic_tfo_middlebox()
1175 tcp_heuristic_ecn_aggressive_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_ecn_aggressive_common() argument
1180 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_ecn_aggressive_common()
1212 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_aggressive() local
1214 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_aggressive()
1215 tcp_heuristic_ecn_aggressive_common(&tcks); in tcp_heuristic_ecn_aggressive()
1219 tcp_heuristic_do_tfo_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_do_tfo_common() argument
1229 tpheur = tcp_getheuristic_with_lock(tcks, 0, &head); in tcp_heuristic_do_tfo_common()
1256 struct tcp_cache_key_src tcks; in tcp_heuristic_do_tfo() local
1258 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_do_tfo()
1259 if (tcp_heuristic_do_tfo_common(&tcks)) { in tcp_heuristic_do_tfo()
1274 struct tcp_cache_key_src tcks; in tcp_heuristic_do_mptcp() local
1284 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_do_mptcp()
1287 tpheur = tcp_getheuristic_with_lock(&tcks, 0, &head); in tcp_heuristic_do_mptcp()
1331 tcp_heuristic_do_ecn_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_do_ecn_common() argument
1342 tpheur = tcp_getheuristic_with_lock(tcks, 0, &head); in tcp_heuristic_do_ecn_common()
1373 struct tcp_cache_key_src tcks; in tcp_heuristic_do_ecn() local
1375 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_do_ecn()
1376 return tcp_heuristic_do_ecn_common(&tcks); in tcp_heuristic_do_ecn()
1383 struct tcp_cache_key_src tcks; in tcp_heuristic_do_ecn_with_address() local
1385 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristic_do_ecn_with_address()
1386 tcks.ifp = ifp; in tcp_heuristic_do_ecn_with_address()
1391 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristic_do_ecn_with_address()
1392 tcks.af = AF_INET6; in tcp_heuristic_do_ecn_with_address()
1394 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristic_do_ecn_with_address()
1395 tcks.af = AF_INET; in tcp_heuristic_do_ecn_with_address()
1398 return tcp_heuristic_do_ecn_common(&tcks); in tcp_heuristic_do_ecn_with_address()
1405 struct tcp_cache_key_src tcks; in tcp_heuristics_ecn_update() local
1407 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristics_ecn_update()
1408 tcks.ifp = ifp; in tcp_heuristics_ecn_update()
1413 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristics_ecn_update()
1414 tcks.af = AF_INET6; in tcp_heuristics_ecn_update()
1416 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristics_ecn_update()
1417 tcks.af = AF_INET; in tcp_heuristics_ecn_update()
1421 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristics_ecn_update()
1423 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristics_ecn_update()
1425 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRST); in tcp_heuristics_ecn_update()
1427 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRXMT); in tcp_heuristics_ecn_update()
1429 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_SYNRST); in tcp_heuristics_ecn_update()
1431 tcp_heuristic_ecn_aggressive_common(&tcks); in tcp_heuristics_ecn_update()
1442 struct tcp_cache_key_src tcks; in tcp_heuristic_do_tfo_with_address() local
1444 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristic_do_tfo_with_address()
1445 tcks.ifp = ifp; in tcp_heuristic_do_tfo_with_address()
1450 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristic_do_tfo_with_address()
1451 memcpy(&tcks.faddr.addr6, &remote_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristic_do_tfo_with_address()
1452 tcks.af = AF_INET6; in tcp_heuristic_do_tfo_with_address()
1454 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristic_do_tfo_with_address()
1455 memcpy(&tcks.faddr.addr, &remote_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristic_do_tfo_with_address()
1456 tcks.af = AF_INET; in tcp_heuristic_do_tfo_with_address()
1459 if (tcp_heuristic_do_tfo_common(&tcks)) { in tcp_heuristic_do_tfo_with_address()
1460 if (!tcp_cache_get_cookie_common(&tcks, cookie, maxlen, cookie_len)) { in tcp_heuristic_do_tfo_with_address()
1474 struct tcp_cache_key_src tcks; in tcp_heuristics_tfo_update() local
1476 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristics_tfo_update()
1477 tcks.ifp = ifp; in tcp_heuristics_tfo_update()
1482 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristics_tfo_update()
1483 memcpy(&tcks.faddr.addr6, &remote_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristics_tfo_update()
1484 tcks.af = AF_INET6; in tcp_heuristics_tfo_update()
1486 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristics_tfo_update()
1487 memcpy(&tcks.faddr.addr, &remote_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristics_tfo_update()
1488 tcks.af = AF_INET; in tcp_heuristics_tfo_update()
1492 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_TFO_REQ | TCPCACHE_F_TFO_DATA | in tcp_heuristics_tfo_update()
1497 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_TFO_REQ | TCPCACHE_F_TFO_REQ_RST); in tcp_heuristics_tfo_update()
1501 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ | TCPCACHE_F_TFO_DATA); in tcp_heuristics_tfo_update()
1505 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ); in tcp_heuristics_tfo_update()
1509 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ_RST | TCPCACHE_F_TFO_DATA_RST); in tcp_heuristics_tfo_update()
1513 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ_RST); in tcp_heuristics_tfo_update()
1517 tcp_heuristic_tfo_middlebox_common(&tcks); in tcp_heuristics_tfo_update()
1521 tcp_cache_set_cookie_common(&tcks, in tcp_heuristics_tfo_update()