1*b97bf3fdSPer Liden /* 2*b97bf3fdSPer Liden * net/tipc/net.h: Include file for TIPC network routing code 3*b97bf3fdSPer Liden * 4*b97bf3fdSPer Liden * Copyright (c) 2003-2005, Ericsson Research Canada 5*b97bf3fdSPer Liden * Copyright (c) 2005, Wind River Systems 6*b97bf3fdSPer Liden * Copyright (c) 2005-2006, Ericsson AB 7*b97bf3fdSPer Liden * All rights reserved. 8*b97bf3fdSPer Liden * 9*b97bf3fdSPer Liden * Redistribution and use in source and binary forms, with or without 10*b97bf3fdSPer Liden * modification, are permitted provided that the following conditions are met: 11*b97bf3fdSPer Liden * 12*b97bf3fdSPer Liden * Redistributions of source code must retain the above copyright notice, this 13*b97bf3fdSPer Liden * list of conditions and the following disclaimer. 14*b97bf3fdSPer Liden * Redistributions in binary form must reproduce the above copyright notice, 15*b97bf3fdSPer Liden * this list of conditions and the following disclaimer in the documentation 16*b97bf3fdSPer Liden * and/or other materials provided with the distribution. 17*b97bf3fdSPer Liden * Neither the names of the copyright holders nor the names of its 18*b97bf3fdSPer Liden * contributors may be used to endorse or promote products derived from this 19*b97bf3fdSPer Liden * software without specific prior written permission. 20*b97bf3fdSPer Liden * 21*b97bf3fdSPer Liden * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22*b97bf3fdSPer Liden * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23*b97bf3fdSPer Liden * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24*b97bf3fdSPer Liden * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25*b97bf3fdSPer Liden * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26*b97bf3fdSPer Liden * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27*b97bf3fdSPer Liden * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28*b97bf3fdSPer Liden * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29*b97bf3fdSPer Liden * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30*b97bf3fdSPer Liden * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31*b97bf3fdSPer Liden * POSSIBILITY OF SUCH DAMAGE. 32*b97bf3fdSPer Liden */ 33*b97bf3fdSPer Liden 34*b97bf3fdSPer Liden #ifndef _TIPC_NET_H 35*b97bf3fdSPer Liden #define _TIPC_NET_H 36*b97bf3fdSPer Liden 37*b97bf3fdSPer Liden struct _zone; 38*b97bf3fdSPer Liden 39*b97bf3fdSPer Liden /** 40*b97bf3fdSPer Liden * struct network - TIPC network structure 41*b97bf3fdSPer Liden * @zones: array of pointers to all zones within network 42*b97bf3fdSPer Liden */ 43*b97bf3fdSPer Liden 44*b97bf3fdSPer Liden struct network { 45*b97bf3fdSPer Liden struct _zone **zones; 46*b97bf3fdSPer Liden }; 47*b97bf3fdSPer Liden 48*b97bf3fdSPer Liden 49*b97bf3fdSPer Liden extern struct network net; 50*b97bf3fdSPer Liden extern rwlock_t net_lock; 51*b97bf3fdSPer Liden 52*b97bf3fdSPer Liden int net_init(void); 53*b97bf3fdSPer Liden void net_stop(void); 54*b97bf3fdSPer Liden void net_remove_as_router(u32 router); 55*b97bf3fdSPer Liden void net_send_external_routes(u32 dest); 56*b97bf3fdSPer Liden void net_route_msg(struct sk_buff *buf); 57*b97bf3fdSPer Liden struct node *net_select_remote_node(u32 addr, u32 ref); 58*b97bf3fdSPer Liden u32 net_select_router(u32 addr, u32 ref); 59*b97bf3fdSPer Liden 60*b97bf3fdSPer Liden int tipc_start_net(void); 61*b97bf3fdSPer Liden void tipc_stop_net(void); 62*b97bf3fdSPer Liden 63*b97bf3fdSPer Liden #endif 64