aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/addr.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/addr.h')
-rw-r--r--net/tipc/addr.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/net/tipc/addr.h b/net/tipc/addr.h
index e4f35afe3207..60b00ab93d74 100644
--- a/net/tipc/addr.h
+++ b/net/tipc/addr.h
@@ -50,18 +50,33 @@ static inline u32 tipc_cluster_mask(u32 addr)
50 return addr & TIPC_CLUSTER_MASK; 50 return addr & TIPC_CLUSTER_MASK;
51} 51}
52 52
53static inline int in_own_cluster(u32 addr) 53static inline int in_own_cluster_exact(u32 addr)
54{ 54{
55 return !((addr ^ tipc_own_addr) >> 12); 55 return !((addr ^ tipc_own_addr) >> 12);
56} 56}
57 57
58/** 58/**
59 * in_own_node - test for node inclusion; <0.0.0> always matches
60 */
61static inline int in_own_node(u32 addr)
62{
63 return (addr == tipc_own_addr) || !addr;
64}
65
66/**
67 * in_own_cluster - test for cluster inclusion; <0.0.0> always matches
68 */
69static inline int in_own_cluster(u32 addr)
70{
71 return in_own_cluster_exact(addr) || !addr;
72}
73
74/**
59 * addr_domain - convert 2-bit scope value to equivalent message lookup domain 75 * addr_domain - convert 2-bit scope value to equivalent message lookup domain
60 * 76 *
61 * Needed when address of a named message must be looked up a second time 77 * Needed when address of a named message must be looked up a second time
62 * after a network hop. 78 * after a network hop.
63 */ 79 */
64
65static inline u32 addr_domain(u32 sc) 80static inline u32 addr_domain(u32 sc)
66{ 81{
67 if (likely(sc == TIPC_NODE_SCOPE)) 82 if (likely(sc == TIPC_NODE_SCOPE))