aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/name_table.h
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2015-01-09 02:27:09 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-12 16:24:33 -0500
commit4ac1c8d0ee9faf3a4be185cc4db1381fa0d81280 (patch)
tree361ea817ed30f0dd959ea2d87d658c8d85feebb2 /net/tipc/name_table.h
parente05b31f4bf8994d49322e9afb004ad479a129db0 (diff)
tipc: name tipc name table support net namespace
TIPC name table is used to store the mapping relationship between TIPC service name and socket port ID. When tipc supports namespace, it allows users to publish service names only owned by a certain namespace. Therefore, every namespace must have its private name table to prevent service names published to one namespace from being contaminated by other service names in another namespace. Therefore, The name table global variable (ie, nametbl) and its lock must be moved to tipc_net structure, and a parameter of namespace must be added for necessary functions so that they can obtain name table variable defined in tipc_net structure. Signed-off-by: Ying Xue <ying.xue@windriver.com> Tested-by: Tero Aho <Tero.Aho@coriant.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/name_table.h')
-rw-r--r--net/tipc/name_table.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/net/tipc/name_table.h b/net/tipc/name_table.h
index efccaca7a5d5..f67b3d8d4b2f 100644
--- a/net/tipc/name_table.h
+++ b/net/tipc/name_table.h
@@ -95,28 +95,27 @@ struct name_table {
95 u32 local_publ_count; 95 u32 local_publ_count;
96}; 96};
97 97
98extern spinlock_t tipc_nametbl_lock;
99extern struct name_table *tipc_nametbl;
100
101int tipc_nl_name_table_dump(struct sk_buff *skb, struct netlink_callback *cb); 98int tipc_nl_name_table_dump(struct sk_buff *skb, struct netlink_callback *cb);
102 99
103struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space); 100struct sk_buff *tipc_nametbl_get(struct net *net, const void *req_tlv_area,
104u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *node); 101 int req_tlv_space);
105int tipc_nametbl_mc_translate(u32 type, u32 lower, u32 upper, u32 limit, 102u32 tipc_nametbl_translate(struct net *net, u32 type, u32 instance, u32 *node);
106 struct tipc_port_list *dports); 103int tipc_nametbl_mc_translate(struct net *net, u32 type, u32 lower, u32 upper,
104 u32 limit, struct tipc_port_list *dports);
107struct publication *tipc_nametbl_publish(struct net *net, u32 type, u32 lower, 105struct publication *tipc_nametbl_publish(struct net *net, u32 type, u32 lower,
108 u32 upper, u32 scope, u32 port_ref, 106 u32 upper, u32 scope, u32 port_ref,
109 u32 key); 107 u32 key);
110int tipc_nametbl_withdraw(struct net *net, u32 type, u32 lower, u32 ref, 108int tipc_nametbl_withdraw(struct net *net, u32 type, u32 lower, u32 ref,
111 u32 key); 109 u32 key);
112struct publication *tipc_nametbl_insert_publ(u32 type, u32 lower, u32 upper, 110struct publication *tipc_nametbl_insert_publ(struct net *net, u32 type,
113 u32 scope, u32 node, u32 ref, 111 u32 lower, u32 upper, u32 scope,
112 u32 node, u32 ref, u32 key);
113struct publication *tipc_nametbl_remove_publ(struct net *net, u32 type,
114 u32 lower, u32 node, u32 ref,
114 u32 key); 115 u32 key);
115struct publication *tipc_nametbl_remove_publ(u32 type, u32 lower, u32 node,
116 u32 ref, u32 key);
117void tipc_nametbl_subscribe(struct tipc_subscription *s); 116void tipc_nametbl_subscribe(struct tipc_subscription *s);
118void tipc_nametbl_unsubscribe(struct tipc_subscription *s); 117void tipc_nametbl_unsubscribe(struct tipc_subscription *s);
119int tipc_nametbl_init(void); 118int tipc_nametbl_init(struct net *net);
120void tipc_nametbl_stop(void); 119void tipc_nametbl_stop(struct net *net);
121 120
122#endif 121#endif