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

Function ip6_hash

freebsd/netgraph/netflow/netflow.c:146–160  ·  view source on GitHub ↗

Generate hash for a given flow6 record. Use lower 4 octets from v6 addresses */

Source from the content-addressed store, hash-verified

144#ifdef INET6
145/* Generate hash for a given flow6 record. Use lower 4 octets from v6 addresses */
146static inline uint32_t
147ip6_hash(struct flow6_rec *r)
148{
149
150 switch (r->r_ip_p) {
151 case IPPROTO_TCP:
152 case IPPROTO_UDP:
153 return FULL_HASH(r->src.r_src6.__u6_addr.__u6_addr32[3],
154 r->dst.r_dst6.__u6_addr.__u6_addr32[3], r->r_sport,
155 r->r_dport);
156 default:
157 return ADDR_HASH(r->src.r_src6.__u6_addr.__u6_addr32[3],
158 r->dst.r_dst6.__u6_addr.__u6_addr32[3]);
159 }
160}
161
162#endif
163

Callers 1

ng_netflow_flow6_addFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected