xref: /linux/net/tipc/name_distr.h (revision ca0c42732c512a12fabe677594840f31861dd31a)
1b97bf3fdSPer Liden /*
2b97bf3fdSPer Liden  * net/tipc/name_distr.h: Include file for TIPC name distribution code
3b97bf3fdSPer Liden  *
4593a5f22SPer Liden  * Copyright (c) 2000-2006, Ericsson AB
5b97bf3fdSPer Liden  * Copyright (c) 2005, 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_NAME_DISTR_H
38b97bf3fdSPer Liden #define _TIPC_NAME_DISTR_H
39b97bf3fdSPer Liden 
40b97bf3fdSPer Liden #include "name_table.h"
41b97bf3fdSPer Liden 
42*ca0c4273SYing Xue #define ITEM_SIZE sizeof(struct distr_item)
43*ca0c4273SYing Xue 
44*ca0c4273SYing Xue /**
45*ca0c4273SYing Xue  * struct distr_item - publication info distributed to other nodes
46*ca0c4273SYing Xue  * @type: name sequence type
47*ca0c4273SYing Xue  * @lower: name sequence lower bound
48*ca0c4273SYing Xue  * @upper: name sequence upper bound
49*ca0c4273SYing Xue  * @ref: publishing port reference
50*ca0c4273SYing Xue  * @key: publication key
51*ca0c4273SYing Xue  *
52*ca0c4273SYing Xue  * ===> All fields are stored in network byte order. <===
53*ca0c4273SYing Xue  *
54*ca0c4273SYing Xue  * First 3 fields identify (name or) name sequence being published.
55*ca0c4273SYing Xue  * Reference field uniquely identifies port that published name sequence.
56*ca0c4273SYing Xue  * Key field uniquely identifies publication, in the event a port has
57*ca0c4273SYing Xue  * multiple publications of the same name sequence.
58*ca0c4273SYing Xue  *
59*ca0c4273SYing Xue  * Note: There is no field that identifies the publishing node because it is
60*ca0c4273SYing Xue  * the same for all items contained within a publication message.
61*ca0c4273SYing Xue  */
62*ca0c4273SYing Xue struct distr_item {
63*ca0c4273SYing Xue 	__be32 type;
64*ca0c4273SYing Xue 	__be32 lower;
65*ca0c4273SYing Xue 	__be32 upper;
66*ca0c4273SYing Xue 	__be32 ref;
67*ca0c4273SYing Xue 	__be32 key;
68*ca0c4273SYing Xue };
69*ca0c4273SYing Xue 
70eab8c045SYing Xue struct sk_buff *tipc_named_publish(struct publication *publ);
71eab8c045SYing Xue struct sk_buff *tipc_named_withdraw(struct publication *publ);
72eab8c045SYing Xue void named_cluster_distribute(struct sk_buff *buf);
73*ca0c4273SYing Xue void tipc_named_node_up(u32 max_item_buf, u32 node);
74247f0f3cSYing Xue void tipc_named_rcv(struct sk_buff *buf);
754323add6SPer Liden void tipc_named_reinit(void);
76b97bf3fdSPer Liden 
77b97bf3fdSPer Liden #endif
78