aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tipc_config.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tipc_config.h')
-rw-r--r--include/linux/tipc_config.h114
1 files changed, 43 insertions, 71 deletions
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index 9cde86c32412..0db239590b4d 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/linux/tipc_config.h: Include file for TIPC configuration interface 2 * include/linux/tipc_config.h: Include file for TIPC configuration interface
3 * 3 *
4 * Copyright (c) 2003-2006, Ericsson AB 4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005-2007, Wind River Systems 5 * Copyright (c) 2005-2007, 2010-2011, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -54,19 +54,19 @@
54 * which specify parameters or results for the operation. 54 * which specify parameters or results for the operation.
55 * 55 *
56 * For many operations, the request and reply messages have a fixed number 56 * For many operations, the request and reply messages have a fixed number
57 * of TLVs (usually zero or one); however, some reply messages may return 57 * of TLVs (usually zero or one); however, some reply messages may return
58 * a variable number of TLVs. A failed request is denoted by the presence 58 * a variable number of TLVs. A failed request is denoted by the presence
59 * of an "error string" TLV in the reply message instead of the TLV(s) the 59 * of an "error string" TLV in the reply message instead of the TLV(s) the
60 * reply should contain if the request succeeds. 60 * reply should contain if the request succeeds.
61 */ 61 */
62 62
63/* 63/*
64 * Public commands: 64 * Public commands:
65 * May be issued by any process. 65 * May be issued by any process.
66 * Accepted by own node, or by remote node only if remote management enabled. 66 * Accepted by own node, or by remote node only if remote management enabled.
67 */ 67 */
68 68
69#define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */ 69#define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */
70#define TIPC_CMD_GET_NODES 0x0001 /* tx net_addr, rx node_info(s) */ 70#define TIPC_CMD_GET_NODES 0x0001 /* tx net_addr, rx node_info(s) */
71#define TIPC_CMD_GET_MEDIA_NAMES 0x0002 /* tx none, rx media_name(s) */ 71#define TIPC_CMD_GET_MEDIA_NAMES 0x0002 /* tx none, rx media_name(s) */
72#define TIPC_CMD_GET_BEARER_NAMES 0x0003 /* tx none, rx bearer_name(s) */ 72#define TIPC_CMD_GET_BEARER_NAMES 0x0003 /* tx none, rx bearer_name(s) */
@@ -76,28 +76,21 @@
76#define TIPC_CMD_SHOW_LINK_STATS 0x000B /* tx link_name, rx ultra_string */ 76#define TIPC_CMD_SHOW_LINK_STATS 0x000B /* tx link_name, rx ultra_string */
77#define TIPC_CMD_SHOW_STATS 0x000F /* tx unsigned, rx ultra_string */ 77#define TIPC_CMD_SHOW_STATS 0x000F /* tx unsigned, rx ultra_string */
78 78
79#if 0 79/*
80#define TIPC_CMD_SHOW_PORT_STATS 0x0008 /* tx port_ref, rx ultra_string */
81#define TIPC_CMD_RESET_PORT_STATS 0x0009 /* tx port_ref, rx none */
82#define TIPC_CMD_GET_ROUTES 0x000A /* tx ?, rx ? */
83#define TIPC_CMD_GET_LINK_PEER 0x000D /* tx link_name, rx ? */
84#endif
85
86/*
87 * Protected commands: 80 * Protected commands:
88 * May only be issued by "network administration capable" process. 81 * May only be issued by "network administration capable" process.
89 * Accepted by own node, or by remote node only if remote management enabled 82 * Accepted by own node, or by remote node only if remote management enabled
90 * and this node is zone manager. 83 * and this node is zone manager.
91 */ 84 */
92 85
93#define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */ 86#define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */
94#define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */ 87#define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */
95#define TIPC_CMD_GET_MAX_PUBL 0x4005 /* tx none, rx unsigned */ 88#define TIPC_CMD_GET_MAX_PUBL 0x4005 /* tx none, rx unsigned */
96#define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* tx none, rx unsigned */ 89#define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* tx none, rx unsigned */
97#define TIPC_CMD_GET_MAX_ZONES 0x4007 /* tx none, rx unsigned */ 90#define TIPC_CMD_GET_MAX_ZONES 0x4007 /* obsoleted */
98#define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* tx none, rx unsigned */ 91#define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* obsoleted */
99#define TIPC_CMD_GET_MAX_NODES 0x4009 /* tx none, rx unsigned */ 92#define TIPC_CMD_GET_MAX_NODES 0x4009 /* obsoleted */
100#define TIPC_CMD_GET_MAX_SLAVES 0x400A /* tx none, rx unsigned */ 93#define TIPC_CMD_GET_MAX_SLAVES 0x400A /* obsoleted */
101#define TIPC_CMD_GET_NETID 0x400B /* tx none, rx unsigned */ 94#define TIPC_CMD_GET_NETID 0x400B /* tx none, rx unsigned */
102 95
103#define TIPC_CMD_ENABLE_BEARER 0x4101 /* tx bearer_config, rx none */ 96#define TIPC_CMD_ENABLE_BEARER 0x4101 /* tx bearer_config, rx none */
@@ -109,31 +102,21 @@
109#define TIPC_CMD_DUMP_LOG 0x410B /* tx none, rx ultra_string */ 102#define TIPC_CMD_DUMP_LOG 0x410B /* tx none, rx ultra_string */
110#define TIPC_CMD_RESET_LINK_STATS 0x410C /* tx link_name, rx none */ 103#define TIPC_CMD_RESET_LINK_STATS 0x410C /* tx link_name, rx none */
111 104
112#if 0 105/*
113#define TIPC_CMD_CREATE_LINK 0x4103 /* tx link_create, rx none */
114#define TIPC_CMD_REMOVE_LINK 0x4104 /* tx link_name, rx none */
115#define TIPC_CMD_BLOCK_LINK 0x4105 /* tx link_name, rx none */
116#define TIPC_CMD_UNBLOCK_LINK 0x4106 /* tx link_name, rx none */
117#endif
118
119/*
120 * Private commands: 106 * Private commands:
121 * May only be issued by "network administration capable" process. 107 * May only be issued by "network administration capable" process.
122 * Accepted by own node only; cannot be used on a remote node. 108 * Accepted by own node only; cannot be used on a remote node.
123 */ 109 */
124 110
125#define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */ 111#define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */
126#if 0
127#define TIPC_CMD_SET_ZONE_MASTER 0x8002 /* tx none, rx none */
128#endif
129#define TIPC_CMD_SET_REMOTE_MNG 0x8003 /* tx unsigned, rx none */ 112#define TIPC_CMD_SET_REMOTE_MNG 0x8003 /* tx unsigned, rx none */
130#define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */ 113#define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */
131#define TIPC_CMD_SET_MAX_PUBL 0x8005 /* tx unsigned, rx none */ 114#define TIPC_CMD_SET_MAX_PUBL 0x8005 /* tx unsigned, rx none */
132#define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* tx unsigned, rx none */ 115#define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* tx unsigned, rx none */
133#define TIPC_CMD_SET_MAX_ZONES 0x8007 /* tx unsigned, rx none */ 116#define TIPC_CMD_SET_MAX_ZONES 0x8007 /* obsoleted */
134#define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* tx unsigned, rx none */ 117#define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* obsoleted */
135#define TIPC_CMD_SET_MAX_NODES 0x8009 /* tx unsigned, rx none */ 118#define TIPC_CMD_SET_MAX_NODES 0x8009 /* obsoleted */
136#define TIPC_CMD_SET_MAX_SLAVES 0x800A /* tx unsigned, rx none */ 119#define TIPC_CMD_SET_MAX_SLAVES 0x800A /* obsoleted */
137#define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */ 120#define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */
138 121
139/* 122/*
@@ -156,20 +139,20 @@
156#define TIPC_TLV_ULTRA_STRING 5 /* char[32768] (max) */ 139#define TIPC_TLV_ULTRA_STRING 5 /* char[32768] (max) */
157 140
158#define TIPC_TLV_ERROR_STRING 16 /* char[128] containing "error code" */ 141#define TIPC_TLV_ERROR_STRING 16 /* char[128] containing "error code" */
159#define TIPC_TLV_NET_ADDR 17 /* 32-bit integer denoting <Z.C.N> */ 142#define TIPC_TLV_NET_ADDR 17 /* 32-bit integer denoting <Z.C.N> */
160#define TIPC_TLV_MEDIA_NAME 18 /* char[TIPC_MAX_MEDIA_NAME] */ 143#define TIPC_TLV_MEDIA_NAME 18 /* char[TIPC_MAX_MEDIA_NAME] */
161#define TIPC_TLV_BEARER_NAME 19 /* char[TIPC_MAX_BEARER_NAME] */ 144#define TIPC_TLV_BEARER_NAME 19 /* char[TIPC_MAX_BEARER_NAME] */
162#define TIPC_TLV_LINK_NAME 20 /* char[TIPC_MAX_LINK_NAME] */ 145#define TIPC_TLV_LINK_NAME 20 /* char[TIPC_MAX_LINK_NAME] */
163#define TIPC_TLV_NODE_INFO 21 /* struct tipc_node_info */ 146#define TIPC_TLV_NODE_INFO 21 /* struct tipc_node_info */
164#define TIPC_TLV_LINK_INFO 22 /* struct tipc_link_info */ 147#define TIPC_TLV_LINK_INFO 22 /* struct tipc_link_info */
165#define TIPC_TLV_BEARER_CONFIG 23 /* struct tipc_bearer_config */ 148#define TIPC_TLV_BEARER_CONFIG 23 /* struct tipc_bearer_config */
166#define TIPC_TLV_LINK_CONFIG 24 /* struct tipc_link_config */ 149#define TIPC_TLV_LINK_CONFIG 24 /* struct tipc_link_config */
167#define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */ 150#define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */
168#define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */ 151#define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */
169 152
170/* 153/*
171 * Maximum sizes of TIPC bearer-related names (including terminating NUL) 154 * Maximum sizes of TIPC bearer-related names (including terminating NUL)
172 */ 155 */
173 156
174#define TIPC_MAX_MEDIA_NAME 16 /* format = media */ 157#define TIPC_MAX_MEDIA_NAME 16 /* format = media */
175#define TIPC_MAX_IF_NAME 16 /* format = interface */ 158#define TIPC_MAX_IF_NAME 16 /* format = interface */
@@ -193,6 +176,10 @@
193#define TIPC_DEF_LINK_TOL 1500 176#define TIPC_DEF_LINK_TOL 1500
194#define TIPC_MAX_LINK_TOL 30000 177#define TIPC_MAX_LINK_TOL 30000
195 178
179#if (TIPC_MIN_LINK_TOL < 16)
180#error "TIPC_MIN_LINK_TOL is too small (abort limit may be NaN)"
181#endif
182
196/* 183/*
197 * Link window limits (min, default, max), in packets 184 * Link window limits (min, default, max), in packets
198 */ 185 */
@@ -215,7 +202,7 @@ struct tipc_link_info {
215 202
216struct tipc_bearer_config { 203struct tipc_bearer_config {
217 __be32 priority; /* Range [1,31]. Override per link */ 204 __be32 priority; /* Range [1,31]. Override per link */
218 __be32 detect_scope; 205 __be32 disc_domain; /* <Z.C.N> describing desired nodes */
219 char name[TIPC_MAX_BEARER_NAME]; 206 char name[TIPC_MAX_BEARER_NAME];
220}; 207};
221 208
@@ -234,7 +221,7 @@ struct tipc_name_table_query {
234}; 221};
235 222
236/* 223/*
237 * The error string TLV is a null-terminated string describing the cause 224 * The error string TLV is a null-terminated string describing the cause
238 * of the request failure. To simplify error processing (and to save space) 225 * of the request failure. To simplify error processing (and to save space)
239 * the first character of the string can be a special error code character 226 * the first character of the string can be a special error code character
240 * (lying by the range 0x80 to 0xFF) which represents a pre-defined reason. 227 * (lying by the range 0x80 to 0xFF) which represents a pre-defined reason.
@@ -247,23 +234,9 @@ struct tipc_name_table_query {
247#define TIPC_CFG_NOT_SUPPORTED "\x84" /* request is not supported by TIPC */ 234#define TIPC_CFG_NOT_SUPPORTED "\x84" /* request is not supported by TIPC */
248#define TIPC_CFG_INVALID_VALUE "\x85" /* request has invalid argument value */ 235#define TIPC_CFG_INVALID_VALUE "\x85" /* request has invalid argument value */
249 236
250#if 0
251/* prototypes TLV structures for proposed commands */
252struct tipc_link_create {
253 __u32 domain;
254 struct tipc_media_addr peer_addr;
255 char bearer_name[TIPC_MAX_BEARER_NAME];
256};
257
258struct tipc_route_info {
259 __u32 dest;
260 __u32 router;
261};
262#endif
263
264/* 237/*
265 * A TLV consists of a descriptor, followed by the TLV value. 238 * A TLV consists of a descriptor, followed by the TLV value.
266 * TLV descriptor fields are stored in network byte order; 239 * TLV descriptor fields are stored in network byte order;
267 * TLV values must also be stored in network byte order (where applicable). 240 * TLV values must also be stored in network byte order (where applicable).
268 * TLV descriptors must be aligned to addresses which are multiple of 4, 241 * TLV descriptors must be aligned to addresses which are multiple of 4,
269 * so up to 3 bytes of padding may exist at the end of the TLV value area. 242 * so up to 3 bytes of padding may exist at the end of the TLV value area.
@@ -299,7 +272,7 @@ static inline int TLV_OK(const void *tlv, __u16 space)
299 272
300static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type) 273static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type)
301{ 274{
302 return TLV_OK(tlv, space) && 275 return TLV_OK(tlv, space) &&
303 (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type); 276 (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type);
304} 277}
305 278
@@ -318,7 +291,7 @@ static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
318} 291}
319 292
320/* 293/*
321 * A TLV list descriptor simplifies processing of messages 294 * A TLV list descriptor simplifies processing of messages
322 * containing multiple TLVs. 295 * containing multiple TLVs.
323 */ 296 */
324 297
@@ -327,15 +300,15 @@ struct tlv_list_desc {
327 __u32 tlv_space; /* # bytes from curr TLV to list end */ 300 __u32 tlv_space; /* # bytes from curr TLV to list end */
328}; 301};
329 302
330static inline void TLV_LIST_INIT(struct tlv_list_desc *list, 303static inline void TLV_LIST_INIT(struct tlv_list_desc *list,
331 void *data, __u32 space) 304 void *data, __u32 space)
332{ 305{
333 list->tlv_ptr = (struct tlv_desc *)data; 306 list->tlv_ptr = (struct tlv_desc *)data;
334 list->tlv_space = space; 307 list->tlv_space = space;
335} 308}
336 309
337static inline int TLV_LIST_EMPTY(struct tlv_list_desc *list) 310static inline int TLV_LIST_EMPTY(struct tlv_list_desc *list)
338{ 311{
339 return (list->tlv_space == 0); 312 return (list->tlv_space == 0);
340} 313}
341 314
@@ -353,7 +326,7 @@ static inline void TLV_LIST_STEP(struct tlv_list_desc *list)
353{ 326{
354 __u16 tlv_space = TLV_ALIGN(ntohs(list->tlv_ptr->tlv_len)); 327 __u16 tlv_space = TLV_ALIGN(ntohs(list->tlv_ptr->tlv_len));
355 328
356 list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space); 329 list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space);
357 list->tlv_space -= tlv_space; 330 list->tlv_space -= tlv_space;
358} 331}
359 332
@@ -377,15 +350,14 @@ struct tipc_genlmsghdr {
377#define TIPC_GENL_HDRLEN NLMSG_ALIGN(sizeof(struct tipc_genlmsghdr)) 350#define TIPC_GENL_HDRLEN NLMSG_ALIGN(sizeof(struct tipc_genlmsghdr))
378 351
379/* 352/*
380 * Configuration messages exchanged via TIPC sockets use the TIPC configuration 353 * Configuration messages exchanged via TIPC sockets use the TIPC configuration
381 * message header, which is defined below. This structure is analogous 354 * message header, which is defined below. This structure is analogous
382 * to the Netlink message header, but fields are stored in network byte order 355 * to the Netlink message header, but fields are stored in network byte order
383 * and no padding is permitted between the header and the message data 356 * and no padding is permitted between the header and the message data
384 * that follows. 357 * that follows.
385 */ 358 */
386 359
387struct tipc_cfg_msg_hdr 360struct tipc_cfg_msg_hdr {
388{
389 __be32 tcm_len; /* Message length (including header) */ 361 __be32 tcm_len; /* Message length (including header) */
390 __be16 tcm_type; /* Command type */ 362 __be16 tcm_type; /* Command type */
391 __be16 tcm_flags; /* Additional flags */ 363 __be16 tcm_flags; /* Additional flags */