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 *cookie, uint8_t len) 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, u_char *cookie, uint8_t *len) in tcp_cache_get_cookie_common() argument
476 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_common()
511 struct tcp_cache_key_src tcks; in tcp_cache_get_cookie() local
513 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_get_cookie()
514 return tcp_cache_get_cookie_common(&tcks, cookie, len); in tcp_cache_get_cookie()
518 tcp_cache_get_cookie_len_common(struct tcp_cache_key_src *tcks) in tcp_cache_get_cookie_len_common() argument
525 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_len_common()
540 struct tcp_cache_key_src tcks; in tcp_cache_get_cookie_len() local
542 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_get_cookie_len()
543 return tcp_cache_get_cookie_len_common(&tcks); in tcp_cache_get_cookie_len()
554 struct tcp_cache_key_src tcks; in tcp_cache_get_mptcp_version() local
555 mptcp_version_cache_key_src_init(dst, &tcks); in tcp_cache_get_mptcp_version()
562 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_get_mptcp_version()
585 struct tcp_cache_key_src tcks; in tcp_cache_update_mptcp_version() local
595 mptcp_version_cache_key_src_init((struct sockaddr *)&dst, &tcks); in tcp_cache_update_mptcp_version()
602 mptcp_version_cache_key_src_init((struct sockaddr *)&dst, &tcks); in tcp_cache_update_mptcp_version()
606 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_update_mptcp_version()
647 tcp_heuristics_hash(struct tcp_cache_key_src *tcks, struct tcp_heuristic_key *key) in tcp_heuristics_hash() argument
653 tcp_cache_hash_src(tcks, key); in tcp_heuristics_hash()
682 tcp_getheuristic_with_lock(struct tcp_cache_key_src *tcks, in tcp_getheuristic_with_lock() argument
691 hash = tcp_heuristics_hash(tcks, &key); in tcp_getheuristic_with_lock()
765 tcp_heuristic_reset_counters(struct tcp_cache_key_src *tcks, uint8_t flags) in tcp_heuristic_reset_counters() argument
774 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_reset_counters()
840 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_success() local
843 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_success()
853 tcp_heuristic_reset_counters(&tcks, flag); in tcp_heuristic_tfo_success()
859 struct tcp_cache_key_src tcks; in tcp_heuristic_mptcp_success() local
861 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_mptcp_success()
862 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_MPTCP); in tcp_heuristic_mptcp_success()
868 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_success() local
870 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_success()
871 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristic_ecn_success()
906 tcp_heuristic_tfo_middlebox_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_tfo_middlebox_common() argument
911 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_tfo_middlebox_common()
922 tcp_heuristic_inc_counters(struct tcp_cache_key_src *tcks, in tcp_heuristic_inc_counters() argument
928 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_inc_counters()
972 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, ecn_fallback_synloss); in tcp_heuristic_inc_counters()
1009 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, in tcp_heuristic_inc_counters()
1027 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, in tcp_heuristic_inc_counters()
1043 TCP_CACHE_INC_IFNET_STAT(tcks->ifp, tcks->af, in tcp_heuristic_inc_counters()
1060 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_loss() local
1068 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_loss()
1077 tcp_heuristic_inc_counters(&tcks, flag); in tcp_heuristic_tfo_loss()
1083 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_rst() local
1086 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_rst()
1095 tcp_heuristic_inc_counters(&tcks, flag); in tcp_heuristic_tfo_rst()
1101 struct tcp_cache_key_src tcks; in tcp_heuristic_mptcp_loss() local
1108 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_mptcp_loss()
1110 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_MPTCP); in tcp_heuristic_mptcp_loss()
1116 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_loss() local
1123 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_loss()
1125 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristic_ecn_loss()
1131 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_droprst() local
1133 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_droprst()
1135 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRST); in tcp_heuristic_ecn_droprst()
1141 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_droprxmt() local
1143 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_droprxmt()
1145 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRXMT); in tcp_heuristic_ecn_droprxmt()
1151 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_synrst() local
1153 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_synrst()
1155 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_SYNRST); in tcp_heuristic_ecn_synrst()
1161 struct tcp_cache_key_src tcks; in tcp_heuristic_tfo_middlebox() local
1165 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_tfo_middlebox()
1166 tcp_heuristic_tfo_middlebox_common(&tcks); in tcp_heuristic_tfo_middlebox()
1170 tcp_heuristic_ecn_aggressive_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_ecn_aggressive_common() argument
1175 tpheur = tcp_getheuristic_with_lock(tcks, 1, &head); in tcp_heuristic_ecn_aggressive_common()
1207 struct tcp_cache_key_src tcks; in tcp_heuristic_ecn_aggressive() local
1209 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_ecn_aggressive()
1210 tcp_heuristic_ecn_aggressive_common(&tcks); in tcp_heuristic_ecn_aggressive()
1214 tcp_heuristic_do_tfo_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_do_tfo_common() argument
1224 tpheur = tcp_getheuristic_with_lock(tcks, 0, &head); in tcp_heuristic_do_tfo_common()
1251 struct tcp_cache_key_src tcks; in tcp_heuristic_do_tfo() local
1253 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_do_tfo()
1254 if (tcp_heuristic_do_tfo_common(&tcks)) { in tcp_heuristic_do_tfo()
1269 struct tcp_cache_key_src tcks; in tcp_heuristic_do_mptcp() local
1279 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_do_mptcp()
1282 tpheur = tcp_getheuristic_with_lock(&tcks, 0, &head); in tcp_heuristic_do_mptcp()
1326 tcp_heuristic_do_ecn_common(struct tcp_cache_key_src *tcks) in tcp_heuristic_do_ecn_common() argument
1337 tpheur = tcp_getheuristic_with_lock(tcks, 0, &head); in tcp_heuristic_do_ecn_common()
1368 struct tcp_cache_key_src tcks; in tcp_heuristic_do_ecn() local
1370 tcp_cache_key_src_create(tp, &tcks); in tcp_heuristic_do_ecn()
1371 return tcp_heuristic_do_ecn_common(&tcks); in tcp_heuristic_do_ecn()
1378 struct tcp_cache_key_src tcks; in tcp_heuristic_do_ecn_with_address() local
1380 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristic_do_ecn_with_address()
1381 tcks.ifp = ifp; in tcp_heuristic_do_ecn_with_address()
1386 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristic_do_ecn_with_address()
1387 tcks.af = AF_INET6; in tcp_heuristic_do_ecn_with_address()
1389 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristic_do_ecn_with_address()
1390 tcks.af = AF_INET; in tcp_heuristic_do_ecn_with_address()
1393 return tcp_heuristic_do_ecn_common(&tcks); in tcp_heuristic_do_ecn_with_address()
1400 struct tcp_cache_key_src tcks; in tcp_heuristics_ecn_update() local
1402 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristics_ecn_update()
1403 tcks.ifp = ifp; in tcp_heuristics_ecn_update()
1408 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristics_ecn_update()
1409 tcks.af = AF_INET6; in tcp_heuristics_ecn_update()
1411 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristics_ecn_update()
1412 tcks.af = AF_INET; in tcp_heuristics_ecn_update()
1416 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristics_ecn_update()
1418 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN); in tcp_heuristics_ecn_update()
1420 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRST); in tcp_heuristics_ecn_update()
1422 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_DROPRXMT); in tcp_heuristics_ecn_update()
1424 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_ECN_SYNRST); in tcp_heuristics_ecn_update()
1426 tcp_heuristic_ecn_aggressive_common(&tcks); in tcp_heuristics_ecn_update()
1437 struct tcp_cache_key_src tcks; in tcp_heuristic_do_tfo_with_address() local
1439 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristic_do_tfo_with_address()
1440 tcks.ifp = ifp; in tcp_heuristic_do_tfo_with_address()
1445 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristic_do_tfo_with_address()
1446 memcpy(&tcks.faddr.addr6, &remote_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristic_do_tfo_with_address()
1447 tcks.af = AF_INET6; in tcp_heuristic_do_tfo_with_address()
1449 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristic_do_tfo_with_address()
1450 memcpy(&tcks.faddr.addr, &remote_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristic_do_tfo_with_address()
1451 tcks.af = AF_INET; in tcp_heuristic_do_tfo_with_address()
1454 if (tcp_heuristic_do_tfo_common(&tcks)) { in tcp_heuristic_do_tfo_with_address()
1455 if (!tcp_cache_get_cookie_common(&tcks, cookie, cookie_len)) { in tcp_heuristic_do_tfo_with_address()
1469 struct tcp_cache_key_src tcks; in tcp_heuristics_tfo_update() local
1471 memset(&tcks, 0, sizeof(tcks)); in tcp_heuristics_tfo_update()
1472 tcks.ifp = ifp; in tcp_heuristics_tfo_update()
1477 memcpy(&tcks.laddr.addr6, &local_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristics_tfo_update()
1478 memcpy(&tcks.faddr.addr6, &remote_address->sin6.sin6_addr, sizeof(struct in6_addr)); in tcp_heuristics_tfo_update()
1479 tcks.af = AF_INET6; in tcp_heuristics_tfo_update()
1481 memcpy(&tcks.laddr.addr, &local_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristics_tfo_update()
1482 memcpy(&tcks.faddr.addr, &remote_address->sin.sin_addr, sizeof(struct in_addr)); in tcp_heuristics_tfo_update()
1483 tcks.af = AF_INET; in tcp_heuristics_tfo_update()
1487 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_TFO_REQ | TCPCACHE_F_TFO_DATA | in tcp_heuristics_tfo_update()
1492 tcp_heuristic_reset_counters(&tcks, TCPCACHE_F_TFO_REQ | TCPCACHE_F_TFO_REQ_RST); in tcp_heuristics_tfo_update()
1496 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ | TCPCACHE_F_TFO_DATA); in tcp_heuristics_tfo_update()
1500 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ); in tcp_heuristics_tfo_update()
1504 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ_RST | TCPCACHE_F_TFO_DATA_RST); in tcp_heuristics_tfo_update()
1508 tcp_heuristic_inc_counters(&tcks, TCPCACHE_F_TFO_REQ_RST); in tcp_heuristics_tfo_update()
1512 tcp_heuristic_tfo_middlebox_common(&tcks); in tcp_heuristics_tfo_update()
1516 tcp_cache_set_cookie_common(&tcks, in tcp_heuristics_tfo_update()