MCPcopy Create free account
hub / github.com/F-Stack/f-stack / syncache_hashbucket

Function syncache_hashbucket

freebsd/netinet/tcp_syncache.c:561–577  ·  view source on GitHub ↗

* Find the hash bucket for the given connection. */

Source from the content-addressed store, hash-verified

559 * Find the hash bucket for the given connection.
560 */
561static struct syncache_head *
562syncache_hashbucket(struct in_conninfo *inc)
563{
564 uint32_t hash;
565
566 /*
567 * The hash is built on foreign port + local port + foreign address.
568 * We rely on the fact that struct in_conninfo starts with 16 bits
569 * of foreign port, then 16 bits of local port then followed by 128
570 * bits of foreign address. In case of IPv4 address, the first 3
571 * 32-bit words of the address always are zeroes.
572 */
573 hash = jenkins_hash32((uint32_t *)&inc->inc_ie, 5,
574 V_tcp_syncache.hash_secret) & V_tcp_syncache.hashmask;
575
576 return (&V_tcp_syncache.hashbase[hash]);
577}
578
579/*
580 * Find an entry in the syncache.

Callers 3

syncache_lookupFunction · 0.85
syncache_expandFunction · 0.85
syncache_addFunction · 0.85

Calls 1

jenkins_hash32Function · 0.85

Tested by

no test coverage detected