Changeset 75c3830 in mainline
- Timestamp:
- 2017-09-23T22:20:20Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 11d9630
- Parents:
- f538ef3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/inet/inet.c
rf538ef3 r75c3830 49 49 static void print_syntax(void) 50 50 { 51 printf("%s: Internet configuration utility.\n", NAME); 51 52 printf("Syntax:\n"); 52 printf(" %s create <addr>/<width> <link-name> <addr-name>\n", NAME); 53 printf(" %s delete <link-name> <addr-name>\n", NAME); 54 printf(" %s add-sr <dest-addr>/<width> <router-addr> <route-name>\n", NAME); 55 printf(" %s del-sr <route-name>\n", NAME); 53 printf(" %s list-addr\n", NAME); 54 printf(" %s create-addr <addr>/<width> <link-name> <addr-name>\n", NAME); 55 printf(" %s delete-addr <link-name> <addr-name>\n", NAME); 56 printf(" %s list-sr\n", NAME); 57 printf(" %s create-sr <dest-addr>/<width> <router-addr> <route-name>\n", NAME); 58 printf(" %s delete-sr <route-name>\n", NAME); 59 printf(" %s list-link\n", NAME); 56 60 } 57 61 … … 265 269 } 266 270 267 table_set_margin_left(table, 4);268 269 printf("Configured addresses:\n\n");270 271 271 table_header_row(table); 272 272 table_printf(table, "Addr/Width\t" "Link-Name\t" "Addr-Name\t" … … 309 309 } 310 310 311 if (count == 0) { 312 printf("None\n"); 313 } else { 311 if (count != 0) { 314 312 rc = table_print_out(table, stdout); 315 313 if (rc != EOK) { … … 318 316 } 319 317 } 320 321 printf("\n");322 318 323 319 rc = EOK; … … 358 354 } 359 355 360 table_set_margin_left(table, 4);361 362 printf("IP links:\n\n");363 356 table_header_row(table); 364 357 table_printf(table, "Link-layer Address\t" "Link-Name\t" "Def-MTU\n"); … … 384 377 } 385 378 386 if (count == 0) { 387 printf("None\n"); 388 } else { 379 if (count != 0) { 389 380 rc = table_print_out(table, stdout); 390 381 if (rc != EOK) { … … 393 384 } 394 385 } 395 396 printf("\n");397 386 398 387 rc = EOK; … … 430 419 } 431 420 432 table_set_margin_left(table, 4);433 434 printf("Static routes:\n\n");435 421 table_header_row(table); 436 422 table_printf(table, "Dest/Width\t" "Router-Addr\t" "Route-Name\n"); … … 471 457 } 472 458 473 if (count == 0) { 474 printf("None\n"); 475 } else { 459 if (count != 0) { 476 460 rc = table_print_out(table, stdout); 477 461 if (rc != EOK) { … … 480 464 } 481 465 } 482 483 printf("\n");484 466 485 467 rc = EOK; … … 509 491 } 510 492 511 if (argc < 2) { 493 if (argc < 2 || str_cmp(argv[1], "-h") == 0) { 494 print_syntax(); 495 return 0; 496 } 497 498 if (str_cmp(argv[1], "list-addr") == 0) { 512 499 rc = addr_list(); 513 500 if (rc != EOK) 514 501 return 1; 502 } else if (str_cmp(argv[1], "create-addr") == 0) { 503 rc = addr_create_static(argc - 2, argv + 2); 504 if (rc != EOK) 505 return 1; 506 } else if (str_cmp(argv[1], "delete-addr") == 0) { 507 rc = addr_delete(argc - 2, argv + 2); 508 if (rc != EOK) 509 return 1; 510 } else if (str_cmp(argv[1], "list-sr") == 0) { 515 511 rc = sroute_list(); 516 512 if (rc != EOK) 517 513 return 1; 514 } else if (str_cmp(argv[1], "create-sr") == 0) { 515 rc = sroute_create(argc - 2, argv + 2); 516 if (rc != EOK) 517 return 1; 518 } else if (str_cmp(argv[1], "delete-sr") == 0) { 519 rc = sroute_delete(argc - 2, argv + 2); 520 if (rc != EOK) 521 return 1; 522 } else if (str_cmp(argv[1], "list-link") == 0) { 518 523 rc = link_list(); 519 if (rc != EOK)520 return 1;521 return 0;522 }523 524 if (str_cmp(argv[1], "create") == 0) {525 rc = addr_create_static(argc - 2, argv + 2);526 if (rc != EOK)527 return 1;528 } else if (str_cmp(argv[1], "delete") == 0) {529 rc = addr_delete(argc - 2, argv + 2);530 if (rc != EOK)531 return 1;532 } else if (str_cmp(argv[1], "add-sr") == 0) {533 rc = sroute_create(argc - 2, argv + 2);534 if (rc != EOK)535 return 1;536 } else if (str_cmp(argv[1], "del-sr") == 0) {537 rc = sroute_delete(argc - 2, argv + 2);538 524 if (rc != EOK) 539 525 return 1;
Note:
See TracChangeset
for help on using the changeset viewer.