xref: /openbmc/linux/net/tipc/net.h (revision 9df3b7eb6ec1c7734482f782bf8335a2737c02f0)
1b97bf3fdSPer Liden /*
2b97bf3fdSPer Liden  * net/tipc/net.h: Include file for TIPC network routing code
3b97bf3fdSPer Liden  *
4593a5f22SPer Liden  * Copyright (c) 1995-2006, Ericsson AB
5*9df3b7ebSAllan Stephens  * Copyright (c) 2005, 2010-2011, Wind River Systems
6b97bf3fdSPer Liden  * All rights reserved.
7b97bf3fdSPer Liden  *
8b97bf3fdSPer Liden  * Redistribution and use in source and binary forms, with or without
9b97bf3fdSPer Liden  * modification, are permitted provided that the following conditions are met:
10b97bf3fdSPer Liden  *
119ea1fd3cSPer Liden  * 1. Redistributions of source code must retain the above copyright
129ea1fd3cSPer Liden  *    notice, this list of conditions and the following disclaimer.
139ea1fd3cSPer Liden  * 2. Redistributions in binary form must reproduce the above copyright
149ea1fd3cSPer Liden  *    notice, this list of conditions and the following disclaimer in the
159ea1fd3cSPer Liden  *    documentation and/or other materials provided with the distribution.
169ea1fd3cSPer Liden  * 3. Neither the names of the copyright holders nor the names of its
179ea1fd3cSPer Liden  *    contributors may be used to endorse or promote products derived from
189ea1fd3cSPer Liden  *    this software without specific prior written permission.
199ea1fd3cSPer Liden  *
209ea1fd3cSPer Liden  * Alternatively, this software may be distributed under the terms of the
219ea1fd3cSPer Liden  * GNU General Public License ("GPL") version 2 as published by the Free
229ea1fd3cSPer Liden  * Software Foundation.
23b97bf3fdSPer Liden  *
24b97bf3fdSPer Liden  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25b97bf3fdSPer Liden  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26b97bf3fdSPer Liden  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27b97bf3fdSPer Liden  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28b97bf3fdSPer Liden  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29b97bf3fdSPer Liden  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30b97bf3fdSPer Liden  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31b97bf3fdSPer Liden  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32b97bf3fdSPer Liden  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33b97bf3fdSPer Liden  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34b97bf3fdSPer Liden  * POSSIBILITY OF SUCH DAMAGE.
35b97bf3fdSPer Liden  */
36b97bf3fdSPer Liden 
37b97bf3fdSPer Liden #ifndef _TIPC_NET_H
38b97bf3fdSPer Liden #define _TIPC_NET_H
39b97bf3fdSPer Liden 
408f92df6aSAllan Stephens struct tipc_node;
41b97bf3fdSPer Liden 
42b97bf3fdSPer Liden /**
43b97bf3fdSPer Liden  * struct network - TIPC network structure
448f92df6aSAllan Stephens  * @nodes: array of pointers to all nodes within cluster
458f92df6aSAllan Stephens  * @highest_node: id of highest numbered node within cluster
4651f98a8dSAllan Stephens  * @links: number of (unicast) links to cluster
47b97bf3fdSPer Liden  */
48b97bf3fdSPer Liden 
49b97bf3fdSPer Liden struct network {
508f92df6aSAllan Stephens 	struct tipc_node **nodes;
518f92df6aSAllan Stephens 	u32 highest_node;
52*9df3b7ebSAllan Stephens 	atomic_t links;
53b97bf3fdSPer Liden };
54b97bf3fdSPer Liden 
55b97bf3fdSPer Liden 
564323add6SPer Liden extern struct network tipc_net;
574323add6SPer Liden extern rwlock_t tipc_net_lock;
58b97bf3fdSPer Liden 
594323add6SPer Liden void tipc_net_route_msg(struct sk_buff *buf);
60b97bf3fdSPer Liden 
6103194379SAllan Stephens int tipc_net_start(u32 addr);
624323add6SPer Liden void tipc_net_stop(void);
63b97bf3fdSPer Liden 
64b97bf3fdSPer Liden #endif
65