Lines Matching refs:addr
84 * @addr: network address of node
109 u32 addr;
176 static struct tipc_node *tipc_node_find(struct net *net, u32 addr);
198 int tipc_node_get_mtu(struct net *net, u32 addr, u32 sel, bool connected)
204 n = tipc_node_find(net, addr);
223 bool tipc_node_get_id(struct net *net, u32 addr, u8 *id)
231 if (addr == tipc_own_addr(net)) {
235 n = tipc_node_find(net, addr);
244 u16 tipc_node_get_capabilities(struct net *net, u32 addr)
249 n = tipc_node_find(net, addr);
259 return (node) ? node->addr : 0;
282 struct tipc_crypto *tipc_node_crypto_rx_by_addr(struct net *net, u32 addr)
286 n = tipc_node_find(net, addr);
322 static struct tipc_node *tipc_node_find(struct net *net, u32 addr)
326 unsigned int thash = tipc_hashfn(addr);
330 if (node->addr != addr || node->preliminary)
387 u32 addr = 0;
398 addr = n->addr;
409 tipc_publ_notify(net, publ_list, addr, n->capabilities);
412 tipc_named_node_up(net, addr, n->capabilities);
415 tipc_mon_peer_up(net, addr, bearer_id);
416 tipc_nametbl_publish(net, TIPC_LINK_STATE, addr, addr,
420 tipc_mon_peer_down(net, addr, bearer_id);
421 tipc_nametbl_withdraw(net, TIPC_LINK_STATE, addr,
422 addr, link_id);
454 struct tipc_node *tipc_node_create(struct net *net, u32 addr, u8 *peer_id,
466 n = tipc_node_find(net, addr) ?:
475 if (!tipc_link_bc_create(net, tipc_own_addr(net), addr, peer_id, U16_MAX,
486 n->addr = addr;
489 &tn->node_htable[tipc_hashfn(addr)]);
492 if (n->addr < temp_node->addr)
538 n->addr = addr;
565 !tipc_link_bc_create(net, tipc_own_addr(net), addr, peer_id, U16_MAX,
581 hlist_add_head_rcu(&n->hash, &tn->node_htable[tipc_hashfn(addr)]);
583 if (n->addr < temp_node->addr)
642 void tipc_node_subscribe(struct net *net, struct list_head *subscr, u32 addr)
646 if (in_own_node(net, addr))
649 n = tipc_node_find(net, addr);
651 pr_warn("Node subscribe rejected, unknown node 0x%x\n", addr);
660 void tipc_node_unsubscribe(struct net *net, struct list_head *subscr, u32 addr)
664 if (in_own_node(net, addr))
667 n = tipc_node_find(net, addr);
669 pr_warn("Node unsubscribe rejected, unknown node 0x%x\n", addr);
861 tipc_bearer_add_dest(n->net, bearer_id, n->addr);
981 tipc_bearer_remove_dest(n->net, *bearer_id, n->addr);
1066 tipc_mon_remove_peer(n->net, n->addr, old_bearer_id);
1077 bool tipc_node_is_up(struct net *net, u32 addr)
1082 if (in_own_node(net, addr))
1085 n = tipc_node_find(net, addr);
1093 static u32 tipc_node_suggest_addr(struct net *net, u32 addr)
1097 addr ^= tipc_net(net)->random;
1098 while ((n = tipc_node_find(net, addr))) {
1100 addr++;
1102 return addr;
1105 /* tipc_node_try_addr(): Check if addr can be used by peer, suggest other if not
1108 u32 tipc_node_try_addr(struct net *net, u8 *id, u32 addr)
1116 n = tipc_node_find(net, addr);
1119 addr = 0;
1121 if (!addr)
1123 return tipc_node_suggest_addr(net, addr);
1129 sugg_addr = n->addr;
1137 if (tn->trial_addr == addr)
1138 return tipc_node_suggest_addr(net, addr);
1143 void tipc_node_check_dest(struct net *net, u32 addr,
1165 n = tipc_node_create(net, addr, peer_id, capabilities, hash_mixes,
1257 tipc_own_addr(net), addr, peer_id,
1304 pr_warn("Resetting all links to %x\n", n->addr);
1500 pr_debug("Lost contact with %x\n", n->addr);
1536 * @addr: peer node address
1541 int tipc_node_get_linkname(struct net *net, u32 bearer_id, u32 addr,
1546 struct tipc_node *node = tipc_node_find(net, addr);
1581 if (nla_put_u32(msg->skb, TIPC_NLA_NODE_ADDR, node->addr))
1778 dst = n->addr;
2073 n = tipc_node_find(net, ntohl(ehdr->addr));
2215 u32 addr;
2231 addr = nla_get_u32(attrs[TIPC_NLA_NET_ADDR]);
2233 if (in_own_node(net, addr))
2237 peer = tipc_node_find(net, addr);
2308 if (node->addr == last_addr)
2317 last_addr = node->addr;
2677 prev_node = node->addr;
2692 prev_node = node->addr;
3053 i += scnprintf(buf, sz, "node data: %x", n->addr);