Lines Matching refs:addr
63 * @addr: IPv4 address
70 static unsigned int sel_netnode_hashfn_ipv4(__be32 addr)
74 return (addr & (SEL_NETNODE_HASH_SIZE - 1));
79 * @addr: IPv6 address
86 static unsigned int sel_netnode_hashfn_ipv6(const struct in6_addr *addr)
91 return (addr->s6_addr32[3] & (SEL_NETNODE_HASH_SIZE - 1));
96 * @addr: IP address
100 * Search the network node table and return the record matching @addr. If an
104 static struct sel_netnode *sel_netnode_find(const void *addr, u16 family)
111 idx = sel_netnode_hashfn_ipv4(*(__be32 *)addr);
114 idx = sel_netnode_hashfn_ipv6(addr);
125 if (node->nsec.addr.ipv4 == *(__be32 *)addr)
129 if (ipv6_addr_equal(&node->nsec.addr.ipv6,
130 addr))
152 idx = sel_netnode_hashfn_ipv4(node->nsec.addr.ipv4);
155 idx = sel_netnode_hashfn_ipv6(&node->nsec.addr.ipv6);
179 * @addr: the IP address
190 static int sel_netnode_sid_slow(void *addr, u16 family, u32 *sid)
197 node = sel_netnode_find(addr, family);
208 addr, sizeof(struct in_addr), sid);
210 new->nsec.addr.ipv4 = *(__be32 *)addr;
214 addr, sizeof(struct in6_addr), sid);
216 new->nsec.addr.ipv6 = *(struct in6_addr *)addr;
238 * @addr: the IP address
250 int sel_netnode_sid(void *addr, u16 family, u32 *sid)
255 node = sel_netnode_find(addr, family);
263 return sel_netnode_sid_slow(addr, family, sid);