This source file includes following definitions.
- tipc_addr
- tipc_zone
- tipc_cluster
- tipc_node
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 #ifndef _LINUX_TIPC_H_
39 #define _LINUX_TIPC_H_
40
41 #include <linux/types.h>
42 #include <linux/sockios.h>
43
44
45
46
47
48 struct tipc_socket_addr {
49 __u32 ref;
50 __u32 node;
51 };
52
53 struct tipc_service_addr {
54 __u32 type;
55 __u32 instance;
56 };
57
58 struct tipc_service_range {
59 __u32 type;
60 __u32 lower;
61 __u32 upper;
62 };
63
64
65
66
67
68 #define TIPC_NODE_STATE 0
69 #define TIPC_TOP_SRV 1
70 #define TIPC_LINK_STATE 2
71 #define TIPC_RESERVED_TYPES 64
72
73
74
75
76 enum tipc_scope {
77 TIPC_CLUSTER_SCOPE = 2,
78 TIPC_NODE_SCOPE = 3
79 };
80
81
82
83
84
85 #define TIPC_MAX_USER_MSG_SIZE 66000U
86
87
88
89
90
91 #define TIPC_LOW_IMPORTANCE 0
92 #define TIPC_MEDIUM_IMPORTANCE 1
93 #define TIPC_HIGH_IMPORTANCE 2
94 #define TIPC_CRITICAL_IMPORTANCE 3
95
96
97
98
99
100 #define TIPC_OK 0
101 #define TIPC_ERR_NO_NAME 1
102 #define TIPC_ERR_NO_PORT 2
103 #define TIPC_ERR_NO_NODE 3
104 #define TIPC_ERR_OVERLOAD 4
105 #define TIPC_CONN_SHUTDOWN 5
106
107
108
109
110
111 #define TIPC_SUB_PORTS 0x01
112 #define TIPC_SUB_SERVICE 0x02
113 #define TIPC_SUB_CANCEL 0x04
114
115 #define TIPC_WAIT_FOREVER (~0)
116
117 struct tipc_subscr {
118 struct tipc_service_range seq;
119 __u32 timeout;
120 __u32 filter;
121 char usr_handle[8];
122 };
123
124 #define TIPC_PUBLISHED 1
125 #define TIPC_WITHDRAWN 2
126 #define TIPC_SUBSCR_TIMEOUT 3
127
128 struct tipc_event {
129 __u32 event;
130 __u32 found_lower;
131 __u32 found_upper;
132 struct tipc_socket_addr port;
133 struct tipc_subscr s;
134 };
135
136
137
138
139
140 #ifndef AF_TIPC
141 #define AF_TIPC 30
142 #endif
143
144 #ifndef PF_TIPC
145 #define PF_TIPC AF_TIPC
146 #endif
147
148 #ifndef SOL_TIPC
149 #define SOL_TIPC 271
150 #endif
151
152 #define TIPC_ADDR_MCAST 1
153 #define TIPC_SERVICE_RANGE 1
154 #define TIPC_SERVICE_ADDR 2
155 #define TIPC_SOCKET_ADDR 3
156
157 struct sockaddr_tipc {
158 unsigned short family;
159 unsigned char addrtype;
160 signed char scope;
161 union {
162 struct tipc_socket_addr id;
163 struct tipc_service_range nameseq;
164 struct {
165 struct tipc_service_addr name;
166 __u32 domain;
167 } name;
168 } addr;
169 };
170
171
172
173
174
175 #define TIPC_ERRINFO 1
176 #define TIPC_RETDATA 2
177 #define TIPC_DESTNAME 3
178
179
180
181
182
183 #define TIPC_IMPORTANCE 127
184 #define TIPC_SRC_DROPPABLE 128
185 #define TIPC_DEST_DROPPABLE 129
186 #define TIPC_CONN_TIMEOUT 130
187 #define TIPC_NODE_RECVQ_DEPTH 131
188 #define TIPC_SOCK_RECVQ_DEPTH 132
189 #define TIPC_MCAST_BROADCAST 133
190 #define TIPC_MCAST_REPLICAST 134
191 #define TIPC_GROUP_JOIN 135
192 #define TIPC_GROUP_LEAVE 136
193 #define TIPC_SOCK_RECVQ_USED 137
194
195
196
197
198 #define TIPC_GROUP_LOOPBACK 0x1
199 #define TIPC_GROUP_MEMBER_EVTS 0x2
200
201 struct tipc_group_req {
202 __u32 type;
203 __u32 instance;
204 __u32 scope;
205 __u32 flags;
206 };
207
208
209
210
211
212
213
214
215 #define TIPC_NODEID_LEN 16
216 #define TIPC_MAX_MEDIA_NAME 16
217 #define TIPC_MAX_IF_NAME 16
218 #define TIPC_MAX_BEARER_NAME 32
219 #define TIPC_MAX_LINK_NAME 68
220
221 #define SIOCGETLINKNAME SIOCPROTOPRIVATE
222 #define SIOCGETNODEID (SIOCPROTOPRIVATE + 1)
223
224 struct tipc_sioc_ln_req {
225 __u32 peer;
226 __u32 bearer_id;
227 char linkname[TIPC_MAX_LINK_NAME];
228 };
229
230 struct tipc_sioc_nodeid_req {
231 __u32 peer;
232 char node_id[TIPC_NODEID_LEN];
233 };
234
235
236
237
238 #define TIPC_CFG_SRV 0
239 #define TIPC_ZONE_SCOPE 1
240
241 #define TIPC_ADDR_NAMESEQ 1
242 #define TIPC_ADDR_NAME 2
243 #define TIPC_ADDR_ID 3
244
245 #define TIPC_NODE_BITS 12
246 #define TIPC_CLUSTER_BITS 12
247 #define TIPC_ZONE_BITS 8
248
249 #define TIPC_NODE_OFFSET 0
250 #define TIPC_CLUSTER_OFFSET TIPC_NODE_BITS
251 #define TIPC_ZONE_OFFSET (TIPC_CLUSTER_OFFSET + TIPC_CLUSTER_BITS)
252
253 #define TIPC_NODE_SIZE ((1UL << TIPC_NODE_BITS) - 1)
254 #define TIPC_CLUSTER_SIZE ((1UL << TIPC_CLUSTER_BITS) - 1)
255 #define TIPC_ZONE_SIZE ((1UL << TIPC_ZONE_BITS) - 1)
256
257 #define TIPC_NODE_MASK (TIPC_NODE_SIZE << TIPC_NODE_OFFSET)
258 #define TIPC_CLUSTER_MASK (TIPC_CLUSTER_SIZE << TIPC_CLUSTER_OFFSET)
259 #define TIPC_ZONE_MASK (TIPC_ZONE_SIZE << TIPC_ZONE_OFFSET)
260
261 #define TIPC_ZONE_CLUSTER_MASK (TIPC_ZONE_MASK | TIPC_CLUSTER_MASK)
262
263 #define tipc_portid tipc_socket_addr
264 #define tipc_name tipc_service_addr
265 #define tipc_name_seq tipc_service_range
266
267 static inline __u32 tipc_addr(unsigned int zone,
268 unsigned int cluster,
269 unsigned int node)
270 {
271 return (zone << TIPC_ZONE_OFFSET) |
272 (cluster << TIPC_CLUSTER_OFFSET) |
273 node;
274 }
275
276 static inline unsigned int tipc_zone(__u32 addr)
277 {
278 return addr >> TIPC_ZONE_OFFSET;
279 }
280
281 static inline unsigned int tipc_cluster(__u32 addr)
282 {
283 return (addr & TIPC_CLUSTER_MASK) >> TIPC_CLUSTER_OFFSET;
284 }
285
286 static inline unsigned int tipc_node(__u32 addr)
287 {
288 return addr & TIPC_NODE_MASK;
289 }
290
291 #endif