Lines Matching refs:tcks
245 tcp_cache_hash_src(struct tcp_cache_key_src *tcks, struct tcp_heuristic_key *key) in tcp_cache_hash_src() argument
247 struct ifnet *ifp = tcks->ifp; in tcp_cache_hash_src()
251 if (tcks->af == AF_INET6) { in tcp_cache_hash_src()
264 memcpy(&key->thk_ip.addr6, &tcks->laddr.addr6, sizeof(struct in6_addr)); in tcp_cache_hash_src()
279 memcpy(&key->thk_ip.addr, &tcks->laddr.addr, sizeof(struct in_addr)); in tcp_cache_hash_src()
285 tcp_cache_hash(struct tcp_cache_key_src *tcks, struct tcp_cache_key *key) in tcp_cache_hash() argument
291 tcp_cache_hash_src(tcks, &key->tck_src); in tcp_cache_hash()
293 if (tcks->af == AF_INET6) { in tcp_cache_hash()
295 memcpy(&key->tck_dst.addr6, &tcks->faddr.addr6, in tcp_cache_hash()
299 memcpy(&key->tck_dst.addr, &tcks->faddr.addr, in tcp_cache_hash()
326 tcp_getcache_with_lock(struct tcp_cache_key_src *tcks, in tcp_getcache_with_lock() argument
335 hash = tcp_cache_hash(tcks, &key); in tcp_getcache_with_lock()
399 tcp_cache_key_src_create(struct tcpcb *tp, struct tcp_cache_key_src *tcks) in tcp_cache_key_src_create() argument
402 memset(tcks, 0, sizeof(*tcks)); in tcp_cache_key_src_create()
404 tcks->ifp = inp->inp_last_outifp; in tcp_cache_key_src_create()
407 memcpy(&tcks->laddr.addr6, &inp->in6p_laddr, sizeof(struct in6_addr)); in tcp_cache_key_src_create()
408 memcpy(&tcks->faddr.addr6, &inp->in6p_faddr, sizeof(struct in6_addr)); in tcp_cache_key_src_create()
409 tcks->af = AF_INET6; in tcp_cache_key_src_create()
411 memcpy(&tcks->laddr.addr, &inp->inp_laddr, sizeof(struct in_addr)); in tcp_cache_key_src_create()
412 memcpy(&tcks->faddr.addr, &inp->inp_faddr, sizeof(struct in_addr)); in tcp_cache_key_src_create()
413 tcks->af = AF_INET; in tcp_cache_key_src_create()
420 mptcp_version_cache_key_src_init(struct sockaddr *dst, struct tcp_cache_key_src *tcks) in mptcp_version_cache_key_src_init() argument
422 memset(tcks, 0, sizeof(*tcks)); in mptcp_version_cache_key_src_init()
425 memcpy(&tcks->faddr.addr, &SIN(dst)->sin_addr, sizeof(struct in_addr)); in mptcp_version_cache_key_src_init()
426 tcks->af = AF_INET; in mptcp_version_cache_key_src_init()
428 memcpy(&tcks->faddr.addr6, &SIN6(dst)->sin6_addr, sizeof(struct in6_addr)); in mptcp_version_cache_key_src_init()
429 tcks->af = AF_INET6; in mptcp_version_cache_key_src_init()
436 tcp_cache_set_cookie_common(struct tcp_cache_key_src *tcks, u_char *cookie, uint8_t len) in tcp_cache_set_cookie_common() argument
442 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_set_cookie_common()
457 struct tcp_cache_key_src tcks; in tcp_cache_set_cookie() local
459 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_set_cookie()
460 tcp_cache_set_cookie_common(&tcks, cookie, len); in tcp_cache_set_cookie()
464 tcp_cache_get_cookie_common(struct tcp_cache_key_src *tcks, u_char *cookie, uint8_t *len) in tcp_cache_get_cookie_common() argument
470 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_common()
505 struct tcp_cache_key_src tcks; in tcp_cache_get_cookie() local
507 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_get_cookie()
508 return tcp_cache_get_cookie_common(&tcks, cookie, len); in tcp_cache_get_cookie()
512 tcp_cache_get_cookie_len_common(struct tcp_cache_key_src *tcks) in tcp_cache_get_cookie_len_common() argument
519 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_len_common()
534 struct tcp_cache_key_src tcks; in tcp_cache_get_cookie_len() local
536 tcp_cache_key_src_create(tp, &tcks); in tcp_cache_get_cookie_len()
537 return tcp_cache_get_cookie_len_common(&tcks); in tcp_cache_get_cookie_len()
548 struct tcp_cache_key_src tcks; in tcp_cache_get_mptcp_version() local
549 mptcp_version_cache_key_src_init(dst, &tcks); in tcp_cache_get_mptcp_version()
556 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_get_mptcp_version()
581 struct tcp_cache_key_src tcks; in tcp_cache_update_mptcp_version() local
590 mptcp_version_cache_key_src_init((struct sockaddr *)&dst, &tcks); in tcp_cache_update_mptcp_version()
597 mptcp_version_cache_key_src_init((struct sockaddr *)&dst, &tcks); in tcp_cache_update_mptcp_version()
603 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_update_mptcp_version()
652 tcp_heuristics_hash(struct tcp_cache_key_src *tcks, struct tcp_heuristic_key *key) in tcp_heuristics_hash() argument
658 tcp_cache_hash_src(tcks, key); in tcp_heuristics_hash()
687 tcp_getheuristic_with_lock(struct tcp_cache_key_src *tcks, in tcp_getheuristic_with_lock() argument
696 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, 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()