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

Function pf_hashsrc

freebsd/netpfil/pf/pf.c:446–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446static __inline uint32_t
447pf_hashsrc(struct pf_addr *addr, sa_family_t af)
448{
449 uint32_t h;
450
451 switch (af) {
452 case AF_INET:
453 h = murmur3_32_hash32((uint32_t *)&addr->v4,
454 sizeof(addr->v4)/sizeof(uint32_t), V_pf_hashseed);
455 break;
456 case AF_INET6:
457 h = murmur3_32_hash32((uint32_t *)&addr->v6,
458 sizeof(addr->v6)/sizeof(uint32_t), V_pf_hashseed);
459 break;
460 default:
461 panic("%s: unknown address family %u", __func__, af);
462 }
463
464 return (h & pf_srchashmask);
465}
466
467#ifdef ALTQ
468static int

Callers 5

pf_find_src_nodeFunction · 0.85
pf_insert_src_nodeFunction · 0.85
pf_unlink_src_nodeFunction · 0.85
pf_src_tree_remove_stateFunction · 0.85
pf_create_stateFunction · 0.85

Calls 2

murmur3_32_hash32Function · 0.85
panicFunction · 0.50

Tested by

no test coverage detected