linux/net/tipc/node.c
<<
tion4.1/spa="v 4.1/form"v 4.1a tion4. href="../linux+v3 op10/net/tipc/node.c">tion4.1img src="../.static/gfx/right.png" alt=">>">ti1/spa="vti1spa= class="lxr_search">tiontion4.1input typ3.1hidden" nam3.1navtarget" v3.1">tion4.1input typ3.1text" nam3.1search" id.1search">tion4.1butt >typ3.1submit">Searchtion4.Prefsv 4.1/a>ti1/spa="von4. .1/div"von4. .1form aclue=="ajax+*" method="post" onsubmit="return false;">ti1input typ3.1hidden" nam3.1ajax_lookup" id.1ajax_lookup" v3.1">ton4. .1/form"vton4. .1div class="headingbott m">v 1div id.1file_contents""
. .11/a>1spa= class="comment">/*1/spa="v. .21/a>1spa= class="comment"> * net/tipc/node.c: TIPC node management routines1/spa="v. .31/a>1spa= class="comment"> *1/spa="v. .41/a>1spa= class="comment"> * Copyright (c) 2000-2006, Ericss  >AB1/spa="v. .51/a>1spa= class="comment"> * Copyright (c) 2005-2006, 2010-2011, Wind River Systems1/spa="v. .61/a>1spa= class="comment"> * All rights reserved.1/spa="v. .71/a>1spa= class="comment"> *1/spa="v. .81/a>1spa= class="comment"> * Redistribut	  >and use in source>and binary forms, with or without1/spa="v. .91/a>1spa= class="comment"> * modificat	  , are permitted provided that the following condit	  s are met:1/spa="v. ion a>1spa= class="comment"> *1/spa="v. 111/a>1spa= class="comment"> * 1. Redistribut	  s of source>code must retain the above>copyright1/spa="v. 121/a>1spa= class="comment"> *    notice, this list of condit	  s and the following disclaimer.1/spa="v. 131/a>1spa= class="comment"> * 2. Redistribut	  s in binary form must reproduce>the above>copyright1/spa="v. 141/a>1spa= class="comment"> *    notice, this list of condit	  s and the following disclaimer in the1/spa="v. 151/a>1spa= class="comment"> *    documentat	  >and/or other materials provided with the distribut	  .1/spa="v. 161/a>1spa= class="comment"> * 3. Neither the nam3s of the copyright holders nor the nam3s of its1/spa="v. 171/a>1spa= class="comment"> *    contributors may be used to endorse or promote products derived from1/spa="v. 181/a>1spa= class="comment"> *    this software without specific prior written permiss	  .1/spa="v. 191/a>1spa= class="comment"> *1/spa="v. 2on a>1spa= class="comment"> * Alternat	vely, this software may be distributed under the terms of the1/spa="v. 211/a>1spa= class="comment"> * GNU General Public License ("GPL") vers	   2 as published by the Free1/spa="v. 221/a>1spa= class="comment"> * Software Foundat	  .1/spa="v. 231/a>1spa= class="comment"> *1/spa="v. 241/a>1spa= class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"1/spa="v. 251/a>1spa= class="comment"> * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE1/spa="v. 261/a>1spa= class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE1/spa="v. 271/a>1spa= class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE1/spa="v. 281/a>1spa= class="comment"> * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR1/spa="v. 291/a>1spa= class="comment"> * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF1/spa="v. 3on a>1spa= class="comment"> * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS1/spa="v. 311/a>1spa= class="comment"> * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN1/spa="v. 321/a>1spa= class="comment"> * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)1/spa="v. 331/a>1spa= class="comment"> * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE1/spa="v. 341/a>1spa= class="comment"> * POSSIBILITY OF SUCH DAMAGE.1/spa="v. 351/a>1spa= class="comment"> */1/spa="v. 361/a>v. 371/a>#include "1a href="net/tipc/core.h" class="fref">core.h1/a>"v. 381/a>#include "1a href="net/tipc/config.h" class="fref">config.h1/a>"v. 391/a>#include "1a href="net/tipc/node.h" class="fref">node.h1/a>"v. 401/a>#include "1a href="net/tipc/nam3_distr.h" class="fref">nam3_distr.h1/a>"v. 411/a>v. 421/a>#define.1a href="+code=NODE_HTABLE_SIZE" class="sref">NODE_HTABLE_SIZE1/a> 512v. 431/a>v. 441/a>static void.1a href="+code=node_lost_contact" class="sref">node_lost_contact1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>);v. 451/a>static void.1a href="+code=node_established_contact" class="sref">node_established_contact1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>);v. 461/a>v. 471/a>static 1a href="+code=DEFINE_SPINLOCK" class="sref">DEFINE_SPINLOCK1/a>(1a href="+code=node_create_lock" class="sref">node_create_lock1/a>);v. 481/a>v. 491/a>static struct.1a href="+code=hlist_head" class="sref">hlist_head1/a> 1a href="+code=node_htable" class="sref">node_htable1/a>[1a href="+code=NODE_HTABLE_SIZE" class="sref">NODE_HTABLE_SIZE1/a>];v. 5on a>1a href="+code=LIST_HEAD" class="sref">LIST_HEAD1/a>(1a href="+code=tipc_node_list" class="sref">tipc_node_list1/a>);v. 511/a>static 1a href="+code=u32" class="sref">u321/a>.1a href="+code=tipc_num_nodes" class="sref">tipc_num_nodes1/a>;v. 521/a>v. 531/a>static 1a href="+code=atomic_t" class="sref">atomic_t1/a>.1a href="+code=tipc_num_links" class="sref">tipc_num_links1/a>.=.1a href="+code=ATOMIC_INIT" class="sref">ATOMIC_INIT1/a>(0);v. 541/a>v. 551/a>1spa= class="comment">/*1/spa="v. 561/a>1spa= class="comment"> * A trivial power-of-two bitmask technique is used for speed, since this1/spa="v. 571/a>1spa= class="comment"> * operat	  >is done for every incoming TIPC packet. The number of hash table1/spa="v. 581/a>1spa= class="comment"> * entries has bee= chosen so that no hash chain exceeds 8 nodes and will1/spa="v. 591/a>1spa= class="comment"> * usually be much smaller (typically only a single node).1/spa="v. 6on a>1spa= class="comment"> */1/spa="v. 611/a>static unsigned int.1a href="+code=tipc_hashfn" class="sref">tipc_hashfn1/a>(1a href="+code=u32" class="sref">u321/a>.1a href="+code=addr" class="sref">addr1/a>)v. 621/a>{v. 631/a>        return 1a href="+code=addr" class="sref">addr1/a> & (1a href="+code=NODE_HTABLE_SIZE" class="sref">NODE_HTABLE_SIZE1/a> - 1);v. 641/a>}v. 651/a>v. 661/a>1spa= class="comment">/*1/spa="v. 671/a>1spa= class="comment"> * tipc_node_find - locate specified node object, if it exists1/spa="v. 681/a>1spa= class="comment"> */1/spa="v. 691/a>struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=tipc_node_find" class="sref">tipc_node_find1/a>(1a href="+code=u32" class="sref">u321/a>.1a href="+code=addr" class="sref">addr1/a>)v. 701/a>{v. 711/a>        struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=node" class="sref">node1/a>;v. 721/a>        struct.1a href="+code=hlist_node" class="sref">hlist_node1/a> *1a href="+code=pos" class="sref">pos1/a>;v. 731/a>v. 741/a>        if (1a href="+code=unlikely" class="sref">unlikely1/a>(!1a href="+code=in_own_cluster_exact" class="sref">in_own_cluster_exact1/a>(1a href="+code=addr" class="sref">addr1/a>)))v. 751/a>                return 1a href="+code=NULL" class="sref">NULL1/a>;v. 761/a>v. 771/a>        1a href="+code=hlist_for_each_entry" class="sref">hlist_for_each_entry1/a>(1a href="+code=node" class="sref">node1/a>, 1a href="+code=pos" class="sref">pos1/a>, &1a href="+code=node_htable" class="sref">node_htable1/a>[1a href="+code=tipc_hashfn" class="sref">tipc_hashfn1/a>(1a href="+code=addr" class="sref">addr1/a>)], 1a href="+code=hash" class="sref">hash1/a>) {v. 781/a>                if (1a href="+code=node" class="sref">node1/a>->1a href="+code=addr" class="sref">addr1/a> ==.1a href="+code=addr" class="sref">addr1/a>)v. 791/a>                        return 1a href="+code=node" class="sref">node1/a>;v. 801/a>        }v. 811/a>        return 1a href="+code=NULL" class="sref">NULL1/a>;v. 821/a>}v. 831/a>v. 841/a>1spa= class="comment">/**1/spa="v. 851/a>1spa= class="comment"> * tipc_node_create - create neighboring node1/spa="v. 861/a>1spa= class="comment"> *1/spa="v. 871/a>1spa= class="comment"> * Currently, this routine>is called by neighbor discovery code, which holds1/spa="v. 881/a>1spa= class="comment"> * net_lock for reading only.  We must take node_create_lock to ensure a node1/spa="v. 891/a>1spa= class="comment"> * isn't created twice if two different bearers discover the node at the sam31/spa="v. 9on a>1spa= class="comment"> * time.  (It would be preferable to switch to holding net_lock in write mode,1/spa="v. 911/a>1spa= class="comment"> * but this is a non-trivial change.)1/spa="v. 921/a>1spa= class="comment"> */1/spa="v. 931/a>struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=tipc_node_create" class="sref">tipc_node_create1/a>(1a href="+code=u32" class="sref">u321/a>.1a href="+code=addr" class="sref">addr1/a>)v. 941/a>{v. 951/a>        struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>, *1a href="+code=temp_node" class="sref">temp_node1/a>;v. 961/a>v. 971/a>        1a href="+code=spin_lock_bh" class="sref">spin_lock_bh1/a>(&1a href="+code=node_create_lock" class="sref">node_create_lock1/a>);v. 981/a>v. 991/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>.=.1a href="+code=tipc_node_find" class="sref">tipc_node_find1/a>(1a href="+code=addr" class="sref">addr1/a>);v.1001/a>        if (1a href="+code=n_ptr" class="sref">n_ptr1/a>) {v.1011/a>                1a href="+code=spin_unlock_bh" class="sref">spin_unlock_bh1/a>(&1a href="+code=node_create_lock" class="sref">node_create_lock1/a>);v.1021/a>                return 1a href="+code=n_ptr" class="sref">n_ptr1/a>;v.1031/a>        }v.1041/a>v.1051/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>.=.1a href="+code=kzalloc" class="sref">kzalloc1/a>(sizeof(*1a href="+code=n_ptr" class="sref">n_ptr1/a>), 1a href="+code=GFP_ATOMIC" class="sref">GFP_ATOMIC1/a>);v.1061/a>        if (!1a href="+code=n_ptr" class="sref">n_ptr1/a>) {v.1071/a>                1a href="+code=spin_unlock_bh" class="sref">spin_unlock_bh1/a>(&1a href="+code=node_create_lock" class="sref">node_create_lock1/a>);v.1081/a>                1a href="+code=pr_warn" class="sref">pr_warn1/a>(1spa= class="string">"Node creat	  >failed, no memory\n"1/spa=");v.1091/a>                return 1a href="+code=NULL" class="sref">NULL1/a>;v.1101/a>        }v.1111/a>v.1121/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=addr" class="sref">addr1/a> =.1a href="+code=addr" class="sref">addr1/a>;v.1131/a>        1a href="+code=spin_lock_init" class="sref">spin_lock_init1/a>(&1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=lock" class="sref">lock1/a>);v.1141/a>        1a href="+code=INIT_HLIST_NODE" class="sref">INIT_HLIST_NODE1/a>(&1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=hash" class="sref">hash1/a>);v.1151/a>        1a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD1/a>(&1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=list" class="sref">list1/a>);v.1161/a>        1a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD1/a>(&1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=nsub" class="sref">nsub1/a>);v.1171/a>v.1181/a>        1a href="+code=hlist_add_head" class="sref">hlist_add_head1/a>(&1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=hash" class="sref">hash1/a>, &1a href="+code=node_htable" class="sref">node_htable1/a>[1a href="+code=tipc_hashfn" class="sref">tipc_hashfn1/a>(1a href="+code=addr" class="sref">addr1/a>)]);v.1191/a>v.1201/a>        1a href="+code=list_for_each_entry" class="sref">list_for_each_entry1/a>(1a href="+code=temp_node" class="sref">temp_node1/a>, &1a href="+code=tipc_node_list" class="sref">tipc_node_list1/a>, 1a href="+code=list" class="sref">list1/a>) {v.1211/a>                if (1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=addr" class="sref">addr1/a> <.1a href="+code=temp_node" class="sref">temp_node1/a>->1a href="+code=addr" class="sref">addr1/a>)v.1221/a>                        break;v.1231/a>        }v.1241/a>        1a href="+code=list_add_tail" class="sref">list_add_tail1/a>(&1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=list" class="sref">list1/a>, &1a href="+code=temp_node" class="sref">temp_node1/a>->1a href="+code=list" class="sref">list1/a>);v.1251/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=block_setup" class="sref">block_setup1/a> =.1a href="+code=WAIT_PEER_DOWN" class="sref">WAIT_PEER_DOWN1/a>;v.1261/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=signature" class="sref">signature1/a> =.1a href="+code=INVALID_NODE_SIG" class="sref">INVALID_NODE_SIG1/a>;v.1271/a>v.1281/a>        1a href="+code=tipc_num_nodes" class="sref">tipc_num_nodes1/a>++;v.1291/a>v.1301/a>        1a href="+code=spin_unlock_bh" class="sref">spin_unlock_bh1/a>(&1a href="+code=node_create_lock" class="sref">node_create_lock1/a>);v.1311/a>        return 1a href="+code=n_ptr" class="sref">n_ptr1/a>;v.1321/a>}v.1331/a>v.1341/a>void.1a href="+code=tipc_node_delete" class="sref">tipc_node_delete1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>)v.1351/a>{v.1361/a>        1a href="+code=list_del" class="sref">list_del1/a>(&1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=list" class="sref">list1/a>);v.1371/a>        1a href="+code=hlist_del" class="sref">hlist_del1/a>(&1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=hash" class="sref">hash1/a>);v.1381/a>        1a href="+code=kfree" class="sref">kfree1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>);v.1391/a>v.1401/a>        1a href="+code=tipc_num_nodes" class="sref">tipc_num_nodes1/a>--;v.1411/a>}v.1421/a>v.1431/a>1spa= class="comment">/**1/spa="v.1441/a>1spa= class="comment"> * tipc_node_link_up - handle addit	   of link1/spa="v.1451/a>1spa= class="comment"> *1/spa="v.1461/a>1spa= class="comment"> * Link becomes act	ve (alone or shared) or standby, depending on its priority.1/spa="v.1471/a>1spa= class="comment"> */1/spa="v.1481/a>void.1a href="+code=tipc_node_link_up" class="sref">tipc_node_link_up1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>, struct.1a href="+code=tipc_link" class="sref">tipc_link1/a> *1a href="+code=l_ptr" class="sref">l_ptr1/a>)v.1491/a>{v.1501/a>        struct.1a href="+code=tipc_link" class="sref">tipc_link1/a> **1a href="+code=act	ve" class="sref">act	ve1/a> =.&1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=act	ve_links" class="sref">act	ve_links1/a>[0];v.1511/a>v.1521/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=working_links" class="sref">working_links1/a>++;v.1531/a>v.1541/a>        1a href="+code=pr_info" class="sref">pr_info1/a>(1spa= class="string">"Established link <%s> on network plane %c\n"1/spa=",v.1551/a>                1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=nam3" class="sref">nam31/a>, 1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=b_ptr" class="sref">b_ptr1/a>->1a href="+code=net_plane" class="sref">net_plane1/a>);v.1561/a>v.1571/a>        if (!1a href="+code=act	ve" class="sref">act	ve1/a>[0]) {v.1581/a>                1a href="+code=act	ve" class="sref">act	ve1/a>[0] =.1a href="+code=act	ve" class="sref">act	ve1/a>[1] =.1a href="+code=l_ptr" class="sref">l_ptr1/a>;v.1591/a>                1a href="+code=node_established_contact" class="sref">node_established_contact1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>);v.1601/a>                return;v.1611/a>        }v.1621/a>        if (1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=priority" class="sref">priority1/a> <.1a href="+code=act	ve" class="sref">act	ve1/a>[0]->1a href="+code=priority" class="sref">priority1/a>) {v.1631/a>                1a href="+code=pr_info" class="sref">pr_info1/a>(1spa= class="string">"New link <%s> becomes standby\n"1/spa=", 1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=nam3" class="sref">nam31/a>);v.1641/a>                return;v.1651/a>        }v.1661/a>        1a href="+code=tipc_link_send_duplicate" class="sref">tipc_link_send_duplicate1/a>(1a href="+code=act	ve" class="sref">act	ve1/a>[0], 1a href="+code=l_ptr" class="sref">l_ptr1/a>);v.1671/a>        if (1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=priority" class="sref">priority1/a> ==.1a href="+code=act	ve" class="sref">act	ve1/a>[0]->1a href="+code=priority" class="sref">priority1/a>) {v.1681/a>                1a href="+code=act	ve" class="sref">act	ve1/a>[0] =.1a href="+code=l_ptr" class="sref">l_ptr1/a>;v.1691/a>                return;v.1701/a>        }v.1711/a>        1a href="+code=pr_info" class="sref">pr_info1/a>(1spa= class="string">"Old link <%s> becomes standby\n"1/spa=", 1a href="+code=act	ve" class="sref">act	ve1/a>[0]->1a href="+code=nam3" class="sref">nam31/a>);v.1721/a>        if (1a href="+code=act	ve" class="sref">act	ve1/a>[1] !=.1a href="+code=act	ve" class="sref">act	ve1/a>[0])v.1731/a>                1a href="+code=pr_info" class="sref">pr_info1/a>(1spa= class="string">"Old link <%s> becomes standby\n"1/spa=", 1a href="+code=act	ve" class="sref">act	ve1/a>[1]->1a href="+code=nam3" class="sref">nam31/a>);v.1741/a>        1a href="+code=act	ve" class="sref">act	ve1/a>[0] =.1a href="+code=act	ve" class="sref">act	ve1/a>[1] =.1a href="+code=l_ptr" class="sref">l_ptr1/a>;v.1751/a>}v.1761/a>v.1771/a>1spa= class="comment">/**1/spa="v.1781/a>1spa= class="comment"> * node_select_act	ve_links - select act	ve link1/spa="v.1791/a>1spa= class="comment"> */1/spa="v.1801/a>static void.1a href="+code=node_select_act	ve_links" class="sref">node_select_act	ve_links1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>)v.1811/a>{v.1821/a>        struct.1a href="+code=tipc_link" class="sref">tipc_link1/a> **1a href="+code=act	ve" class="sref">act	ve1/a> =.&1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=act	ve_links" class="sref">act	ve_links1/a>[0];v.1831/a>        1a href="+code=u32" class="sref">u321/a>.1a href="+code=i" class="sref">i1/a>;v.1841/a>        1a href="+code=u32" class="sref">u321/a>.1a href="+code=highest_prio" class="sref">highest_prio1/a> =.0;v.1851/a>v.1861/a>        1a href="+code=act	ve" class="sref">act	ve1/a>[0] =.1a href="+code=act	ve" class="sref">act	ve1/a>[1] =.1a href="+code=NULL" class="sref">NULL1/a>;v.1871/a>v.1881/a>        for (1a href="+code=i" class="sref">i1/a> =.0;.1a href="+code=i" class="sref">i1/a> <.1a href="+code=MAX_BEARERS" class="sref">MAX_BEARERS1/a>;.1a href="+code=i" class="sref">i1/a>++) {v.1891/a>                struct.1a href="+code=tipc_link" class="sref">tipc_link1/a> *1a href="+code=l_ptr" class="sref">l_ptr1/a> =.1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=links" class="sref">links1/a>[1a href="+code=i" class="sref">i1/a>];v.19on a>v.1911/a>                if (!1a href="+code=l_ptr" class="sref">l_ptr1/a> || !1a href="+code=tipc_link_is_up" class="sref">tipc_link_is_up1/a>(1a href="+code=l_ptr" class="sref">l_ptr1/a>) ||v.1921/a>                    (1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=priority" class="sref">priority1/a> <.1a href="+code=highest_prio" class="sref">highest_prio1/a>))v.1931/a>                        continue;v.1941/a>v.1951/a>                if (1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=priority" class="sref">priority1/a> >.1a href="+code=highest_prio" class="sref">highest_prio1/a>) {v.1961/a>                        1a href="+code=highest_prio" class="sref">highest_prio1/a> =.1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=priority" class="sref">priority1/a>;v.1971/a>                        1a href="+code=act	ve" class="sref">act	ve1/a>[0] =.1a href="+code=act	ve" class="sref">act	ve1/a>[1] =.1a href="+code=l_ptr" class="sref">l_ptr1/a>;v.1981/a>                } else {v.1991/a>                        1a href="+code=act	ve" class="sref">act	ve1/a>[1] =.1a href="+code=l_ptr" class="sref">l_ptr1/a>;v.2001/a>                }v.2011/a>        }v.2021/a>}v.2031/a>v.2041/a>1spa= class="comment">/**1/spa="v.2051/a>1spa= class="comment"> * tipc_node_link_down - handle loss of link1/spa="v.2061/a>1spa= class="comment"> */1/spa="v.2071/a>void.1a href="+code=tipc_node_link_down" class="sref">tipc_node_link_down1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>, struct.1a href="+code=tipc_link" class="sref">tipc_link1/a> *1a href="+code=l_ptr" class="sref">l_ptr1/a>)v.2081/a>{v.2091/a>        struct.1a href="+code=tipc_link" class="sref">tipc_link1/a> **1a href="+code=act	ve" class="sref">act	ve1/a>;v.21on a>v.2111/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=working_links" class="sref">working_links1/a>--;v.2121/a>v.2131/a>        if (!1a href="+code=tipc_link_is_act	ve" class="sref">tipc_link_is_act	ve1/a>(1a href="+code=l_ptr" class="sref">l_ptr1/a>)) {v.2141/a>                1a href="+code=pr_info" class="sref">pr_info1/a>(1spa= class="string">"Lost standby link <%s> on network plane %c\n"1/spa=",v.2151/a>                        1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=nam3" class="sref">nam31/a>, 1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=b_ptr" class="sref">b_ptr1/a>->1a href="+code=net_plane" class="sref">net_plane1/a>);v.2161/a>                return;v.2171/a>        }v.2181/a>        1a href="+code=pr_info" class="sref">pr_info1/a>(1spa= class="string">"Lost link <%s> on network plane %c\n"1/spa=",v.2191/a>                1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=nam3" class="sref">nam31/a>, 1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=b_ptr" class="sref">b_ptr1/a>->1a href="+code=net_plane" class="sref">net_plane1/a>);v.22on a>v.2211/a>        1a href="+code=act	ve" class="sref">act	ve1/a> =.&1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=act	ve_links" class="sref">act	ve_links1/a>[0];v.2221/a>        if (1a href="+code=act	ve" class="sref">act	ve1/a>[0] ==.1a href="+code=l_ptr" class="sref">l_ptr1/a>)v.2231/a>                1a href="+code=act	ve" class="sref">act	ve1/a>[0] =.1a href="+code=act	ve" class="sref">act	ve1/a>[1];v.2241/a>        if (1a href="+code=act	ve" class="sref">act	ve1/a>[1] ==.1a href="+code=l_ptr" class="sref">l_ptr1/a>)v.2251/a>                1a href="+code=act	ve" class="sref">act	ve1/a>[1] =.1a href="+code=act	ve" class="sref">act	ve1/a>[0];v.2261/a>        if (1a href="+code=act	ve" class="sref">act	ve1/a>[0] ==.1a href="+code=l_ptr" class="sref">l_ptr1/a>)v.2271/a>                1a href="+code=node_select_act	ve_links" class="sref">node_select_act	ve_links1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>);v.2281/a>        if (1a href="+code=tipc_node_is_up" class="sref">tipc_node_is_up1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>))v.2291/a>                1a href="+code=tipc_link_changeover" class="sref">tipc_link_changeover1/a>(1a href="+code=l_ptr" class="sref">l_ptr1/a>);v.2301/a>        elsev.2311/a>                1a href="+code=node_lost_contact" class="sref">node_lost_contact1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>);v.2321/a>}v.2331/a>v.2341/a>int.1a href="+code=tipc_node_act	ve_links" class="sref">tipc_node_act	ve_links1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>)v.2351/a>{v.2361/a>        return 1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=act	ve_links" class="sref">act	ve_links1/a>[0] !=.1a href="+code=NULL" class="sref">NULL1/a>;v.2371/a>}v.2381/a>v.2391/a>int.1a href="+code=tipc_node_redundant_links" class="sref">tipc_node_redundant_links1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>)v.2401/a>{v.2411/a>        return 1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=working_links" class="sref">working_links1/a> >.1;v.2421/a>}v.2431/a>v.2441/a>int.1a href="+code=tipc_node_is_up" class="sref">tipc_node_is_up1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>)v.2451/a>{v.2461/a>        return 1a href="+code=tipc_node_act	ve_links" class="sref">tipc_node_act	ve_links1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>);v.2471/a>}v.2481/a>v.2491/a>void.1a href="+code=tipc_node_attach_link" class="sref">tipc_node_attach_link1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>, struct.1a href="+code=tipc_link" class="sref">tipc_link1/a> *1a href="+code=l_ptr" class="sref">l_ptr1/a>)v.2501/a>{v.2511/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=links" class="sref">links1/a>[1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=b_ptr" class="sref">b_ptr1/a>->1a href="+code=identity" class="sref">identity1/a>] =.1a href="+code=l_ptr" class="sref">l_ptr1/a>;v.2521/a>        1a href="+code=atomic_inc" class="sref">atomic_inc1/a>(&1a href="+code=tipc_num_links" class="sref">tipc_num_links1/a>);v.2531/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=link_cnt" class="sref">link_cnt1/a>++;v.2541/a>}v.2551/a>v.2561/a>void.1a href="+code=tipc_node_detach_link" class="sref">tipc_node_detach_link1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>, struct.1a href="+code=tipc_link" class="sref">tipc_link1/a> *1a href="+code=l_ptr" class="sref">l_ptr1/a>)v.2571/a>{v.2581/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=links" class="sref">links1/a>[1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=b_ptr" class="sref">b_ptr1/a>->1a href="+code=identity" class="sref">identity1/a>] =.1a href="+code=NULL" class="sref">NULL1/a>;v.2591/a>        1a href="+code=atomic_dec" class="sref">atomic_dec1/a>(&1a href="+code=tipc_num_links" class="sref">tipc_num_links1/a>);v.2601/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=link_cnt" class="sref">link_cnt1/a>--;v.2611/a>}v.2621/a>v.2631/a>static void.1a href="+code=node_established_contact" class="sref">node_established_contact1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>)v.2641/a>{v.2651/a>        1a href="+code=tipc_k_signal" class="sref">tipc_k_signal1/a>((1a href="+code=Handler" class="sref">Handler1/a>)1a href="+code=tipc_nam3d_node_up" class="sref">tipc_nam3d_node_up1/a>, 1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=addr" class="sref">addr1/a>);v.2661/a>v.2671/a>        if (1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=bclink" class="sref">bclink1/a>.1a href="+code=supportable" class="sref">supportable1/a>) {v.2681/a>                1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=bclink" class="sref">bclink1/a>.1a href="+code=acked" class="sref">acked1/a> =.1a href="+code=tipc_bclink_get_last_sent" class="sref">tipc_bclink_get_last_sent1/a>();v.2691/a>                1a href="+code=tipc_bclink_add_node" class="sref">tipc_bclink_add_node1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=addr" class="sref">addr1/a>);v.2701/a>                1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=bclink" class="sref">bclink1/a>.1a href="+code=supported" class="sref">supported1/a> =.1;v.2711/a>        }v.2721/a>}v.2731/a>v.2741/a>static void.1a href="+code=node_nam3_purge_complete" class="sref">node_nam3_purge_complete1/a>(unsigned long.1a href="+code=node_addr" class="sref">node_addr1/a>)v.2751/a>{v.2761/a>        struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>;v.2771/a>v.2781/a>        1a href="+code=read_lock_bh" class="sref">read_lock_bh1/a>(&1a href="+code=tipc_net_lock" class="sref">tipc_net_lock1/a>);v.2791/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>.=.1a href="+code=tipc_node_find" class="sref">tipc_node_find1/a>(1a href="+code=node_addr" class="sref">node_addr1/a>);v.2801/a>        if (1a href="+code=n_ptr" class="sref">n_ptr1/a>) {v.2811/a>                1a href="+code=tipc_node_lock" class="sref">tipc_node_lock1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>);v.2821/a>                1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=block_setup" class="sref">block_setup1/a> &= ~1a href="+code=WAIT_NAMES_GONE" class="sref">WAIT_NAMES_GONE1/a>;v.2831/a>                1a href="+code=tipc_node_unlock" class="sref">tipc_node_unlock1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>);v.2841/a>        }v.2851/a>        1a href="+code=read_unlock_bh" class="sref">read_unlock_bh1/a>(&1a href="+code=tipc_net_lock" class="sref">tipc_net_lock1/a>);v.2861/a>}v.2871/a>v.2881/a>static void.1a href="+code=node_lost_contact" class="sref">node_lost_contact1/a>(struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>)v.2891/a>{v.2901/a>        char 1a href="+code=addr_string" class="sref">addr_string1/a>[16];v.2911/a>        1a href="+code=u32" class="sref">u321/a>.1a href="+code=i" class="sref">i1/a>;v.2921/a>v.2931/a>        1a href="+code=pr_info" class="sref">pr_info1/a>(1spa= class="string">"Lost contact with %s\n"1/spa=",v.2941/a>                1a href="+code=tipc_addr_string_fill" class="sref">tipc_addr_string_fill1/a>(1a href="+code=addr_string" class="sref">addr_string1/a>, 1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=addr" class="sref">addr1/a>));v.2951/a>v.2961/a>        1spa= class="comment">/* Flush broadcast link info associated with lost node */1/spa="v.2971/a>        if (1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=bclink" class="sref">bclink1/a>.1a href="+code=supported" class="sref">supported1/a>) {v.2981/a>                while (1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=bclink" class="sref">bclink1/a>.1a href="+code=deferred_head" class="sref">deferred_head1/a>) {v.2991/a>                        struct.1a href="+code=sk_buff" class="sref">sk_buff1/a> *1a href="+code=buf" class="sref">buf1/a>.=.1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=bclink" class="sref">bclink1/a>.1a href="+code=deferred_head" class="sref">deferred_head1/a>;v.3001/a>                        1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=bclink" class="sref">bclink1/a>.1a href="+code=deferred_head" class="sref">deferred_head1/a>.=.1a href="+code=buf" class="sref">buf1/a>->1a href="+code=next" class="sref">next1/a>;v.3011/a>                        1a href="+code=kfree_skb" class="sref">kfree_skb1/a>(1a href="+code=buf" class="sref">buf1/a>);v.3021/a>                }v.3031/a>                1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=bclink" class="sref">bclink1/a>.1a href="+code=deferred_size" class="sref">deferred_size1/a>.=.0;v.3041/a>v.3051/a>                if (1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=bclink" class="sref">bclink1/a>.1a href="+code=defragm" class="sref">defragm1/a>) {v.3061/a>                        1a href="+code=kfree_skb" class="sref">kfree_skb1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=bclink" class="sref">bclink1/a>.1a href="+code=defragm" class="sref">defragm1/a>);v.3071/a>                        1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=bclink" class="sref">bclink1/a>.1a href="+code=defragm" class="sref">defragm1/a> =.1a href="+code=NULL" class="sref">NULL1/a>;v.3081/a>                }v.3091/a>v.3101/a>                1a href="+code=tipc_bclink_remove_node" class="sref">tipc_bclink_remove_node1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=addr" class="sref">addr1/a>);v.3111/a>                1a href="+code=tipc_bclink_acknowledge" class="sref">tipc_bclink_acknowledge1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>, 1a href="+code=INVALID_LINK_SEQ" class="sref">INVALID_LINK_SEQ1/a>);v.3121/a>v.3131/a>                1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=bclink" class="sref">bclink1/a>.1a href="+code=supported" class="sref">supported1/a> =.0;v.3141/a>        }v.3151/a>v.3161/a>        1spa= class="comment">/* Abort link changeover */1/spa="v.3171/a>        for (1a href="+code=i" class="sref">i1/a> =.0;.1a href="+code=i" class="sref">i1/a> <.1a href="+code=MAX_BEARERS" class="sref">MAX_BEARERS1/a>;.1a href="+code=i" class="sref">i1/a>++) {v.3181/a>                struct.1a href="+code=tipc_link" class="sref">tipc_link1/a> *1a href="+code=l_ptr" class="sref">l_ptr1/a> =.1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=links" class="sref">links1/a>[1a href="+code=i" class="sref">i1/a>];v.3191/a>                if (!1a href="+code=l_ptr" class="sref">l_ptr1/a>)v.3201/a>                        continue;v.3211/a>                1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=reset_checkpoint" class="sref">reset_checkpoint1/a> =.1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=next_in_no" class="sref">next_in_no1/a>;v.3221/a>                1a href="+code=l_ptr" class="sref">l_ptr1/a>->1a href="+code=exp_msg_count" class="sref">exp_msg_count1/a> =.0;v.3231/a>                1a href="+code=tipc_link_reset_fragments" class="sref">tipc_link_reset_fragments1/a>(1a href="+code=l_ptr" class="sref">l_ptr1/a>);v.3241/a>        }v.3251/a>v.3261/a>        1spa= class="comment">/* Notify subscribers */1/spa="v.3271/a>        1a href="+code=tipc_nodesub_notify" class="sref">tipc_nodesub_notify1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>);v.3281/a>v.3291/a>        1spa= class="comment">/* Prevent re-contact with node until cleanup is done */1/spa="v.3301/a>        1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=block_setup" class="sref">block_setup1/a> =.1a href="+code=WAIT_PEER_DOWN" class="sref">WAIT_PEER_DOWN1/a> |.1a href="+code=WAIT_NAMES_GONE" class="sref">WAIT_NAMES_GONE1/a>;v.3311/a>        1a href="+code=tipc_k_signal" class="sref">tipc_k_signal1/a>((1a href="+code=Handler" class="sref">Handler1/a>)1a href="+code=node_nam3_purge_complete" class="sref">node_nam3_purge_complete1/a>, 1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=addr" class="sref">addr1/a>);v.3321/a>}v.3331/a>v.3341/a>struct.1a href="+code=sk_buff" class="sref">sk_buff1/a> *1a href="+code=tipc_node_get_nodes" class="sref">tipc_node_get_nodes1/a>(const void.*1a href="+code=req_tlv_area" class="sref">req_tlv_area1/a>, int.1a href="+code=req_tlv_space" class="sref">req_tlv_space1/a>)v.3351/a>{v.3361/a>        1a href="+code=u32" class="sref">u321/a>.1a href="+code=domain" class="sref">domain1/a>;v.3371/a>        struct.1a href="+code=sk_buff" class="sref">sk_buff1/a> *1a href="+code=buf" class="sref">buf1/a>;v.3381/a>        struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>;v.3391/a>        struct.1a href="+code=tipc_node_info" class="sref">tipc_node_info1/a>.1a href="+code=node_info" class="sref">node_info1/a>;v.3401/a>        1a href="+code=u32" class="sref">u321/a>.1a href="+code=payload_size" class="sref">payload_size1/a>;v.3411/a>v.3421/a>        if (!1a href="+code=TLV_CHECK" class="sref">TLV_CHECK1/a>(1a href="+code=req_tlv_area" class="sref">req_tlv_area1/a>, 1a href="+code=req_tlv_space" class="sref">req_tlv_space1/a>, 1a href="+code=TIPC_TLV_NET_ADDR" class="sref">TIPC_TLV_NET_ADDR1/a>))v.3431/a>                return 1a href="+code=tipc_cfg_reply_error_string" class="sref">tipc_cfg_reply_error_string1/a>(1a href="+code=TIPC_CFG_TLV_ERROR" class="sref">TIPC_CFG_TLV_ERROR1/a>);v.3441/a>v.3451/a>        1a href="+code=domain" class="sref">domain1/a> =.1a href="+code=ntohl" class="sref">ntohl1/a>(*(1a href="+code=__be32" class="sref">__be321/a> *)1a href="+code=TLV_DATA" class="sref">TLV_DATA1/a>(1a href="+code=req_tlv_area" class="sref">req_tlv_area1/a>));v.3461/a>        if (!1a href="+code=tipc_addr_domain_valid" class="sref">tipc_addr_domain_valid1/a>(1a href="+code=domain" class="sref">domain1/a>))v.3471/a>                return 1a href="+code=tipc_cfg_reply_error_string" class="sref">tipc_cfg_reply_error_string1/a>(1a href="+code=TIPC_CFG_INVALID_VALUE" class="sref">TIPC_CFG_INVALID_VALUE1/a>v.3481/a>                                                   1spa= class="string">" (network address)"1/spa=");v.3491/a>v.3501/a>        1a href="+code=read_lock_bh" class="sref">read_lock_bh1/a>(&1a href="+code=tipc_net_lock" class="sref">tipc_net_lock1/a>);v.3511/a>        if (!1a href="+code=tipc_num_nodes" class="sref">tipc_num_nodes1/a>) {v.3521/a>                1a href="+code=read_unlock_bh" class="sref">read_unlock_bh1/a>(&1a href="+code=tipc_net_lock" class="sref">tipc_net_lock1/a>);v.3531/a>                return 1a href="+code=tipc_cfg_reply_none" class="sref">tipc_cfg_reply_none1/a>();v.3541/a>        }v.3551/a>v.3561/a>        1spa= class="comment">/* For now, get space for all other nodes */1/spa="v.3571/a>        1a href="+code=payload_size" class="sref">payload_size1/a> =.1a href="+code=TLV_SPACE" class="sref">TLV_SPACE1/a>(sizeof(1a href="+code=node_info" class="sref">node_info1/a>)) *.1a href="+code=tipc_num_nodes" class="sref">tipc_num_nodes1/a>;v.3581/a>        if (1a href="+code=payload_size" class="sref">payload_size1/a> >.32768u) {v.3591/a>                1a href="+code=read_unlock_bh" class="sref">read_unlock_bh1/a>(&1a href="+code=tipc_net_lock" class="sref">tipc_net_lock1/a>);v.3601/a>                return 1a href="+code=tipc_cfg_reply_error_string" class="sref">tipc_cfg_reply_error_string1/a>(1a href="+code=TIPC_CFG_NOT_SUPPORTED" class="sref">TIPC_CFG_NOT_SUPPORTED1/a>v.3611/a>                                                   1spa= class="string">" (too many nodes)"1/spa=");v.3621/a>        }v.3631/a>        1a href="+code=buf" class="sref">buf1/a>.=.1a href="+code=tipc_cfg_reply_alloc" class="sref">tipc_cfg_reply_alloc1/a>(1a href="+code=payload_size" class="sref">payload_size1/a>);v.3641/a>        if (!1a href="+code=buf" class="sref">buf1/a>) {v.3651/a>                1a href="+code=read_unlock_bh" class="sref">read_unlock_bh1/a>(&1a href="+code=tipc_net_lock" class="sref">tipc_net_lock1/a>);v.3661/a>                return.1a href="+code=NULL" class="sref">NULL1/a>;v.3671/a>        }v.3681/a>v.3691/a>        1spa= class="comment">/* Add TLVs for all nodes in scope */1/spa="v.3701/a>        1a href="+code=list_for_each_entry" class="sref">list_for_each_entry1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>,.&1a href="+code=tipc_node_list" class="sref">tipc_node_list1/a>, 1a href="+code=list" class="sref">list1/a>) {v.3711/a>                if (!1a href="+code=tipc_in_scope" class="sref">tipc_in_scope1/a>(1a href="+code=domain" class="sref">domain1/a>, 1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=addr" class="sref">addr1/a>))v.3721/a>                        continue;v.3731/a>                1a href="+code=node_info" class="sref">node_info1/a>.1a href="+code=addr" class="sref">addr1/a>.=.1a href="+code=htonl" class="sref">htonl1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=addr" class="sref">addr1/a>);v.3741/a>                1a href="+code=node_info" class="sref">node_info1/a>.1a href="+code=up" class="sref">up1/a> =.1a href="+code=htonl" class="sref">htonl1/a>(1a href="+code=tipc_node_is_up" class="sref">tipc_node_is_up1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>));v.3751/a>                1a href="+code=tipc_cfg_append_tlv" class="sref">tipc_cfg_append_tlv1/a>(1a href="+code=buf" class="sref">buf1/a>, 1a href="+code=TIPC_TLV_NODE_INFO" class="sref">TIPC_TLV_NODE_INFO1/a>,v.3761/a>                                    &1a href="+code=node_info" class="sref">node_info1/a>, sizeof(1a href="+code=node_info" class="sref">node_info1/a>));v.3771/a>        }v.3781/a>v.3791/a>        1a href="+code=read_unlock_bh" class="sref">read_unlock_bh1/a>(&1a href="+code=tipc_net_lock" class="sref">tipc_net_lock1/a>);v.3801/a>        return.1a href="+code=buf" class="sref">buf1/a>;v.3811/a>}v.3821/a>v.3831/a>struct.1a href="+code=sk_buff" class="sref">sk_buff1/a> *1a href="+code=tipc_node_get_links" class="sref">tipc_node_get_links1/a>(const void.*1a href="+code=req_tlv_area" class="sref">req_tlv_area1/a>, int.1a href="+code=req_tlv_space" class="sref">req_tlv_space1/a>)v.3841/a>{v.3851/a>        1a href="+code=u32" class="sref">u321/a>.1a href="+code=domain" class="sref">domain1/a>;v.3861/a>        struct.1a href="+code=sk_buff" class="sref">sk_buff1/a> *1a href="+code=buf" class="sref">buf1/a>;v.3871/a>        struct.1a href="+code=tipc_node" class="sref">tipc_node1/a> *1a href="+code=n_ptr" class="sref">n_ptr1/a>;v.3881/a>        struct.1a href="+code=tipc_link_info" class="sref">tipc_link_info1/a>.1a href="+code=link_info" class="sref">link_info1/a>;v.3891/a>        1a href="+code=u32" class="sref">u321/a>.1a href="+code=payload_size" class="sref">payload_size1/a>;v.39on a>v.3911/a>        if (!1a href="+code=TLV_CHECK" class="sref">TLV_CHECK1/a>(1a href="+code=req_tlv_area" class="sref">req_tlv_area1/a>, 1a href="+code=req_tlv_space" class="sref">req_tlv_space1/a>, 1a href="+code=TIPC_TLV_NET_ADDR" class="sref">TIPC_TLV_NET_ADDR1/a>))v.3921/a>                return 1a href="+code=tipc_cfg_reply_error_string" class="sref">tipc_cfg_reply_error_string1/a>(1a href="+code=TIPC_CFG_TLV_ERROR" class="sref">TIPC_CFG_TLV_ERROR1/a>);v.3931/a>v.3941/a>        1a href="+code=domain" class="sref">domain1/a> =.1a href="+code=ntohl" class="sref">ntohl1/a>(*(1a href="+code=__be32" class="sref">__be321/a> *)1a href="+code=TLV_DATA" class="sref">TLV_DATA1/a>(1a href="+code=req_tlv_area" class="sref">req_tlv_area1/a>));v.3951/a>        if (!1a href="+code=tipc_addr_domain_valid" class="sref">tipc_addr_domain_valid1/a>(1a href="+code=domain" class="sref">domain1/a>))v.3961/a>                return.1a href="+code=tipc_cfg_reply_error_string" class="sref">tipc_cfg_reply_error_string1/a>(1a href="+code=TIPC_CFG_INVALID_VALUE" class="sref">TIPC_CFG_INVALID_VALUE1/a>v.3971/a>                                                   1spa= class="string">" (network address)"1/spa=");v.3981/a>v.3991/a>        if (!1a href="+code=tipc_own_addr" class="sref">tipc_own_addr1/a>)v.4001/a>                return 1a href="+code=tipc_cfg_reply_none" class="sref">tipc_cfg_reply_none1/a>();v.4011/a>v.4021/a>        1a href="+code=read_lock_bh" class="sref">read_lock_bh1/a>(&1a href="+code=tipc_net_lock" class="sref">tipc_net_lock1/a>);v.4031/a>v.4041/a>        1spa= class="comment">/* Get space for all unicast links + broadcast link */1/spa="v.4051/a>        1a href="+code=payload_size" class="sref">payload_size1/a> =.1a href="+code=TLV_SPACE" class="sref">TLV_SPACE1/a>(sizeof(1a href="+code=link_info" class="sref">link_info1/a>)) *v.4061/a>                (1a href="+code=atomic_read" class="sref">atomic_read1/a>(&1a href="+code=tipc_num_links" class="sref">tipc_num_links1/a>) + 1);v.4071/a>        if (1a href="+code=payload_size" class="sref">payload_size1/a> >.32768u) {v.4081/a>                1a href="+code=read_unlock_bh" class="sref">read_unlock_bh1/a>(&1a href="+code=tipc_net_lock" class="sref">tipc_net_lock1/a>);v.4091/a>                return 1a href="+code=tipc_cfg_reply_error_string" class="sref">tipc_cfg_reply_error_string1/a>(1a href="+code=TIPC_CFG_NOT_SUPPORTED" class="sref">TIPC_CFG_NOT_SUPPORTED1/a>v.4101/a>                                                   1spa= class="string">" (too many links)"1/spa=");v.4111/a>        }v.4121/a>        1a href="+code=buf" class="sref">buf1/a>.=.1a href="+code=tipc_cfg_reply_alloc" class="sref">tipc_cfg_reply_alloc1/a>(1a href="+code=payload_size" class="sref">payload_size1/a>);v.4131/a>        if (!1a href="+code=buf" class="sref">buf1/a>) {v.4141/a>                1a href="+code=read_unlock_bh" class="sref">read_unlock_bh1/a>(&1a href="+code=tipc_net_lock" class="sref">tipc_net_lock1/a>);v.4151/a>                return.1a href="+code=NULL" class="sref">NULL1/a>;v.4161/a>        }v.4171/a>v.4181/a>        1spa= class="comment">/* Add TLV for broadcast link */1/spa="v.4191/a>        1a href="+code=link_info" class="sref">link_info1/a>.1a href="+code=dest" class="sref">dest1/a> =.1a href="+code=htonl" class="sref">htonl1/a>(1a href="+code=tipc_cluster_mask" class="sref">tipc_cluster_mask1/a>(1a href="+code=tipc_own_addr" class="sref">tipc_own_addr1/a>));v.4201/a>        1a href="+code=link_info" class="sref">link_info1/a>.1a href="+code=up" class="sref">up1/a> =.1a href="+code=htonl" class="sref">htonl1/a>(1);v.4211/a>        1a href="+code=strlcpy" class="sref">strlcpy1/a>(1a href="+code=link_info" class="sref">link_info1/a>.1a href="+code=str" class="sref">str1/a>, 1a href="+code=tipc_bclink_nam3" class="sref">tipc_bclink_nam31/a>, 1a href="+code=TIPC_MAX_LINK_NAME" class="sref">TIPC_MAX_LINK_NAME1/a>);v.4221/a>        1a href="+code=tipc_cfg_append_tlv" class="sref">tipc_cfg_append_tlv1/a>(1a href="+code=buf" class="sref">buf1/a>, 1a href="+code=TIPC_TLV_LINK_INFO" class="sref">TIPC_TLV_LINK_INFO1/a>, &1a href="+code=link_info" class="sref">link_info1/a>, sizeof(1a href="+code=link_info" class="sref">link_info1/a>));v.4231/a>v.4241/a>        1spa= class="comment">/* Add TLVs for any other links in scope */1/spa="v.4251/a>        1a href="+code=list_for_each_entry" class="sref">list_for_each_entry1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>,.&1a href="+code=tipc_node_list" class="sref">tipc_node_list1/a>, 1a href="+code=list" class="sref">list1/a>) {v.4261/a>                1a href="+code=u32" class="sref">u321/a>.1a href="+code=i" class="sref">i1/a>;v.4271/a>v.4281/a>                if (!1a href="+code=tipc_in_scope" class="sref">tipc_in_scope1/a>(1a href="+code=domain" class="sref">domain1/a>, 1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=addr" class="sref">addr1/a>))v.4291/a>                        continue;v.4301/a>                1a href="+code=tipc_node_lock" class="sref">tipc_node_lock1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>);v.4311/a>                for (1a href="+code=i" class="sref">i1/a> =.0;.1a href="+code=i" class="sref">i1/a> <.1a href="+code=MAX_BEARERS" class="sref">MAX_BEARERS1/a>;.1a href="+code=i" class="sref">i1/a>++) {v.4321/a>                        if (!1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=links" class="sref">links1/a>[1a href="+code=i" class="sref">i1/a>])v.4331/a>                                continue;v.4341/a>                        1a href="+code=link_info" class="sref">link_info1/a>.1a href="+code=dest" class="sref">dest1/a> =.1a href="+code=htonl" class="sref">htonl1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=addr" class="sref">addr1/a>);v.4351/a>                        1a href="+code=link_info" class="sref">link_info1/a>.1a href="+code=up" class="sref">up1/a> =.1a href="+code=htonl" class="sref">htonl1/a>(1a href="+code=tipc_link_is_up" class="sref">tipc_link_is_up1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=links" class="sref">links1/a>[1a href="+code=i" class="sref">i1/a>]));v.4361/a>                        1a href="+code=strcpy" class="sref">strcpy1/a>(1a href="+code=link_info" class="sref">link_info1/a>.1a href="+code=str" class="sref">str1/a>, 1a href="+code=n_ptr" class="sref">n_ptr1/a>->1a href="+code=links" class="sref">links1/a>[1a href="+code=i" class="sref">i1/a>]->1a href="+code=nam3" class="sref">nam31/a>);v.4371/a>                        1a href="+code=tipc_cfg_append_tlv" class="sref">tipc_cfg_append_tlv1/a>(1a href="+code=buf" class="sref">buf1/a>, 1a href="+code=TIPC_TLV_LINK_INFO" class="sref">TIPC_TLV_LINK_INFO1/a>,v.4381/a>                                            &1a href="+code=link_info" class="sref">link_info1/a>, sizeof(1a href="+code=link_info" class="sref">link_info1/a>));v.4391/a>                }v.4401/a>                1a href="+code=tipc_node_unlock" class="sref">tipc_node_unlock1/a>(1a href="+code=n_ptr" class="sref">n_ptr1/a>);v.4411/a>        }v.4421/a>v.4431/a>        1a href="+code=read_unlock_bh" class="sref">read_unlock_bh1/a>(&1a href="+code=tipc_net_lock" class="sref">tipc_net_lock1/a>);v.4441/a>        return.1a href="+code=buf" class="sref">buf1/a>;v.4451/a>}v.4461/a>
lxr.linux.no kindly hosted by Redpill Linpro AS1/a>, provider of Linux consulting and operations services since 1995.