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 e4f35afe3207..d706a1d92be8 100644 --- a/net/tipc/addr.h +++ b/net/tipc/addr.h | |||
@@ -50,12 +50,30 @@ static inline u32 tipc_cluster_mask(u32 addr) | |||
50 | return addr & TIPC_CLUSTER_MASK; | 50 | return addr & TIPC_CLUSTER_MASK; |
51 | } | 51 | } |
52 | 52 | ||
53 | static inline int in_own_cluster(u32 addr) | 53 | static 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 | */ | ||
61 | |||
62 | static inline int in_own_node(u32 addr) | ||
63 | { | ||
64 | return (addr == tipc_own_addr) || !addr; | ||
65 | } | ||
66 | |||
67 | /** | ||
68 | * in_own_cluster - test for cluster inclusion; <0.0.0> always matches | ||
69 | */ | ||
70 | |||
71 | static inline int in_own_cluster(u32 addr) | ||
72 | { | ||
73 | return in_own_cluster_exact(addr) || !addr; | ||
74 | } | ||
75 | |||
76 | /** | ||
59 | * addr_domain - convert 2-bit scope value to equivalent message lookup domain | 77 | * addr_domain - convert 2-bit scope value to equivalent message lookup domain |
60 | * | 78 | * |
61 | * Needed when address of a named message must be looked up a second time | 79 | * Needed when address of a named message must be looked up a second time |