diff options
Diffstat (limited to 'net/tipc/addr.h')
-rw-r--r-- | net/tipc/addr.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/net/tipc/addr.h b/net/tipc/addr.h index 6b48f0dc0205..31bee0ea7b3e 100644 --- a/net/tipc/addr.h +++ b/net/tipc/addr.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * net/tipc/addr.h: Include file for TIPC address utility routines | 2 | * net/tipc/addr.h: Include file for TIPC address utility routines |
3 | * | 3 | * |
4 | * Copyright (c) 2000-2006, Ericsson AB | 4 | * Copyright (c) 2000-2006, 2018, Ericsson AB |
5 | * Copyright (c) 2004-2005, Wind River Systems | 5 | * Copyright (c) 2004-2005, Wind River Systems |
6 | * All rights reserved. | 6 | * All rights reserved. |
7 | * | 7 | * |
@@ -45,9 +45,21 @@ | |||
45 | 45 | ||
46 | static inline u32 tipc_own_addr(struct net *net) | 46 | static inline u32 tipc_own_addr(struct net *net) |
47 | { | 47 | { |
48 | return tipc_net(net)->node_addr; | ||
49 | } | ||
50 | |||
51 | static inline u8 *tipc_own_id(struct net *net) | ||
52 | { | ||
48 | struct tipc_net *tn = tipc_net(net); | 53 | struct tipc_net *tn = tipc_net(net); |
49 | 54 | ||
50 | return tn->own_addr; | 55 | if (!strlen(tn->node_id_string)) |
56 | return NULL; | ||
57 | return tn->node_id; | ||
58 | } | ||
59 | |||
60 | static inline char *tipc_own_id_string(struct net *net) | ||
61 | { | ||
62 | return tipc_net(net)->node_id_string; | ||
51 | } | 63 | } |
52 | 64 | ||
53 | static inline u32 tipc_cluster_mask(u32 addr) | 65 | static inline u32 tipc_cluster_mask(u32 addr) |
@@ -65,9 +77,15 @@ static inline int tipc_scope2node(struct net *net, int sc) | |||
65 | return sc != TIPC_NODE_SCOPE ? 0 : tipc_own_addr(net); | 77 | return sc != TIPC_NODE_SCOPE ? 0 : tipc_own_addr(net); |
66 | } | 78 | } |
67 | 79 | ||
68 | u32 tipc_own_addr(struct net *net); | 80 | static inline int in_own_node(struct net *net, u32 addr) |
69 | int in_own_node(struct net *net, u32 addr); | 81 | { |
82 | return addr == tipc_own_addr(net) || !addr; | ||
83 | } | ||
84 | |||
70 | bool tipc_in_scope(bool legacy_format, u32 domain, u32 addr); | 85 | bool tipc_in_scope(bool legacy_format, u32 domain, u32 addr); |
71 | char *tipc_addr_string_fill(char *string, u32 addr); | 86 | void tipc_set_node_id(struct net *net, u8 *id); |
87 | void tipc_set_node_addr(struct net *net, u32 addr); | ||
88 | char *tipc_nodeid2string(char *str, u8 *id); | ||
89 | u32 tipc_node_id2hash(u8 *id128); | ||
72 | 90 | ||
73 | #endif | 91 | #endif |