core.h (9a652cc01e589e10e2aa341074ea240c9838102b) core.h (35c55c9877f8de0ab129fa1a309271d0ecc868b9)
1/*
2 * net/tipc/core.h: Include file for TIPC global declarations
3 *
4 * Copyright (c) 2005-2006, 2013 Ericsson AB
5 * Copyright (c) 2005-2007, 2010-2013, Wind River Systems
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 52 unchanged lines hidden (view full) ---

61#include <linux/rhashtable.h>
62
63struct tipc_node;
64struct tipc_bearer;
65struct tipc_bc_base;
66struct tipc_link;
67struct tipc_name_table;
68struct tipc_server;
1/*
2 * net/tipc/core.h: Include file for TIPC global declarations
3 *
4 * Copyright (c) 2005-2006, 2013 Ericsson AB
5 * Copyright (c) 2005-2007, 2010-2013, Wind River Systems
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 52 unchanged lines hidden (view full) ---

61#include <linux/rhashtable.h>
62
63struct tipc_node;
64struct tipc_bearer;
65struct tipc_bc_base;
66struct tipc_link;
67struct tipc_name_table;
68struct tipc_server;
69struct tipc_monitor;
69
70#define TIPC_MOD_VER "2.0.0"
71
70
71#define TIPC_MOD_VER "2.0.0"
72
72#define NODE_HTABLE_SIZE 512
73#define MAX_BEARERS 3
73#define NODE_HTABLE_SIZE 512
74#define MAX_BEARERS 3
75#define TIPC_DEF_MON_THRESHOLD 32
74
75extern int tipc_net_id __read_mostly;
76extern int sysctl_tipc_rmem[3] __read_mostly;
77extern int sysctl_tipc_named_timeout __read_mostly;
78
79struct tipc_net {
80 u32 own_addr;
81 int net_id;
82 int random;
83
84 /* Node table and node list */
85 spinlock_t node_list_lock;
86 struct hlist_head node_htable[NODE_HTABLE_SIZE];
87 struct list_head node_list;
88 u32 num_nodes;
89 u32 num_links;
90
76
77extern int tipc_net_id __read_mostly;
78extern int sysctl_tipc_rmem[3] __read_mostly;
79extern int sysctl_tipc_named_timeout __read_mostly;
80
81struct tipc_net {
82 u32 own_addr;
83 int net_id;
84 int random;
85
86 /* Node table and node list */
87 spinlock_t node_list_lock;
88 struct hlist_head node_htable[NODE_HTABLE_SIZE];
89 struct list_head node_list;
90 u32 num_nodes;
91 u32 num_links;
92
93 /* Neighbor monitoring list */
94 struct tipc_monitor *monitors[MAX_BEARERS];
95 int mon_threshold;
96
91 /* Bearer list */
92 struct tipc_bearer __rcu *bearer_list[MAX_BEARERS + 1];
93
94 /* Broadcast link */
95 spinlock_t bclock;
96 struct tipc_bc_base *bcbase;
97 struct tipc_link *bcl;
98

--- 22 unchanged lines hidden (view full) ---

121 return tipc_net(net)->net_id;
122}
123
124static inline struct list_head *tipc_nodes(struct net *net)
125{
126 return &tipc_net(net)->node_list;
127}
128
97 /* Bearer list */
98 struct tipc_bearer __rcu *bearer_list[MAX_BEARERS + 1];
99
100 /* Broadcast link */
101 spinlock_t bclock;
102 struct tipc_bc_base *bcbase;
103 struct tipc_link *bcl;
104

--- 22 unchanged lines hidden (view full) ---

127 return tipc_net(net)->net_id;
128}
129
130static inline struct list_head *tipc_nodes(struct net *net)
131{
132 return &tipc_net(net)->node_list;
133}
134
135static inline unsigned int tipc_hashfn(u32 addr)
136{
137 return addr & (NODE_HTABLE_SIZE - 1);
138}
139
129static inline u16 mod(u16 x)
130{
131 return x & 0xffffu;
132}
133
134static inline int less_eq(u16 left, u16 right)
135{
136 return mod(right - left) < 32768u;

--- 25 unchanged lines hidden ---
140static inline u16 mod(u16 x)
141{
142 return x & 0xffffu;
143}
144
145static inline int less_eq(u16 left, u16 right)
146{
147 return mod(right - left) < 32768u;

--- 25 unchanged lines hidden ---