diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-20 20:40:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-20 20:40:31 -0400 |
commit | 167de77fd4e5646f98f67bd9f0a0054a891f6ff4 (patch) | |
tree | abe31d384dbe9c7bad0da839600423d1eda4b6e2 /net/tipc/addr.h | |
parent | 2528a5dc4331aebbb990f2a56d179dfa35de4a4f (diff) | |
parent | 9d52ce4bd3fa9e0cf1658791f2c680e20e0598a1 (diff) |
Merge branch 'tipc_net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
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 |