diff options
Diffstat (limited to 'net/tipc/core.h')
| -rw-r--r-- | net/tipc/core.h | 37 | 
1 files changed, 30 insertions, 7 deletions
| diff --git a/net/tipc/core.h b/net/tipc/core.h index 3dc68c7a966d..0fcf133d5cb7 100644 --- a/net/tipc/core.h +++ b/net/tipc/core.h | |||
| @@ -60,16 +60,19 @@ | |||
| 60 | #include <net/netns/generic.h> | 60 | #include <net/netns/generic.h> | 
| 61 | #include <linux/rhashtable.h> | 61 | #include <linux/rhashtable.h> | 
| 62 | 62 | ||
| 63 | #include "node.h" | 63 | struct tipc_node; | 
| 64 | #include "bearer.h" | 64 | struct tipc_bearer; | 
| 65 | #include "bcast.h" | 65 | struct tipc_bcbearer; | 
| 66 | #include "netlink.h" | 66 | struct tipc_bclink; | 
| 67 | #include "link.h" | 67 | struct tipc_link; | 
| 68 | #include "node.h" | 68 | struct tipc_name_table; | 
| 69 | #include "msg.h" | 69 | struct tipc_server; | 
| 70 | 70 | ||
| 71 | #define TIPC_MOD_VER "2.0.0" | 71 | #define TIPC_MOD_VER "2.0.0" | 
| 72 | 72 | ||
| 73 | #define NODE_HTABLE_SIZE 512 | ||
| 74 | #define MAX_BEARERS 3 | ||
| 75 | |||
| 73 | extern int tipc_net_id __read_mostly; | 76 | extern int tipc_net_id __read_mostly; | 
| 74 | extern int sysctl_tipc_rmem[3] __read_mostly; | 77 | extern int sysctl_tipc_rmem[3] __read_mostly; | 
| 75 | extern int sysctl_tipc_named_timeout __read_mostly; | 78 | extern int sysctl_tipc_named_timeout __read_mostly; | 
| @@ -106,6 +109,26 @@ struct tipc_net { | |||
| 106 | atomic_t subscription_count; | 109 | atomic_t subscription_count; | 
| 107 | }; | 110 | }; | 
| 108 | 111 | ||
| 112 | static inline u16 mod(u16 x) | ||
| 113 | { | ||
| 114 | return x & 0xffffu; | ||
| 115 | } | ||
| 116 | |||
| 117 | static inline int less_eq(u16 left, u16 right) | ||
| 118 | { | ||
| 119 | return mod(right - left) < 32768u; | ||
| 120 | } | ||
| 121 | |||
| 122 | static inline int more(u16 left, u16 right) | ||
| 123 | { | ||
| 124 | return !less_eq(left, right); | ||
| 125 | } | ||
| 126 | |||
| 127 | static inline int less(u16 left, u16 right) | ||
| 128 | { | ||
| 129 | return less_eq(left, right) && (mod(right) != mod(left)); | ||
| 130 | } | ||
| 131 | |||
| 109 | #ifdef CONFIG_SYSCTL | 132 | #ifdef CONFIG_SYSCTL | 
| 110 | int tipc_register_sysctl(void); | 133 | int tipc_register_sysctl(void); | 
| 111 | void tipc_unregister_sysctl(void); | 134 | void tipc_unregister_sysctl(void); | 
