node.h (51a8e4dee7653698ba4c6e7de71053665f075273) | node.h (8f92df6ad49da958d97e171762d0a97a3dc738f1) |
---|---|
1/* 2 * net/tipc/node.h: Include file for TIPC node management routines 3 * 4 * Copyright (c) 2000-2006, Ericsson AB 5 * Copyright (c) 2005, Wind River Systems 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 24 unchanged lines hidden (view full) --- 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" | 1/* 2 * net/tipc/node.h: Include file for TIPC node management routines 3 * 4 * Copyright (c) 2000-2006, Ericsson AB 5 * Copyright (c) 2005, Wind River Systems 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 24 unchanged lines hidden (view full) --- 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 "cluster.h" | 41#include "addr.h" 42#include "net.h" |
42#include "bearer.h" 43 44/** 45 * struct tipc_node - TIPC node structure 46 * @addr: network address of node 47 * @lock: spinlock governing access to structure | 43#include "bearer.h" 44 45/** 46 * struct tipc_node - TIPC node structure 47 * @addr: network address of node 48 * @lock: spinlock governing access to structure |
48 * @owner: pointer to cluster that node belongs to | |
49 * @next: pointer to next node in sorted list of cluster's nodes 50 * @nsub: list of "node down" subscriptions monitoring node 51 * @active_links: pointers to active links to node 52 * @links: pointers to all links to node 53 * @working_links: number of working links to node (both active and standby) 54 * @cleanup_required: non-zero if cleaning up after a prior loss of contact 55 * @link_cnt: number of links to node 56 * @permit_changeover: non-zero if node has redundant links to this system --- 7 unchanged lines hidden (view full) --- 64 * @deferred_head: oldest OOS b'cast message received from node 65 * @deferred_tail: newest OOS b'cast message received from node 66 * @defragm: list of partially reassembled b'cast message fragments from node 67 */ 68 69struct tipc_node { 70 u32 addr; 71 spinlock_t lock; | 49 * @next: pointer to next node in sorted list of cluster's nodes 50 * @nsub: list of "node down" subscriptions monitoring node 51 * @active_links: pointers to active links to node 52 * @links: pointers to all links to node 53 * @working_links: number of working links to node (both active and standby) 54 * @cleanup_required: non-zero if cleaning up after a prior loss of contact 55 * @link_cnt: number of links to node 56 * @permit_changeover: non-zero if node has redundant links to this system --- 7 unchanged lines hidden (view full) --- 64 * @deferred_head: oldest OOS b'cast message received from node 65 * @deferred_tail: newest OOS b'cast message received from node 66 * @defragm: list of partially reassembled b'cast message fragments from node 67 */ 68 69struct tipc_node { 70 u32 addr; 71 spinlock_t lock; |
72 struct cluster *owner; | |
73 struct tipc_node *next; 74 struct list_head nsub; 75 struct link *active_links[2]; 76 struct link *links[MAX_BEARERS]; 77 int link_cnt; 78 int working_links; 79 int cleanup_required; 80 int permit_changeover; --- 22 unchanged lines hidden (view full) --- 103int tipc_node_has_redundant_links(struct tipc_node *n_ptr); 104int tipc_node_is_up(struct tipc_node *n_ptr); 105struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space); 106struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space); 107 108static inline struct tipc_node *tipc_node_find(u32 addr) 109{ 110 if (likely(in_own_cluster(addr))) | 72 struct tipc_node *next; 73 struct list_head nsub; 74 struct link *active_links[2]; 75 struct link *links[MAX_BEARERS]; 76 int link_cnt; 77 int working_links; 78 int cleanup_required; 79 int permit_changeover; --- 22 unchanged lines hidden (view full) --- 102int tipc_node_has_redundant_links(struct tipc_node *n_ptr); 103int tipc_node_is_up(struct tipc_node *n_ptr); 104struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space); 105struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space); 106 107static inline struct tipc_node *tipc_node_find(u32 addr) 108{ 109 if (likely(in_own_cluster(addr))) |
111 return tipc_local_nodes[tipc_node(addr)]; | 110 return tipc_net.nodes[tipc_node(addr)]; |
112 return NULL; 113} 114 115static inline void tipc_node_lock(struct tipc_node *n_ptr) 116{ 117 spin_lock_bh(&n_ptr->lock); 118} 119 120static inline void tipc_node_unlock(struct tipc_node *n_ptr) 121{ 122 spin_unlock_bh(&n_ptr->lock); 123} 124 125#endif | 111 return NULL; 112} 113 114static inline void tipc_node_lock(struct tipc_node *n_ptr) 115{ 116 spin_lock_bh(&n_ptr->lock); 117} 118 119static inline void tipc_node_unlock(struct tipc_node *n_ptr) 120{ 121 spin_unlock_bh(&n_ptr->lock); 122} 123 124#endif |