diff options
Diffstat (limited to 'net/tipc/addr.h')
-rw-r--r-- | net/tipc/addr.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/net/tipc/addr.h b/net/tipc/addr.h index e4f35afe320..d706a1d92be 100644 --- a/net/tipc/addr.h +++ b/net/tipc/addr.h @@ -50,12 +50,30 @@ static inline u32 tipc_cluster_mask(u32 addr) return addr & TIPC_CLUSTER_MASK; } -static inline int in_own_cluster(u32 addr) +static inline int in_own_cluster_exact(u32 addr) { return !((addr ^ tipc_own_addr) >> 12); } /** + * in_own_node - test for node inclusion; <0.0.0> always matches + */ + +static inline int in_own_node(u32 addr) +{ + return (addr == tipc_own_addr) || !addr; +} + +/** + * in_own_cluster - test for cluster inclusion; <0.0.0> always matches + */ + +static inline int in_own_cluster(u32 addr) +{ + return in_own_cluster_exact(addr) || !addr; +} + +/** * addr_domain - convert 2-bit scope value to equivalent message lookup domain * * Needed when address of a named message must be looked up a second time |