node.h (7f06dd61248a75668bbb39b6fcca6ff407745df8) | node.h (a8f48af587b0f257c49dce5b49a62554a4b8627e) |
---|---|
1/* 2 * net/tipc/node.h: Include file for TIPC node management routines 3 * | 1/* 2 * net/tipc/node.h: Include file for TIPC node management routines 3 * |
4 * Copyright (c) 2000-2006, Ericsson AB | 4 * Copyright (c) 2000-2006, 2014, Ericsson AB |
5 * Copyright (c) 2005, 2010-2014, Wind River Systems 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions are met: 10 * 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. --- 19 unchanged lines hidden (view full) --- 32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * POSSIBILITY OF SUCH DAMAGE. 35 */ 36 37#ifndef _TIPC_NODE_H 38#define _TIPC_NODE_H 39 | 5 * Copyright (c) 2005, 2010-2014, Wind River Systems 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions are met: 10 * 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. --- 19 unchanged lines hidden (view full) --- 32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * POSSIBILITY OF SUCH DAMAGE. 35 */ 36 37#ifndef _TIPC_NODE_H 38#define _TIPC_NODE_H 39 |
40#include "node_subscr.h" | |
41#include "addr.h" 42#include "net.h" 43#include "bearer.h" 44#include "msg.h" 45 46/* 47 * Out-of-range value for node signature 48 */ --- 50 unchanged lines hidden (view full) --- 99 * @links: pointers to all links to node 100 * @action_flags: bit mask of different types of node actions 101 * @bclink: broadcast-related info 102 * @list: links to adjacent nodes in sorted list of cluster's nodes 103 * @working_links: number of working links to node (both active and standby) 104 * @link_cnt: number of links to node 105 * @signature: node instance identifier 106 * @link_id: local and remote bearer ids of changing link, if any | 40#include "addr.h" 41#include "net.h" 42#include "bearer.h" 43#include "msg.h" 44 45/* 46 * Out-of-range value for node signature 47 */ --- 50 unchanged lines hidden (view full) --- 98 * @links: pointers to all links to node 99 * @action_flags: bit mask of different types of node actions 100 * @bclink: broadcast-related info 101 * @list: links to adjacent nodes in sorted list of cluster's nodes 102 * @working_links: number of working links to node (both active and standby) 103 * @link_cnt: number of links to node 104 * @signature: node instance identifier 105 * @link_id: local and remote bearer ids of changing link, if any |
107 * @nsub: list of "node down" subscriptions monitoring node | 106 * @publ_list: list of publications |
108 * @rcu: rcu struct for tipc_node 109 */ 110struct tipc_node { 111 u32 addr; 112 spinlock_t lock; 113 struct hlist_node hash; 114 struct tipc_link *active_links[2]; 115 u32 act_mtus[2]; 116 struct tipc_link *links[MAX_BEARERS]; 117 unsigned int action_flags; 118 struct tipc_node_bclink bclink; 119 struct list_head list; 120 int link_cnt; 121 int working_links; 122 u32 signature; 123 u32 link_id; | 107 * @rcu: rcu struct for tipc_node 108 */ 109struct tipc_node { 110 u32 addr; 111 spinlock_t lock; 112 struct hlist_node hash; 113 struct tipc_link *active_links[2]; 114 u32 act_mtus[2]; 115 struct tipc_link *links[MAX_BEARERS]; 116 unsigned int action_flags; 117 struct tipc_node_bclink bclink; 118 struct list_head list; 119 int link_cnt; 120 int working_links; 121 u32 signature; 122 u32 link_id; |
124 struct list_head nsub; | 123 struct list_head publ_list; |
125 struct sk_buff_head waiting_sks; 126 struct list_head conn_sks; 127 struct rcu_head rcu; 128}; 129 130extern struct list_head tipc_node_list; 131 132struct tipc_node *tipc_node_find(u32 addr); --- 7 unchanged lines hidden (view full) --- 140int tipc_node_is_up(struct tipc_node *n_ptr); 141struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space); 142struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space); 143int tipc_node_get_linkname(u32 bearer_id, u32 node, char *linkname, size_t len); 144void tipc_node_unlock(struct tipc_node *node); 145int tipc_node_add_conn(u32 dnode, u32 port, u32 peer_port); 146void tipc_node_remove_conn(u32 dnode, u32 port); 147 | 124 struct sk_buff_head waiting_sks; 125 struct list_head conn_sks; 126 struct rcu_head rcu; 127}; 128 129extern struct list_head tipc_node_list; 130 131struct tipc_node *tipc_node_find(u32 addr); --- 7 unchanged lines hidden (view full) --- 139int tipc_node_is_up(struct tipc_node *n_ptr); 140struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space); 141struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space); 142int tipc_node_get_linkname(u32 bearer_id, u32 node, char *linkname, size_t len); 143void tipc_node_unlock(struct tipc_node *node); 144int tipc_node_add_conn(u32 dnode, u32 port, u32 peer_port); 145void tipc_node_remove_conn(u32 dnode, u32 port); 146 |
147int tipc_nl_node_dump(struct sk_buff *skb, struct netlink_callback *cb); 148 |
|
148static inline void tipc_node_lock(struct tipc_node *node) 149{ 150 spin_lock_bh(&node->lock); 151} 152 153static inline bool tipc_node_blocked(struct tipc_node *node) 154{ 155 return (node->action_flags & (TIPC_WAIT_PEER_LINKS_DOWN | --- 19 unchanged lines hidden --- | 149static inline void tipc_node_lock(struct tipc_node *node) 150{ 151 spin_lock_bh(&node->lock); 152} 153 154static inline bool tipc_node_blocked(struct tipc_node *node) 155{ 156 return (node->action_flags & (TIPC_WAIT_PEER_LINKS_DOWN | --- 19 unchanged lines hidden --- |