FreeBSD/sys/netgraph/netflow/netflow.c
/* Generate hash for a given flow6 record. Use lower 4 octets from v6 addresses */
Generate hash for a given flow6 record. Use lower 4 octets from v6 addresses
Generate hash for a given flow6 record . Use lower 4 octets from v6 addresses
static inline uint32_t
ip6_hash(struct flow6_rec *r)
{
	switch (r->r_ip_p) {
	case IPPROTO_TCP:
	case IPPROTO_UDP:
		return FULL_HASH(r->src.r_src6.__u6_addr.__u6_addr32[3],
		    r->dst.r_dst6.__u6_addr.__u6_addr32[3], r->r_sport,
		    r->r_dport);
	default:
		return ADDR_HASH(r->src.r_src6.__u6_addr.__u6_addr32[3],
		    r->dst.r_dst6.__u6_addr.__u6_addr32[3]);
 	}
}
static inline uint32_t ip6_hash ( struct flow6_rec * r ) { switch ( r -> r_ip_p ) { case IPPROTO_TCP : case IPPROTO_UDP : return FULL_HASH ( r -> src . r_src6 . __u6_addr . __u6_addr32 [ 3 ] , r -> dst . r_dst6 . __u6_addr . __u6_addr32 [ 3 ] , r -> r_sport , r -> r_dport ) ; default : return ADDR_HASH ( r -> src . r_src6 . __u6_addr . __u6_addr32 [ 3 ] , r -> dst . r_dst6 . __u6_addr . __u6_addr32 [ 3 ] ) ; } }
Generate hash for a given flow6 record.
Generate hash for a given flow6 record .