Lines Matching refs:tcks
228 tcp_cache_hash_src(struct tcp_cache_key_src *tcks, struct tcp_heuristic_key *key) in tcp_cache_hash_src() argument
230 struct ifnet *ifp = tcks->ifp; in tcp_cache_hash_src()
234 if (tcks->af == AF_INET6) { in tcp_cache_hash_src()
247 memcpy(&key->thk_ip.addr6, &tcks->laddr.addr6, sizeof(struct in6_addr)); in tcp_cache_hash_src()
262 memcpy(&key->thk_ip.addr, &tcks->laddr.addr, sizeof(struct in_addr)); in tcp_cache_hash_src()
268 tcp_cache_hash(struct tcp_cache_key_src *tcks, struct tcp_cache_key *key) in tcp_cache_hash() argument
274 tcp_cache_hash_src(tcks, &key->tck_src); in tcp_cache_hash()
276 if (tcks->af == AF_INET6) { in tcp_cache_hash()
278 memcpy(&key->tck_dst.addr6, &tcks->faddr.addr6, in tcp_cache_hash()
282 memcpy(&key->tck_dst.addr, &tcks->faddr.addr, in tcp_cache_hash()
309 tcp_getcache_with_lock(struct tcp_cache_key_src *tcks, in tcp_getcache_with_lock() argument
318 hash = tcp_cache_hash(tcks, &key); in tcp_getcache_with_lock()
385 tcp_cache_key_src_create(struct tcpcb *tp, struct tcp_cache_key_src *tcks) in tcp_cache_key_src_create() argument
388 memset(tcks, 0, sizeof(*tcks)); in tcp_cache_key_src_create()
390 tcks->ifp = inp->inp_last_outifp; in tcp_cache_key_src_create()
393 memcpy(&tcks->laddr.addr6, &inp->in6p_laddr, sizeof(struct in6_addr)); in tcp_cache_key_src_create()
394 memcpy(&tcks->faddr.addr6, &inp->in6p_faddr, sizeof(struct in6_addr)); in tcp_cache_key_src_create()
395 tcks->af = AF_INET6; in tcp_cache_key_src_create()
397 memcpy(&tcks->laddr.addr, &inp->inp_laddr, sizeof(struct in_addr)); in tcp_cache_key_src_create()
398 memcpy(&tcks->faddr.addr, &inp->inp_faddr, sizeof(struct in_addr)); in tcp_cache_key_src_create()
399 tcks->af = AF_INET; in tcp_cache_key_src_create()
406 mptcp_version_cache_key_src_init(struct sockaddr *dst, struct tcp_cache_key_src *tcks) in mptcp_version_cache_key_src_init() argument
408 memset(tcks, 0, sizeof(*tcks)); in mptcp_version_cache_key_src_init()
411 memcpy(&tcks->faddr.addr, &SIN(dst)->sin_addr, sizeof(struct in_addr)); in mptcp_version_cache_key_src_init()
412 tcks->af = AF_INET; in mptcp_version_cache_key_src_init()
414 memcpy(&tcks->faddr.addr6, &SIN6(dst)->sin6_addr, sizeof(struct in6_addr)); in mptcp_version_cache_key_src_init()
415 tcks->af = AF_INET6; in mptcp_version_cache_key_src_init()
422 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
428 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_set_cookie_common()
443 struct tcp_cache_key_src tcks; in tcp_cache_set_cookie() local
445 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_set_cookie()
446 tcp_cache_set_cookie_common(&tcks, cookie, len); in tcp_cache_set_cookie()
450 tcp_cache_get_cookie_common(struct tcp_cache_key_src *tcks, in tcp_cache_get_cookie_common() argument
458 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_common()
494 struct tcp_cache_key_src tcks; in tcp_cache_get_cookie() local
496 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_get_cookie()
497 return tcp_cache_get_cookie_common(&tcks, cookie, maxlen, len); in tcp_cache_get_cookie()
501 tcp_cache_get_cookie_len_common(struct tcp_cache_key_src *tcks) in tcp_cache_get_cookie_len_common() argument
508 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_len_common()
523 struct tcp_cache_key_src tcks; in tcp_cache_get_cookie_len() local
525 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_get_cookie_len()
526 return tcp_cache_get_cookie_len_common(&tcks); in tcp_cache_get_cookie_len()
537 struct tcp_cache_key_src tcks; in tcp_cache_get_mptcp_version() local
538 mptcp_version_cache_key_src_init(dst, &tcks); in tcp_cache_get_mptcp_version()
545 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_get_mptcp_version()
568 struct tcp_cache_key_src tcks; in tcp_cache_update_mptcp_version() local
578 mptcp_version_cache_key_src_init(SA(&dst), &tcks); in tcp_cache_update_mptcp_version()
585 mptcp_version_cache_key_src_init(SA(&dst), &tcks); in tcp_cache_update_mptcp_version()
589 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_update_mptcp_version()
630 tcp_heuristics_hash(struct tcp_cache_key_src *tcks, struct tcp_heuristic_key *key) in tcp_heuristics_hash() argument
636 tcp_cache_hash_src(tcks, key); in tcp_heuristics_hash()
665 tcp_getheuristic_with_lock(struct tcp_cache_key_src *tcks, in tcp_getheuristic_with_lock() argument
674 hash = tcp_heuristics_hash(tcks, &key); in tcp_getheuristic_with_lock()
750 tcp_heuristic_reset_counters(struct tcp_cache_key_src *tcks, uint8_t flags) in tcp_heuristic_reset_counters() argument
759 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_reset_counters()
823 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_success() local
826 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_success()
836 tcp_heuristic_reset_counters(&tcks, flag); in tcp_heuristic_tfo_success()
842 struct tcp_cache_key_src tcks; in tcp_heuristic_mptcp_success() local
844 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_mptcp_success()
845 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_MPTCP); in tcp_heuristic_mptcp_success()
851 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_success() local
853 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_success()
854 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristic_ecn_success()
889 tcp_heuristic_tfo_middlebox_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_tfo_middlebox_common() argument
894 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_tfo_middlebox_common()
905 tcp_heuristic_inc_counters(struct tcp_cache_key_src *tcks, in tcp_heuristic_inc_counters() argument
911 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_inc_counters()
975 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, ecn_fallback_synloss); in tcp_heuristic_inc_counters()
988 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, ecn_fallback_ce); in tcp_heuristic_inc_counters()
1001 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, in tcp_heuristic_inc_counters()
1014 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, in tcp_heuristic_inc_counters()
1027 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_loss() local
1035 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_loss()
1044 tcp_heuristic_inc_counters(&tcks, flag); in tcp_heuristic_tfo_loss()
1050 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_rst() local
1053 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_rst()
1062 tcp_heuristic_inc_counters(&tcks, flag); in tcp_heuristic_tfo_rst()
1068 struct tcp_cache_key_src tcks; in tcp_heuristic_mptcp_loss() local
1075 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_mptcp_loss()
1077 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_MPTCP); in tcp_heuristic_mptcp_loss()
1083 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_loss() local
1090 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_loss()
1091 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_SYN_LOSS); in tcp_heuristic_ecn_loss()
1097 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_droprst() local
1099 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_droprst()
1100 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRST); in tcp_heuristic_ecn_droprst()
1106 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_synrst() local
1108 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_synrst()
1109 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_SYNRST); in tcp_heuristic_ecn_synrst()
1115 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_aggressive() local
1117 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_aggressive()
1118 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_AGGRESSIVE); in tcp_heuristic_ecn_aggressive()
1124 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_middlebox() local
1128 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_middlebox()
1129 tcp_heuristic_tfo_middlebox_common(&tcks); in tcp_heuristic_tfo_middlebox()
1133 tcp_heuristic_do_tfo_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_do_tfo_common() argument
1143 tpheur = tcp_getheuristic_with_lock(tcks, 0, &head); in tcp_heuristic_do_tfo_common()
1170 struct tcp_cache_key_src tcks; in tcp_heuristic_do_tfo() local
1172 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_do_tfo()
1173 if (tcp_heuristic_do_tfo_common(&tcks)) { in tcp_heuristic_do_tfo()
1188 struct tcp_cache_key_src tcks; in tcp_heuristic_do_mptcp() local
1198 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_do_mptcp()
1201 tpheur = tcp_getheuristic_with_lock(&tcks, 0, &head); in tcp_heuristic_do_mptcp()
1245 tcp_heuristic_do_ecn_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_do_ecn_common() argument
1256 tpheur = tcp_getheuristic_with_lock(tcks, 0, &head); in tcp_heuristic_do_ecn_common()
1285 struct tcp_cache_key_src tcks; in tcp_heuristic_do_ecn() local
1287 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_do_ecn()
1288 return tcp_heuristic_do_ecn_common(&tcks); in tcp_heuristic_do_ecn()
1295 struct tcp_cache_key_src tcks; in tcp_heuristic_do_ecn_with_address() local
1297 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristic_do_ecn_with_address()
1298 tcks.ifp = ifp; in tcp_heuristic_do_ecn_with_address()
1303 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristic_do_ecn_with_address()
1304 tcks.af = AF_INET6; in tcp_heuristic_do_ecn_with_address()
1306 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristic_do_ecn_with_address()
1307 tcks.af = AF_INET; in tcp_heuristic_do_ecn_with_address()
1310 return tcp_heuristic_do_ecn_common(&tcks); in tcp_heuristic_do_ecn_with_address()
1317 struct tcp_cache_key_src tcks; in tcp_heuristics_ecn_update() local
1319 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristics_ecn_update()
1320 tcks.ifp = ifp; in tcp_heuristics_ecn_update()
1325 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristics_ecn_update()
1326 tcks.af = AF_INET6; in tcp_heuristics_ecn_update()
1328 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristics_ecn_update()
1329 tcks.af = AF_INET; in tcp_heuristics_ecn_update()
1333 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristics_ecn_update()
1335 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_SYN_LOSS); in tcp_heuristics_ecn_update()
1337 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRST); in tcp_heuristics_ecn_update()
1339 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_SYNRST); in tcp_heuristics_ecn_update()
1341 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_AGGRESSIVE); in tcp_heuristics_ecn_update()
1352 struct tcp_cache_key_src tcks; in tcp_heuristic_do_tfo_with_address() local
1354 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristic_do_tfo_with_address()
1355 tcks.ifp = ifp; in tcp_heuristic_do_tfo_with_address()
1360 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristic_do_tfo_with_address()
1361 memcpy(&tcks.faddr.addr6, &remote_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristic_do_tfo_with_address()
1362 tcks.af = AF_INET6; in tcp_heuristic_do_tfo_with_address()
1364 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristic_do_tfo_with_address()
1365 memcpy(&tcks.faddr.addr, &remote_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristic_do_tfo_with_address()
1366 tcks.af = AF_INET; in tcp_heuristic_do_tfo_with_address()
1369 if (tcp_heuristic_do_tfo_common(&tcks)) { in tcp_heuristic_do_tfo_with_address()
1370 if (!tcp_cache_get_cookie_common(&tcks, cookie, maxlen, cookie_len)) { in tcp_heuristic_do_tfo_with_address()
1384 struct tcp_cache_key_src tcks; in tcp_heuristics_tfo_update() local
1386 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristics_tfo_update()
1387 tcks.ifp = ifp; in tcp_heuristics_tfo_update()
1392 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristics_tfo_update()
1393 memcpy(&tcks.faddr.addr6, &remote_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristics_tfo_update()
1394 tcks.af = AF_INET6; in tcp_heuristics_tfo_update()
1396 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristics_tfo_update()
1397 memcpy(&tcks.faddr.addr, &remote_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristics_tfo_update()
1398 tcks.af = AF_INET; in tcp_heuristics_tfo_update()
1402 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_TFO_REQ | TCPCACHE_F_TFO_DATA | in tcp_heuristics_tfo_update()
1407 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_TFO_REQ | TCPCACHE_F_TFO_REQ_RST); in tcp_heuristics_tfo_update()
1411 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ | TCPCACHE_F_TFO_DATA); in tcp_heuristics_tfo_update()
1415 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ); in tcp_heuristics_tfo_update()
1419 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ_RST | TCPCACHE_F_TFO_DATA_RST); in tcp_heuristics_tfo_update()
1423 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ_RST); in tcp_heuristics_tfo_update()
1427 tcp_heuristic_tfo_middlebox_common(&tcks); in tcp_heuristics_tfo_update()
1431 tcp_cache_set_cookie_common(&tcks, in tcp_heuristics_tfo_update()