aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/name_table.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/name_table.h')
-rw-r--r--net/tipc/name_table.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/net/tipc/name_table.h b/net/tipc/name_table.h
index f02f48b9a216..5f0dee92010d 100644
--- a/net/tipc/name_table.h
+++ b/net/tipc/name_table.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * net/tipc/name_table.h: Include file for TIPC name table code 2 * net/tipc/name_table.h: Include file for TIPC name table code
3 * 3 *
4 * Copyright (c) 2000-2006, Ericsson AB 4 * Copyright (c) 2000-2006, 2014, Ericsson AB
5 * Copyright (c) 2004-2005, 2010-2011, Wind River Systems 5 * Copyright (c) 2004-2005, 2010-2011, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
@@ -37,15 +37,15 @@
37#ifndef _TIPC_NAME_TABLE_H 37#ifndef _TIPC_NAME_TABLE_H
38#define _TIPC_NAME_TABLE_H 38#define _TIPC_NAME_TABLE_H
39 39
40#include "node_subscr.h"
41
42struct tipc_subscription; 40struct tipc_subscription;
43struct tipc_port_list; 41struct tipc_port_list;
44 42
45/* 43/*
46 * TIPC name types reserved for internal TIPC use (both current and planned) 44 * TIPC name types reserved for internal TIPC use (both current and planned)
47 */ 45 */
48#define TIPC_ZM_SRV 3 /* zone master service name type */ 46#define TIPC_ZM_SRV 3 /* zone master service name type */
47#define TIPC_PUBL_SCOPE_NUM (TIPC_NODE_SCOPE + 1)
48#define TIPC_NAMETBL_SIZE 1024 /* must be a power of 2 */
49 49
50/** 50/**
51 * struct publication - info about a published (name or) name sequence 51 * struct publication - info about a published (name or) name sequence
@@ -56,12 +56,13 @@ struct tipc_port_list;
56 * @node: network address of publishing port's node 56 * @node: network address of publishing port's node
57 * @ref: publishing port 57 * @ref: publishing port
58 * @key: publication key 58 * @key: publication key
59 * @subscr: subscription to "node down" event (for off-node publications only) 59 * @nodesub_list: subscription to "node down" event (off-node publication only)
60 * @local_list: adjacent entries in list of publications made by this node 60 * @local_list: adjacent entries in list of publications made by this node
61 * @pport_list: adjacent entries in list of publications made by this port 61 * @pport_list: adjacent entries in list of publications made by this port
62 * @node_list: adjacent matching name seq publications with >= node scope 62 * @node_list: adjacent matching name seq publications with >= node scope
63 * @cluster_list: adjacent matching name seq publications with >= cluster scope 63 * @cluster_list: adjacent matching name seq publications with >= cluster scope
64 * @zone_list: adjacent matching name seq publications with >= zone scope 64 * @zone_list: adjacent matching name seq publications with >= zone scope
65 * @rcu: RCU callback head used for deferred freeing
65 * 66 *
66 * Note that the node list, cluster list, and zone list are circular lists. 67 * Note that the node list, cluster list, and zone list are circular lists.
67 */ 68 */
@@ -73,16 +74,31 @@ struct publication {
73 u32 node; 74 u32 node;
74 u32 ref; 75 u32 ref;
75 u32 key; 76 u32 key;
76 struct tipc_node_subscr subscr; 77 struct list_head nodesub_list;
77 struct list_head local_list; 78 struct list_head local_list;
78 struct list_head pport_list; 79 struct list_head pport_list;
79 struct list_head node_list; 80 struct list_head node_list;
80 struct list_head cluster_list; 81 struct list_head cluster_list;
81 struct list_head zone_list; 82 struct list_head zone_list;
83 struct rcu_head rcu;
84};
85
86/**
87 * struct name_table - table containing all existing port name publications
88 * @seq_hlist: name sequence hash lists
89 * @publ_list: pulication lists
90 * @local_publ_count: number of publications issued by this node
91 */
92struct name_table {
93 struct hlist_head seq_hlist[TIPC_NAMETBL_SIZE];
94 struct list_head publ_list[TIPC_PUBL_SCOPE_NUM];
95 u32 local_publ_count;
82}; 96};
83 97
98extern spinlock_t tipc_nametbl_lock;
99extern struct name_table *tipc_nametbl;
84 100
85extern rwlock_t tipc_nametbl_lock; 101int tipc_nl_name_table_dump(struct sk_buff *skb, struct netlink_callback *cb);
86 102
87struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space); 103struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space);
88u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *node); 104u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *node);