示例#1
0
/*
 * Toeplitz hash functions - the idea is to match the hardware.
 */
static __inline int
INP_MPORT_HASH_UDP(in_addr_t faddr, in_addr_t laddr,
		   in_port_t fport, in_port_t lport)
{
	/*
	 * NOTE: laddr could be multicast, since UDP socket could be
	 * bound to multicast address.
	 */
	if (IN_MULTICAST(ntohl(faddr)) || IN_MULTICAST(ntohl(laddr))) {
		/* XXX handle multicast on CPU0 for now */
		return 0;
	}
	return toeplitz_hash(toeplitz_rawhash_addr(faddr, laddr));
}
示例#2
0
static void
toeplitz_verify(void)
{
	in_addr_t faddr, laddr;
	in_port_t fport, lport;

	/*
	 * The first IPv4 example in the verification suite
	 */

	/* 66.9.149.187:2794 */
	faddr = 0xbb950942;
	fport = 0xea0a;

	/* 161.142.100.80:1766 */
	laddr = 0x50648ea1;
	lport = 0xe606;

	kprintf("toeplitz: verify addr/port 0x%08x, addr 0x%08x\n",
		toeplitz_rawhash_addrport(faddr, laddr, fport, lport),
		toeplitz_rawhash_addr(faddr, laddr));
}
示例#3
0
/*
 * Toeplitz hash functions - the idea is to match the hardware.
 */
static __inline int
INP_MPORT_HASH_UDP(in_addr_t faddr, in_addr_t laddr,
		   in_port_t fport, in_port_t lport)
{
	return toeplitz_hash(toeplitz_rawhash_addr(faddr, laddr));
}