aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/config.c
diff options
context:
space:
mode:
authorPer Liden <per.liden@ericsson.com>2006-01-17 18:38:21 -0500
committerPer Liden <per.liden@ericsson.com>2006-01-17 18:45:16 -0500
commit4323add67792ced172d0d93b8b2e6187023115f1 (patch)
tree13224010f6f18029fb710a1e0b48392aea90b486 /net/tipc/config.c
parent1e63e681e06d438fdc542d40924a4f155d461bbd (diff)
[TIPC] Avoid polluting the global namespace
This patch adds a tipc_ prefix to all externally visible symbols. Signed-off-by: Per Liden <per.liden@ericsson.com>
Diffstat (limited to 'net/tipc/config.c')
-rw-r--r--net/tipc/config.c218
1 files changed, 109 insertions, 109 deletions
diff --git a/net/tipc/config.c b/net/tipc/config.c
index 8ddef4fce2c2..3c8e6740e5ae 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -70,13 +70,13 @@ static int req_tlv_space; /* request message TLV area size */
70static int rep_headroom; /* reply message headroom to use */ 70static int rep_headroom; /* reply message headroom to use */
71 71
72 72
73void cfg_link_event(u32 addr, char *name, int up) 73void tipc_cfg_link_event(u32 addr, char *name, int up)
74{ 74{
75 /* TIPC DOESN'T HANDLE LINK EVENT SUBSCRIPTIONS AT THE MOMENT */ 75 /* TIPC DOESN'T HANDLE LINK EVENT SUBSCRIPTIONS AT THE MOMENT */
76} 76}
77 77
78 78
79struct sk_buff *cfg_reply_alloc(int payload_size) 79struct sk_buff *tipc_cfg_reply_alloc(int payload_size)
80{ 80{
81 struct sk_buff *buf; 81 struct sk_buff *buf;
82 82
@@ -86,14 +86,14 @@ struct sk_buff *cfg_reply_alloc(int payload_size)
86 return buf; 86 return buf;
87} 87}
88 88
89int cfg_append_tlv(struct sk_buff *buf, int tlv_type, 89int tipc_cfg_append_tlv(struct sk_buff *buf, int tlv_type,
90 void *tlv_data, int tlv_data_size) 90 void *tlv_data, int tlv_data_size)
91{ 91{
92 struct tlv_desc *tlv = (struct tlv_desc *)buf->tail; 92 struct tlv_desc *tlv = (struct tlv_desc *)buf->tail;
93 int new_tlv_space = TLV_SPACE(tlv_data_size); 93 int new_tlv_space = TLV_SPACE(tlv_data_size);
94 94
95 if (skb_tailroom(buf) < new_tlv_space) { 95 if (skb_tailroom(buf) < new_tlv_space) {
96 dbg("cfg_append_tlv unable to append TLV\n"); 96 dbg("tipc_cfg_append_tlv unable to append TLV\n");
97 return 0; 97 return 0;
98 } 98 }
99 skb_put(buf, new_tlv_space); 99 skb_put(buf, new_tlv_space);
@@ -104,28 +104,28 @@ int cfg_append_tlv(struct sk_buff *buf, int tlv_type,
104 return 1; 104 return 1;
105} 105}
106 106
107struct sk_buff *cfg_reply_unsigned_type(u16 tlv_type, u32 value) 107struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value)
108{ 108{
109 struct sk_buff *buf; 109 struct sk_buff *buf;
110 u32 value_net; 110 u32 value_net;
111 111
112 buf = cfg_reply_alloc(TLV_SPACE(sizeof(value))); 112 buf = tipc_cfg_reply_alloc(TLV_SPACE(sizeof(value)));
113 if (buf) { 113 if (buf) {
114 value_net = htonl(value); 114 value_net = htonl(value);
115 cfg_append_tlv(buf, tlv_type, &value_net, 115 tipc_cfg_append_tlv(buf, tlv_type, &value_net,
116 sizeof(value_net)); 116 sizeof(value_net));
117 } 117 }
118 return buf; 118 return buf;
119} 119}
120 120
121struct sk_buff *cfg_reply_string_type(u16 tlv_type, char *string) 121struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string)
122{ 122{
123 struct sk_buff *buf; 123 struct sk_buff *buf;
124 int string_len = strlen(string) + 1; 124 int string_len = strlen(string) + 1;
125 125
126 buf = cfg_reply_alloc(TLV_SPACE(string_len)); 126 buf = tipc_cfg_reply_alloc(TLV_SPACE(string_len));
127 if (buf) 127 if (buf)
128 cfg_append_tlv(buf, tlv_type, string, string_len); 128 tipc_cfg_append_tlv(buf, tlv_type, string, string_len);
129 return buf; 129 return buf;
130} 130}
131 131
@@ -246,7 +246,7 @@ static void cfg_cmd_event(struct tipc_cmd_msg *msg,
246 exit: 246 exit:
247 rmsg.result_len = htonl(msg_sect[1].iov_len); 247 rmsg.result_len = htonl(msg_sect[1].iov_len);
248 rmsg.retval = htonl(rv); 248 rmsg.retval = htonl(rv);
249 cfg_respond(msg_sect, 2u, orig); 249 tipc_cfg_respond(msg_sect, 2u, orig);
250} 250}
251#endif 251#endif
252 252
@@ -255,26 +255,26 @@ static struct sk_buff *cfg_enable_bearer(void)
255 struct tipc_bearer_config *args; 255 struct tipc_bearer_config *args;
256 256
257 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_BEARER_CONFIG)) 257 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_BEARER_CONFIG))
258 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 258 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
259 259
260 args = (struct tipc_bearer_config *)TLV_DATA(req_tlv_area); 260 args = (struct tipc_bearer_config *)TLV_DATA(req_tlv_area);
261 if (tipc_enable_bearer(args->name, 261 if (tipc_enable_bearer(args->name,
262 ntohl(args->detect_scope), 262 ntohl(args->detect_scope),
263 ntohl(args->priority))) 263 ntohl(args->priority)))
264 return cfg_reply_error_string("unable to enable bearer"); 264 return tipc_cfg_reply_error_string("unable to enable bearer");
265 265
266 return cfg_reply_none(); 266 return tipc_cfg_reply_none();
267} 267}
268 268
269static struct sk_buff *cfg_disable_bearer(void) 269static struct sk_buff *cfg_disable_bearer(void)
270{ 270{
271 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_BEARER_NAME)) 271 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_BEARER_NAME))
272 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 272 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
273 273
274 if (tipc_disable_bearer((char *)TLV_DATA(req_tlv_area))) 274 if (tipc_disable_bearer((char *)TLV_DATA(req_tlv_area)))
275 return cfg_reply_error_string("unable to disable bearer"); 275 return tipc_cfg_reply_error_string("unable to disable bearer");
276 276
277 return cfg_reply_none(); 277 return tipc_cfg_reply_none();
278} 278}
279 279
280static struct sk_buff *cfg_set_own_addr(void) 280static struct sk_buff *cfg_set_own_addr(void)
@@ -282,25 +282,25 @@ static struct sk_buff *cfg_set_own_addr(void)
282 u32 addr; 282 u32 addr;
283 283
284 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR)) 284 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR))
285 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 285 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
286 286
287 addr = *(u32 *)TLV_DATA(req_tlv_area); 287 addr = *(u32 *)TLV_DATA(req_tlv_area);
288 addr = ntohl(addr); 288 addr = ntohl(addr);
289 if (addr == tipc_own_addr) 289 if (addr == tipc_own_addr)
290 return cfg_reply_none(); 290 return tipc_cfg_reply_none();
291 if (!addr_node_valid(addr)) 291 if (!tipc_addr_node_valid(addr))
292 return cfg_reply_error_string(TIPC_CFG_INVALID_VALUE 292 return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
293 " (node address)"); 293 " (node address)");
294 if (tipc_own_addr) 294 if (tipc_own_addr)
295 return cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED 295 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
296 " (cannot change node address once assigned)"); 296 " (cannot change node address once assigned)");
297 297
298 spin_unlock_bh(&config_lock); 298 spin_unlock_bh(&config_lock);
299 stop_net(); 299 tipc_core_stop_net();
300 tipc_own_addr = addr; 300 tipc_own_addr = addr;
301 start_net(); 301 tipc_core_start_net();
302 spin_lock_bh(&config_lock); 302 spin_lock_bh(&config_lock);
303 return cfg_reply_none(); 303 return tipc_cfg_reply_none();
304} 304}
305 305
306static struct sk_buff *cfg_set_remote_mng(void) 306static struct sk_buff *cfg_set_remote_mng(void)
@@ -308,12 +308,12 @@ static struct sk_buff *cfg_set_remote_mng(void)
308 u32 value; 308 u32 value;
309 309
310 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) 310 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
311 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 311 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
312 312
313 value = *(u32 *)TLV_DATA(req_tlv_area); 313 value = *(u32 *)TLV_DATA(req_tlv_area);
314 value = ntohl(value); 314 value = ntohl(value);
315 tipc_remote_management = (value != 0); 315 tipc_remote_management = (value != 0);
316 return cfg_reply_none(); 316 return tipc_cfg_reply_none();
317} 317}
318 318
319static struct sk_buff *cfg_set_max_publications(void) 319static struct sk_buff *cfg_set_max_publications(void)
@@ -321,15 +321,15 @@ static struct sk_buff *cfg_set_max_publications(void)
321 u32 value; 321 u32 value;
322 322
323 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) 323 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
324 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 324 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
325 325
326 value = *(u32 *)TLV_DATA(req_tlv_area); 326 value = *(u32 *)TLV_DATA(req_tlv_area);
327 value = ntohl(value); 327 value = ntohl(value);
328 if (value != delimit(value, 1, 65535)) 328 if (value != delimit(value, 1, 65535))
329 return cfg_reply_error_string(TIPC_CFG_INVALID_VALUE 329 return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
330 " (max publications must be 1-65535)"); 330 " (max publications must be 1-65535)");
331 tipc_max_publications = value; 331 tipc_max_publications = value;
332 return cfg_reply_none(); 332 return tipc_cfg_reply_none();
333} 333}
334 334
335static struct sk_buff *cfg_set_max_subscriptions(void) 335static struct sk_buff *cfg_set_max_subscriptions(void)
@@ -337,15 +337,15 @@ static struct sk_buff *cfg_set_max_subscriptions(void)
337 u32 value; 337 u32 value;
338 338
339 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) 339 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
340 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 340 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
341 341
342 value = *(u32 *)TLV_DATA(req_tlv_area); 342 value = *(u32 *)TLV_DATA(req_tlv_area);
343 value = ntohl(value); 343 value = ntohl(value);
344 if (value != delimit(value, 1, 65535)) 344 if (value != delimit(value, 1, 65535))
345 return cfg_reply_error_string(TIPC_CFG_INVALID_VALUE 345 return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
346 " (max subscriptions must be 1-65535"); 346 " (max subscriptions must be 1-65535");
347 tipc_max_subscriptions = value; 347 tipc_max_subscriptions = value;
348 return cfg_reply_none(); 348 return tipc_cfg_reply_none();
349} 349}
350 350
351static struct sk_buff *cfg_set_max_ports(void) 351static struct sk_buff *cfg_set_max_ports(void)
@@ -354,31 +354,31 @@ static struct sk_buff *cfg_set_max_ports(void)
354 u32 value; 354 u32 value;
355 355
356 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) 356 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
357 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 357 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
358 value = *(u32 *)TLV_DATA(req_tlv_area); 358 value = *(u32 *)TLV_DATA(req_tlv_area);
359 value = ntohl(value); 359 value = ntohl(value);
360 if (value != delimit(value, 127, 65535)) 360 if (value != delimit(value, 127, 65535))
361 return cfg_reply_error_string(TIPC_CFG_INVALID_VALUE 361 return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
362 " (max ports must be 127-65535)"); 362 " (max ports must be 127-65535)");
363 363
364 if (value == tipc_max_ports) 364 if (value == tipc_max_ports)
365 return cfg_reply_none(); 365 return tipc_cfg_reply_none();
366 366
367 if (atomic_read(&tipc_user_count) > 2) 367 if (atomic_read(&tipc_user_count) > 2)
368 return cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED 368 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
369 " (cannot change max ports while TIPC users exist)"); 369 " (cannot change max ports while TIPC users exist)");
370 370
371 spin_unlock_bh(&config_lock); 371 spin_unlock_bh(&config_lock);
372 orig_mode = tipc_get_mode(); 372 orig_mode = tipc_get_mode();
373 if (orig_mode == TIPC_NET_MODE) 373 if (orig_mode == TIPC_NET_MODE)
374 stop_net(); 374 tipc_core_stop_net();
375 stop_core(); 375 tipc_core_stop();
376 tipc_max_ports = value; 376 tipc_max_ports = value;
377 start_core(); 377 tipc_core_start();
378 if (orig_mode == TIPC_NET_MODE) 378 if (orig_mode == TIPC_NET_MODE)
379 start_net(); 379 tipc_core_start_net();
380 spin_lock_bh(&config_lock); 380 spin_lock_bh(&config_lock);
381 return cfg_reply_none(); 381 return tipc_cfg_reply_none();
382} 382}
383 383
384static struct sk_buff *set_net_max(int value, int *parameter) 384static struct sk_buff *set_net_max(int value, int *parameter)
@@ -388,13 +388,13 @@ static struct sk_buff *set_net_max(int value, int *parameter)
388 if (value != *parameter) { 388 if (value != *parameter) {
389 orig_mode = tipc_get_mode(); 389 orig_mode = tipc_get_mode();
390 if (orig_mode == TIPC_NET_MODE) 390 if (orig_mode == TIPC_NET_MODE)
391 stop_net(); 391 tipc_core_stop_net();
392 *parameter = value; 392 *parameter = value;
393 if (orig_mode == TIPC_NET_MODE) 393 if (orig_mode == TIPC_NET_MODE)
394 start_net(); 394 tipc_core_start_net();
395 } 395 }
396 396
397 return cfg_reply_none(); 397 return tipc_cfg_reply_none();
398} 398}
399 399
400static struct sk_buff *cfg_set_max_zones(void) 400static struct sk_buff *cfg_set_max_zones(void)
@@ -402,12 +402,12 @@ static struct sk_buff *cfg_set_max_zones(void)
402 u32 value; 402 u32 value;
403 403
404 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) 404 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
405 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 405 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
406 value = *(u32 *)TLV_DATA(req_tlv_area); 406 value = *(u32 *)TLV_DATA(req_tlv_area);
407 value = ntohl(value); 407 value = ntohl(value);
408 if (value != delimit(value, 1, 255)) 408 if (value != delimit(value, 1, 255))
409 return cfg_reply_error_string(TIPC_CFG_INVALID_VALUE 409 return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
410 " (max zones must be 1-255)"); 410 " (max zones must be 1-255)");
411 return set_net_max(value, &tipc_max_zones); 411 return set_net_max(value, &tipc_max_zones);
412} 412}
413 413
@@ -416,13 +416,13 @@ static struct sk_buff *cfg_set_max_clusters(void)
416 u32 value; 416 u32 value;
417 417
418 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) 418 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
419 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 419 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
420 value = *(u32 *)TLV_DATA(req_tlv_area); 420 value = *(u32 *)TLV_DATA(req_tlv_area);
421 value = ntohl(value); 421 value = ntohl(value);
422 if (value != 1) 422 if (value != 1)
423 return cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED 423 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
424 " (max clusters fixed at 1)"); 424 " (max clusters fixed at 1)");
425 return cfg_reply_none(); 425 return tipc_cfg_reply_none();
426} 426}
427 427
428static struct sk_buff *cfg_set_max_nodes(void) 428static struct sk_buff *cfg_set_max_nodes(void)
@@ -430,12 +430,12 @@ static struct sk_buff *cfg_set_max_nodes(void)
430 u32 value; 430 u32 value;
431 431
432 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) 432 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
433 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 433 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
434 value = *(u32 *)TLV_DATA(req_tlv_area); 434 value = *(u32 *)TLV_DATA(req_tlv_area);
435 value = ntohl(value); 435 value = ntohl(value);
436 if (value != delimit(value, 8, 2047)) 436 if (value != delimit(value, 8, 2047))
437 return cfg_reply_error_string(TIPC_CFG_INVALID_VALUE 437 return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
438 " (max nodes must be 8-2047)"); 438 " (max nodes must be 8-2047)");
439 return set_net_max(value, &tipc_max_nodes); 439 return set_net_max(value, &tipc_max_nodes);
440} 440}
441 441
@@ -444,13 +444,13 @@ static struct sk_buff *cfg_set_max_slaves(void)
444 u32 value; 444 u32 value;
445 445
446 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) 446 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
447 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 447 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
448 value = *(u32 *)TLV_DATA(req_tlv_area); 448 value = *(u32 *)TLV_DATA(req_tlv_area);
449 value = ntohl(value); 449 value = ntohl(value);
450 if (value != 0) 450 if (value != 0)
451 return cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED 451 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
452 " (max secondary nodes fixed at 0)"); 452 " (max secondary nodes fixed at 0)");
453 return cfg_reply_none(); 453 return tipc_cfg_reply_none();
454} 454}
455 455
456static struct sk_buff *cfg_set_netid(void) 456static struct sk_buff *cfg_set_netid(void)
@@ -458,22 +458,22 @@ static struct sk_buff *cfg_set_netid(void)
458 u32 value; 458 u32 value;
459 459
460 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) 460 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
461 return cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 461 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
462 value = *(u32 *)TLV_DATA(req_tlv_area); 462 value = *(u32 *)TLV_DATA(req_tlv_area);
463 value = ntohl(value); 463 value = ntohl(value);
464 if (value != delimit(value, 1, 9999)) 464 if (value != delimit(value, 1, 9999))
465 return cfg_reply_error_string(TIPC_CFG_INVALID_VALUE 465 return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
466 " (network id must be 1-9999)"); 466 " (network id must be 1-9999)");
467 467
468 if (tipc_own_addr) 468 if (tipc_own_addr)
469 return cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED 469 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
470 " (cannot change network id once part of network)"); 470 " (cannot change network id once part of network)");
471 471
472 return set_net_max(value, &tipc_net_id); 472 return set_net_max(value, &tipc_net_id);
473} 473}
474 474
475struct sk_buff *cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area, 475struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area,
476 int request_space, int reply_headroom) 476 int request_space, int reply_headroom)
477{ 477{
478 struct sk_buff *rep_tlv_buf; 478 struct sk_buff *rep_tlv_buf;
479 479
@@ -490,19 +490,19 @@ struct sk_buff *cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area,
490 if (likely(orig_node == tipc_own_addr)) { 490 if (likely(orig_node == tipc_own_addr)) {
491 /* command is permitted */ 491 /* command is permitted */
492 } else if (cmd >= 0x8000) { 492 } else if (cmd >= 0x8000) {
493 rep_tlv_buf = cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED 493 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
494 " (cannot be done remotely)"); 494 " (cannot be done remotely)");
495 goto exit; 495 goto exit;
496 } else if (!tipc_remote_management) { 496 } else if (!tipc_remote_management) {
497 rep_tlv_buf = cfg_reply_error_string(TIPC_CFG_NO_REMOTE); 497 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NO_REMOTE);
498 goto exit; 498 goto exit;
499 } 499 }
500 else if (cmd >= 0x4000) { 500 else if (cmd >= 0x4000) {
501 u32 domain = 0; 501 u32 domain = 0;
502 502
503 if ((nametbl_translate(TIPC_ZM_SRV, 0, &domain) == 0) || 503 if ((tipc_nametbl_translate(TIPC_ZM_SRV, 0, &domain) == 0) ||
504 (domain != orig_node)) { 504 (domain != orig_node)) {
505 rep_tlv_buf = cfg_reply_error_string(TIPC_CFG_NOT_ZONE_MSTR); 505 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_ZONE_MSTR);
506 goto exit; 506 goto exit;
507 } 507 }
508 } 508 }
@@ -511,50 +511,50 @@ struct sk_buff *cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area,
511 511
512 switch (cmd) { 512 switch (cmd) {
513 case TIPC_CMD_NOOP: 513 case TIPC_CMD_NOOP:
514 rep_tlv_buf = cfg_reply_none(); 514 rep_tlv_buf = tipc_cfg_reply_none();
515 break; 515 break;
516 case TIPC_CMD_GET_NODES: 516 case TIPC_CMD_GET_NODES:
517 rep_tlv_buf = node_get_nodes(req_tlv_area, req_tlv_space); 517 rep_tlv_buf = tipc_node_get_nodes(req_tlv_area, req_tlv_space);
518 break; 518 break;
519 case TIPC_CMD_GET_LINKS: 519 case TIPC_CMD_GET_LINKS:
520 rep_tlv_buf = node_get_links(req_tlv_area, req_tlv_space); 520 rep_tlv_buf = tipc_node_get_links(req_tlv_area, req_tlv_space);
521 break; 521 break;
522 case TIPC_CMD_SHOW_LINK_STATS: 522 case TIPC_CMD_SHOW_LINK_STATS:
523 rep_tlv_buf = link_cmd_show_stats(req_tlv_area, req_tlv_space); 523 rep_tlv_buf = tipc_link_cmd_show_stats(req_tlv_area, req_tlv_space);
524 break; 524 break;
525 case TIPC_CMD_RESET_LINK_STATS: 525 case TIPC_CMD_RESET_LINK_STATS:
526 rep_tlv_buf = link_cmd_reset_stats(req_tlv_area, req_tlv_space); 526 rep_tlv_buf = tipc_link_cmd_reset_stats(req_tlv_area, req_tlv_space);
527 break; 527 break;
528 case TIPC_CMD_SHOW_NAME_TABLE: 528 case TIPC_CMD_SHOW_NAME_TABLE:
529 rep_tlv_buf = nametbl_get(req_tlv_area, req_tlv_space); 529 rep_tlv_buf = tipc_nametbl_get(req_tlv_area, req_tlv_space);
530 break; 530 break;
531 case TIPC_CMD_GET_BEARER_NAMES: 531 case TIPC_CMD_GET_BEARER_NAMES:
532 rep_tlv_buf = bearer_get_names(); 532 rep_tlv_buf = tipc_bearer_get_names();
533 break; 533 break;
534 case TIPC_CMD_GET_MEDIA_NAMES: 534 case TIPC_CMD_GET_MEDIA_NAMES:
535 rep_tlv_buf = media_get_names(); 535 rep_tlv_buf = tipc_media_get_names();
536 break; 536 break;
537 case TIPC_CMD_SHOW_PORTS: 537 case TIPC_CMD_SHOW_PORTS:
538 rep_tlv_buf = port_get_ports(); 538 rep_tlv_buf = tipc_port_get_ports();
539 break; 539 break;
540#if 0 540#if 0
541 case TIPC_CMD_SHOW_PORT_STATS: 541 case TIPC_CMD_SHOW_PORT_STATS:
542 rep_tlv_buf = port_show_stats(req_tlv_area, req_tlv_space); 542 rep_tlv_buf = port_show_stats(req_tlv_area, req_tlv_space);
543 break; 543 break;
544 case TIPC_CMD_RESET_PORT_STATS: 544 case TIPC_CMD_RESET_PORT_STATS:
545 rep_tlv_buf = cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED); 545 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED);
546 break; 546 break;
547#endif 547#endif
548 case TIPC_CMD_SET_LOG_SIZE: 548 case TIPC_CMD_SET_LOG_SIZE:
549 rep_tlv_buf = log_resize(req_tlv_area, req_tlv_space); 549 rep_tlv_buf = tipc_log_resize(req_tlv_area, req_tlv_space);
550 break; 550 break;
551 case TIPC_CMD_DUMP_LOG: 551 case TIPC_CMD_DUMP_LOG:
552 rep_tlv_buf = log_dump(); 552 rep_tlv_buf = tipc_log_dump();
553 break; 553 break;
554 case TIPC_CMD_SET_LINK_TOL: 554 case TIPC_CMD_SET_LINK_TOL:
555 case TIPC_CMD_SET_LINK_PRI: 555 case TIPC_CMD_SET_LINK_PRI:
556 case TIPC_CMD_SET_LINK_WINDOW: 556 case TIPC_CMD_SET_LINK_WINDOW:
557 rep_tlv_buf = link_cmd_config(req_tlv_area, req_tlv_space, cmd); 557 rep_tlv_buf = tipc_link_cmd_config(req_tlv_area, req_tlv_space, cmd);
558 break; 558 break;
559 case TIPC_CMD_ENABLE_BEARER: 559 case TIPC_CMD_ENABLE_BEARER:
560 rep_tlv_buf = cfg_enable_bearer(); 560 rep_tlv_buf = cfg_enable_bearer();
@@ -593,31 +593,31 @@ struct sk_buff *cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area,
593 rep_tlv_buf = cfg_set_netid(); 593 rep_tlv_buf = cfg_set_netid();
594 break; 594 break;
595 case TIPC_CMD_GET_REMOTE_MNG: 595 case TIPC_CMD_GET_REMOTE_MNG:
596 rep_tlv_buf = cfg_reply_unsigned(tipc_remote_management); 596 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_remote_management);
597 break; 597 break;
598 case TIPC_CMD_GET_MAX_PORTS: 598 case TIPC_CMD_GET_MAX_PORTS:
599 rep_tlv_buf = cfg_reply_unsigned(tipc_max_ports); 599 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_ports);
600 break; 600 break;
601 case TIPC_CMD_GET_MAX_PUBL: 601 case TIPC_CMD_GET_MAX_PUBL:
602 rep_tlv_buf = cfg_reply_unsigned(tipc_max_publications); 602 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_publications);
603 break; 603 break;
604 case TIPC_CMD_GET_MAX_SUBSCR: 604 case TIPC_CMD_GET_MAX_SUBSCR:
605 rep_tlv_buf = cfg_reply_unsigned(tipc_max_subscriptions); 605 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_subscriptions);
606 break; 606 break;
607 case TIPC_CMD_GET_MAX_ZONES: 607 case TIPC_CMD_GET_MAX_ZONES:
608 rep_tlv_buf = cfg_reply_unsigned(tipc_max_zones); 608 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_zones);
609 break; 609 break;
610 case TIPC_CMD_GET_MAX_CLUSTERS: 610 case TIPC_CMD_GET_MAX_CLUSTERS:
611 rep_tlv_buf = cfg_reply_unsigned(tipc_max_clusters); 611 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_clusters);
612 break; 612 break;
613 case TIPC_CMD_GET_MAX_NODES: 613 case TIPC_CMD_GET_MAX_NODES:
614 rep_tlv_buf = cfg_reply_unsigned(tipc_max_nodes); 614 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_nodes);
615 break; 615 break;
616 case TIPC_CMD_GET_MAX_SLAVES: 616 case TIPC_CMD_GET_MAX_SLAVES:
617 rep_tlv_buf = cfg_reply_unsigned(tipc_max_slaves); 617 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_slaves);
618 break; 618 break;
619 case TIPC_CMD_GET_NETID: 619 case TIPC_CMD_GET_NETID:
620 rep_tlv_buf = cfg_reply_unsigned(tipc_net_id); 620 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id);
621 break; 621 break;
622 default: 622 default:
623 rep_tlv_buf = NULL; 623 rep_tlv_buf = NULL;
@@ -655,11 +655,11 @@ static void cfg_named_msg_event(void *userdata,
655 655
656 /* Generate reply for request (if can't, return request) */ 656 /* Generate reply for request (if can't, return request) */
657 657
658 rep_buf = cfg_do_cmd(orig->node, 658 rep_buf = tipc_cfg_do_cmd(orig->node,
659 ntohs(req_hdr->tcm_type), 659 ntohs(req_hdr->tcm_type),
660 msg + sizeof(*req_hdr), 660 msg + sizeof(*req_hdr),
661 size - sizeof(*req_hdr), 661 size - sizeof(*req_hdr),
662 BUF_HEADROOM + MAX_H_SIZE + sizeof(*rep_hdr)); 662 BUF_HEADROOM + MAX_H_SIZE + sizeof(*rep_hdr));
663 if (rep_buf) { 663 if (rep_buf) {
664 skb_push(rep_buf, sizeof(*rep_hdr)); 664 skb_push(rep_buf, sizeof(*rep_hdr));
665 rep_hdr = (struct tipc_cfg_msg_hdr *)rep_buf->data; 665 rep_hdr = (struct tipc_cfg_msg_hdr *)rep_buf->data;
@@ -675,7 +675,7 @@ static void cfg_named_msg_event(void *userdata,
675 tipc_send_buf2port(port_ref, orig, rep_buf, rep_buf->len); 675 tipc_send_buf2port(port_ref, orig, rep_buf, rep_buf->len);
676} 676}
677 677
678int cfg_init(void) 678int tipc_cfg_init(void)
679{ 679{
680 struct tipc_name_seq seq; 680 struct tipc_name_seq seq;
681 int res; 681 int res;
@@ -696,7 +696,7 @@ int cfg_init(void)
696 696
697 seq.type = TIPC_CFG_SRV; 697 seq.type = TIPC_CFG_SRV;
698 seq.lower = seq.upper = tipc_own_addr; 698 seq.lower = seq.upper = tipc_own_addr;
699 res = nametbl_publish_rsv(mng.port_ref, TIPC_ZONE_SCOPE, &seq); 699 res = tipc_nametbl_publish_rsv(mng.port_ref, TIPC_ZONE_SCOPE, &seq);
700 if (res) 700 if (res)
701 goto failed; 701 goto failed;
702 702
@@ -709,7 +709,7 @@ failed:
709 return res; 709 return res;
710} 710}
711 711
712void cfg_stop(void) 712void tipc_cfg_stop(void)
713{ 713{
714 if (mng.user_ref) { 714 if (mng.user_ref) {
715 tipc_detach(mng.user_ref); 715 tipc_detach(mng.user_ref);