Lines Matching refs:tcks

249 tcp_cache_hash_src(struct tcp_cache_key_src *tcks, struct tcp_heuristic_key *key)  in tcp_cache_hash_src()  argument
251 struct ifnet *ifp = tcks->ifp; in tcp_cache_hash_src()
255 if (tcks->af == AF_INET6) { in tcp_cache_hash_src()
268 memcpy(&key->thk_ip.addr6, &tcks->laddr.addr6, sizeof(struct in6_addr)); in tcp_cache_hash_src()
283 memcpy(&key->thk_ip.addr, &tcks->laddr.addr, sizeof(struct in_addr)); in tcp_cache_hash_src()
289 tcp_cache_hash(struct tcp_cache_key_src *tcks, struct tcp_cache_key *key) in tcp_cache_hash() argument
295 tcp_cache_hash_src(tcks, &key->tck_src); in tcp_cache_hash()
297 if (tcks->af == AF_INET6) { in tcp_cache_hash()
299 memcpy(&key->tck_dst.addr6, &tcks->faddr.addr6, in tcp_cache_hash()
303 memcpy(&key->tck_dst.addr, &tcks->faddr.addr, in tcp_cache_hash()
330 tcp_getcache_with_lock(struct tcp_cache_key_src *tcks, in tcp_getcache_with_lock() argument
339 hash = tcp_cache_hash(tcks, &key); in tcp_getcache_with_lock()
406 tcp_cache_key_src_create(struct tcpcb *tp, struct tcp_cache_key_src *tcks) in tcp_cache_key_src_create() argument
409 memset(tcks, 0, sizeof(*tcks)); in tcp_cache_key_src_create()
411 tcks->ifp = inp->inp_last_outifp; in tcp_cache_key_src_create()
414 memcpy(&tcks->laddr.addr6, &inp->in6p_laddr, sizeof(struct in6_addr)); in tcp_cache_key_src_create()
415 memcpy(&tcks->faddr.addr6, &inp->in6p_faddr, sizeof(struct in6_addr)); in tcp_cache_key_src_create()
416 tcks->af = AF_INET6; in tcp_cache_key_src_create()
418 memcpy(&tcks->laddr.addr, &inp->inp_laddr, sizeof(struct in_addr)); in tcp_cache_key_src_create()
419 memcpy(&tcks->faddr.addr, &inp->inp_faddr, sizeof(struct in_addr)); in tcp_cache_key_src_create()
420 tcks->af = AF_INET; in tcp_cache_key_src_create()
427 mptcp_version_cache_key_src_init(struct sockaddr *dst, struct tcp_cache_key_src *tcks) in mptcp_version_cache_key_src_init() argument
429 memset(tcks, 0, sizeof(*tcks)); in mptcp_version_cache_key_src_init()
432 memcpy(&tcks->faddr.addr, &SIN(dst)->sin_addr, sizeof(struct in_addr)); in mptcp_version_cache_key_src_init()
433 tcks->af = AF_INET; in mptcp_version_cache_key_src_init()
435 memcpy(&tcks->faddr.addr6, &SIN6(dst)->sin6_addr, sizeof(struct in6_addr)); in mptcp_version_cache_key_src_init()
436 tcks->af = AF_INET6; in mptcp_version_cache_key_src_init()
443 tcp_cache_set_cookie_common(struct tcp_cache_key_src *tcks, u_char *cookie, uint8_t len) in tcp_cache_set_cookie_common() argument
449 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_set_cookie_common()
464 struct tcp_cache_key_src tcks; in tcp_cache_set_cookie() local
466 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_set_cookie()
467 tcp_cache_set_cookie_common(&tcks, cookie, len); in tcp_cache_set_cookie()
471 tcp_cache_get_cookie_common(struct tcp_cache_key_src *tcks, u_char *cookie, uint8_t *len) in tcp_cache_get_cookie_common() argument
477 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_common()
512 struct tcp_cache_key_src tcks; in tcp_cache_get_cookie() local
514 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_get_cookie()
515 return tcp_cache_get_cookie_common(&tcks, cookie, len); in tcp_cache_get_cookie()
519 tcp_cache_get_cookie_len_common(struct tcp_cache_key_src *tcks) in tcp_cache_get_cookie_len_common() argument
526 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_len_common()
541 struct tcp_cache_key_src tcks; in tcp_cache_get_cookie_len() local
543 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_get_cookie_len()
544 return tcp_cache_get_cookie_len_common(&tcks); in tcp_cache_get_cookie_len()
555 struct tcp_cache_key_src tcks; in tcp_cache_get_mptcp_version() local
556 mptcp_version_cache_key_src_init(dst, &tcks); in tcp_cache_get_mptcp_version()
563 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_get_mptcp_version()
586 struct tcp_cache_key_src tcks; in tcp_cache_update_mptcp_version() local
596 mptcp_version_cache_key_src_init(SA(&dst), &tcks); in tcp_cache_update_mptcp_version()
603 mptcp_version_cache_key_src_init(SA(&dst), &tcks); in tcp_cache_update_mptcp_version()
607 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_update_mptcp_version()
648 tcp_heuristics_hash(struct tcp_cache_key_src *tcks, struct tcp_heuristic_key *key) in tcp_heuristics_hash() argument
654 tcp_cache_hash_src(tcks, key); in tcp_heuristics_hash()
683 tcp_getheuristic_with_lock(struct tcp_cache_key_src *tcks, in tcp_getheuristic_with_lock() argument
692 hash = tcp_heuristics_hash(tcks, &key); in tcp_getheuristic_with_lock()
766 tcp_heuristic_reset_counters(struct tcp_cache_key_src *tcks, uint8_t flags) in tcp_heuristic_reset_counters() argument
775 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_reset_counters()
841 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_success() local
844 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_success()
854 tcp_heuristic_reset_counters(&tcks, flag); in tcp_heuristic_tfo_success()
860 struct tcp_cache_key_src tcks; in tcp_heuristic_mptcp_success() local
862 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_mptcp_success()
863 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_MPTCP); in tcp_heuristic_mptcp_success()
869 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_success() local
871 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_success()
872 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristic_ecn_success()
907 tcp_heuristic_tfo_middlebox_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_tfo_middlebox_common() argument
912 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_tfo_middlebox_common()
923 tcp_heuristic_inc_counters(struct tcp_cache_key_src *tcks, in tcp_heuristic_inc_counters() argument
929 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_inc_counters()
973 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, ecn_fallback_synloss); in tcp_heuristic_inc_counters()
1010 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, in tcp_heuristic_inc_counters()
1028 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, in tcp_heuristic_inc_counters()
1044 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, in tcp_heuristic_inc_counters()
1061 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_loss() local
1069 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_loss()
1078 tcp_heuristic_inc_counters(&tcks, flag); in tcp_heuristic_tfo_loss()
1084 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_rst() local
1087 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_rst()
1096 tcp_heuristic_inc_counters(&tcks, flag); in tcp_heuristic_tfo_rst()
1102 struct tcp_cache_key_src tcks; in tcp_heuristic_mptcp_loss() local
1109 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_mptcp_loss()
1111 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_MPTCP); in tcp_heuristic_mptcp_loss()
1117 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_loss() local
1124 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_loss()
1126 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristic_ecn_loss()
1132 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_droprst() local
1134 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_droprst()
1136 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRST); in tcp_heuristic_ecn_droprst()
1142 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_droprxmt() local
1144 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_droprxmt()
1146 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRXMT); in tcp_heuristic_ecn_droprxmt()
1152 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_synrst() local
1154 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_synrst()
1156 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_SYNRST); in tcp_heuristic_ecn_synrst()
1162 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_middlebox() local
1166 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_middlebox()
1167 tcp_heuristic_tfo_middlebox_common(&tcks); in tcp_heuristic_tfo_middlebox()
1171 tcp_heuristic_ecn_aggressive_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_ecn_aggressive_common() argument
1176 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_ecn_aggressive_common()
1208 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_aggressive() local
1210 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_aggressive()
1211 tcp_heuristic_ecn_aggressive_common(&tcks); in tcp_heuristic_ecn_aggressive()
1215 tcp_heuristic_do_tfo_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_do_tfo_common() argument
1225 tpheur = tcp_getheuristic_with_lock(tcks, 0, &head); in tcp_heuristic_do_tfo_common()
1252 struct tcp_cache_key_src tcks; in tcp_heuristic_do_tfo() local
1254 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_do_tfo()
1255 if (tcp_heuristic_do_tfo_common(&tcks)) { in tcp_heuristic_do_tfo()
1270 struct tcp_cache_key_src tcks; in tcp_heuristic_do_mptcp() local
1280 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_do_mptcp()
1283 tpheur = tcp_getheuristic_with_lock(&tcks, 0, &head); in tcp_heuristic_do_mptcp()
1327 tcp_heuristic_do_ecn_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_do_ecn_common() argument
1338 tpheur = tcp_getheuristic_with_lock(tcks, 0, &head); in tcp_heuristic_do_ecn_common()
1369 struct tcp_cache_key_src tcks; in tcp_heuristic_do_ecn() local
1371 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_do_ecn()
1372 return tcp_heuristic_do_ecn_common(&tcks); in tcp_heuristic_do_ecn()
1379 struct tcp_cache_key_src tcks; in tcp_heuristic_do_ecn_with_address() local
1381 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristic_do_ecn_with_address()
1382 tcks.ifp = ifp; in tcp_heuristic_do_ecn_with_address()
1387 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristic_do_ecn_with_address()
1388 tcks.af = AF_INET6; in tcp_heuristic_do_ecn_with_address()
1390 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristic_do_ecn_with_address()
1391 tcks.af = AF_INET; in tcp_heuristic_do_ecn_with_address()
1394 return tcp_heuristic_do_ecn_common(&tcks); in tcp_heuristic_do_ecn_with_address()
1401 struct tcp_cache_key_src tcks; in tcp_heuristics_ecn_update() local
1403 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristics_ecn_update()
1404 tcks.ifp = ifp; in tcp_heuristics_ecn_update()
1409 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristics_ecn_update()
1410 tcks.af = AF_INET6; in tcp_heuristics_ecn_update()
1412 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristics_ecn_update()
1413 tcks.af = AF_INET; in tcp_heuristics_ecn_update()
1417 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristics_ecn_update()
1419 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristics_ecn_update()
1421 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRST); in tcp_heuristics_ecn_update()
1423 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRXMT); in tcp_heuristics_ecn_update()
1425 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_SYNRST); in tcp_heuristics_ecn_update()
1427 tcp_heuristic_ecn_aggressive_common(&tcks); in tcp_heuristics_ecn_update()
1438 struct tcp_cache_key_src tcks; in tcp_heuristic_do_tfo_with_address() local
1440 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristic_do_tfo_with_address()
1441 tcks.ifp = ifp; in tcp_heuristic_do_tfo_with_address()
1446 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristic_do_tfo_with_address()
1447 memcpy(&tcks.faddr.addr6, &remote_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristic_do_tfo_with_address()
1448 tcks.af = AF_INET6; in tcp_heuristic_do_tfo_with_address()
1450 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristic_do_tfo_with_address()
1451 memcpy(&tcks.faddr.addr, &remote_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristic_do_tfo_with_address()
1452 tcks.af = AF_INET; in tcp_heuristic_do_tfo_with_address()
1455 if (tcp_heuristic_do_tfo_common(&tcks)) { in tcp_heuristic_do_tfo_with_address()
1456 if (!tcp_cache_get_cookie_common(&tcks, cookie, cookie_len)) { in tcp_heuristic_do_tfo_with_address()
1470 struct tcp_cache_key_src tcks; in tcp_heuristics_tfo_update() local
1472 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristics_tfo_update()
1473 tcks.ifp = ifp; in tcp_heuristics_tfo_update()
1478 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristics_tfo_update()
1479 memcpy(&tcks.faddr.addr6, &remote_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristics_tfo_update()
1480 tcks.af = AF_INET6; in tcp_heuristics_tfo_update()
1482 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristics_tfo_update()
1483 memcpy(&tcks.faddr.addr, &remote_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristics_tfo_update()
1484 tcks.af = AF_INET; in tcp_heuristics_tfo_update()
1488 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_TFO_REQ | TCPCACHE_F_TFO_DATA | in tcp_heuristics_tfo_update()
1493 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_TFO_REQ | TCPCACHE_F_TFO_REQ_RST); in tcp_heuristics_tfo_update()
1497 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ | TCPCACHE_F_TFO_DATA); in tcp_heuristics_tfo_update()
1501 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ); in tcp_heuristics_tfo_update()
1505 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ_RST | TCPCACHE_F_TFO_DATA_RST); in tcp_heuristics_tfo_update()
1509 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ_RST); in tcp_heuristics_tfo_update()
1513 tcp_heuristic_tfo_middlebox_common(&tcks); in tcp_heuristics_tfo_update()
1517 tcp_cache_set_cookie_common(&tcks, in tcp_heuristics_tfo_update()