summaryrefslogtreecommitdiff
path: root/networking/libiproute
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-26 00:37:00 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-26 00:37:00 +0000
commitc6f188def8c5496dbd65c9be6ca3050286db7227 (patch)
treed8e1e56c728628c15f66cb88a6e54f368c806939 /networking/libiproute
parente63a0dee9e559110bcaec494ae5e7fc78c4141c7 (diff)
downloadbusybox-w32-c6f188def8c5496dbd65c9be6ca3050286db7227.tar.gz
busybox-w32-c6f188def8c5496dbd65c9be6ca3050286db7227.tar.bz2
busybox-w32-c6f188def8c5496dbd65c9be6ca3050286db7227.zip
silly size savings and capitalization fixes
Diffstat (limited to 'networking/libiproute')
-rw-r--r--networking/libiproute/ipaddress.c16
-rw-r--r--networking/libiproute/iproute.c30
-rw-r--r--networking/libiproute/iptunnel.c22
3 files changed, 34 insertions, 34 deletions
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index 262d3e356..35fd099fa 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -435,7 +435,7 @@ int ipaddr_list_or_flush(int argc, char **argv, int flush)
435 return -1; 435 return -1;
436 } 436 }
437 if (filter.family == AF_PACKET) { 437 if (filter.family == AF_PACKET) {
438 bb_error_msg("Cannot flush link addresses."); 438 bb_error_msg("cannot flush link addresses");
439 return -1; 439 return -1;
440 } 440 }
441 } 441 }
@@ -488,17 +488,17 @@ int ipaddr_list_or_flush(int argc, char **argv, int flush)
488 exit(1); 488 exit(1);
489 489
490 if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETLINK) < 0) { 490 if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETLINK) < 0) {
491 bb_perror_msg_and_die("Cannot send dump request"); 491 bb_perror_msg_and_die("cannot send dump request");
492 } 492 }
493 493
494 if (rtnl_dump_filter(&rth, store_nlmsg, &linfo, NULL, NULL) < 0) { 494 if (rtnl_dump_filter(&rth, store_nlmsg, &linfo, NULL, NULL) < 0) {
495 bb_error_msg_and_die("Dump terminated"); 495 bb_error_msg_and_die("dump terminated");
496 } 496 }
497 497
498 if (filter_dev) { 498 if (filter_dev) {
499 filter.ifindex = ll_name_to_index(filter_dev); 499 filter.ifindex = ll_name_to_index(filter_dev);
500 if (filter.ifindex <= 0) { 500 if (filter.ifindex <= 0) {
501 bb_error_msg("Device \"%s\" does not exist", filter_dev); 501 bb_error_msg("device \"%s\" does not exist", filter_dev);
502 return -1; 502 return -1;
503 } 503 }
504 } 504 }
@@ -532,11 +532,11 @@ int ipaddr_list_or_flush(int argc, char **argv, int flush)
532 532
533 if (filter.family != AF_PACKET) { 533 if (filter.family != AF_PACKET) {
534 if (rtnl_wilddump_request(&rth, filter.family, RTM_GETADDR) < 0) { 534 if (rtnl_wilddump_request(&rth, filter.family, RTM_GETADDR) < 0) {
535 bb_perror_msg_and_die("Cannot send dump request"); 535 bb_perror_msg_and_die("cannot send dump request");
536 } 536 }
537 537
538 if (rtnl_dump_filter(&rth, store_nlmsg, &ainfo, NULL, NULL) < 0) { 538 if (rtnl_dump_filter(&rth, store_nlmsg, &ainfo, NULL, NULL) < 0) {
539 bb_error_msg_and_die("Dump terminated"); 539 bb_error_msg_and_die("dump terminated");
540 } 540 }
541 } 541 }
542 542
@@ -763,7 +763,7 @@ static int ipaddr_modify(int cmd, int argc, char **argv)
763 inet_prefix brd; 763 inet_prefix brd;
764 int i; 764 int i;
765 if (req.ifa.ifa_family != AF_INET) { 765 if (req.ifa.ifa_family != AF_INET) {
766 bb_error_msg("Broadcast can be set only for IPv4 addresses"); 766 bb_error_msg("broadcast can be set only for IPv4 addresses");
767 return -1; 767 return -1;
768 } 768 }
769 brd = peer; 769 brd = peer;
@@ -787,7 +787,7 @@ static int ipaddr_modify(int cmd, int argc, char **argv)
787 ll_init_map(&rth); 787 ll_init_map(&rth);
788 788
789 if ((req.ifa.ifa_index = ll_name_to_index(d)) == 0) { 789 if ((req.ifa.ifa_index = ll_name_to_index(d)) == 0) {
790 bb_error_msg("Cannot find device \"%s\"", d); 790 bb_error_msg("cannot find device \"%s\"", d);
791 return -1; 791 return -1;
792 } 792 }
793 793
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index 6c902eb0e..077c9190e 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -398,7 +398,7 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
398 398
399 if (d) { 399 if (d) {
400 if ((idx = ll_name_to_index(d)) == 0) { 400 if ((idx = ll_name_to_index(d)) == 0) {
401 bb_error_msg("Cannot find device \"%s\"", d); 401 bb_error_msg("cannot find device \"%s\"", d);
402 return -1; 402 return -1;
403 } 403 }
404 addattr32(&req.n, sizeof(req), RTA_OIF, idx); 404 addattr32(&req.n, sizeof(req), RTA_OIF, idx);
@@ -571,7 +571,7 @@ static int iproute_list_or_flush(int argc, char **argv, int flush)
571 571
572 if (id) { 572 if (id) {
573 if ((idx = ll_name_to_index(id)) == 0) { 573 if ((idx = ll_name_to_index(id)) == 0) {
574 bb_error_msg("Cannot find device \"%s\"", id); 574 bb_error_msg("cannot find device \"%s\"", id);
575 return -1; 575 return -1;
576 } 576 }
577 filter.iif = idx; 577 filter.iif = idx;
@@ -579,7 +579,7 @@ static int iproute_list_or_flush(int argc, char **argv, int flush)
579 } 579 }
580 if (od) { 580 if (od) {
581 if ((idx = ll_name_to_index(od)) == 0) { 581 if ((idx = ll_name_to_index(od)) == 0) {
582 bb_error_msg("Cannot find device \"%s\"", od); 582 bb_error_msg("cannot find device \"%s\"", od);
583 } 583 }
584 filter.oif = idx; 584 filter.oif = idx;
585 filter.oifmask = -1; 585 filter.oifmask = -1;
@@ -608,7 +608,7 @@ static int iproute_list_or_flush(int argc, char **argv, int flush)
608 } 608 }
609 filter.flushed = 0; 609 filter.flushed = 0;
610 if (rtnl_dump_filter(&rth, print_route, stdout, NULL, NULL) < 0) { 610 if (rtnl_dump_filter(&rth, print_route, stdout, NULL, NULL) < 0) {
611 bb_error_msg("Flush terminated"); 611 bb_error_msg("flush terminated");
612 return -1; 612 return -1;
613 } 613 }
614 if (filter.flushed == 0) { 614 if (filter.flushed == 0) {
@@ -622,16 +622,16 @@ static int iproute_list_or_flush(int argc, char **argv, int flush)
622 622
623 if (filter.tb != -1) { 623 if (filter.tb != -1) {
624 if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) { 624 if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) {
625 bb_perror_msg_and_die("Cannot send dump request"); 625 bb_perror_msg_and_die("cannot send dump request");
626 } 626 }
627 } else { 627 } else {
628 if (rtnl_rtcache_request(&rth, do_ipv6) < 0) { 628 if (rtnl_rtcache_request(&rth, do_ipv6) < 0) {
629 bb_perror_msg_and_die("Cannot send dump request"); 629 bb_perror_msg_and_die("cannot send dump request");
630 } 630 }
631 } 631 }
632 632
633 if (rtnl_dump_filter(&rth, print_route, stdout, NULL, NULL) < 0) { 633 if (rtnl_dump_filter(&rth, print_route, stdout, NULL, NULL) < 0) {
634 bb_error_msg_and_die("Dump terminated"); 634 bb_error_msg_and_die("dump terminated");
635 } 635 }
636 636
637 exit(0); 637 exit(0);
@@ -733,14 +733,14 @@ static int iproute_get(int argc, char **argv)
733 733
734 if (idev) { 734 if (idev) {
735 if ((idx = ll_name_to_index(idev)) == 0) { 735 if ((idx = ll_name_to_index(idev)) == 0) {
736 bb_error_msg("Cannot find device \"%s\"", idev); 736 bb_error_msg("cannot find device \"%s\"", idev);
737 return -1; 737 return -1;
738 } 738 }
739 addattr32(&req.n, sizeof(req), RTA_IIF, idx); 739 addattr32(&req.n, sizeof(req), RTA_IIF, idx);
740 } 740 }
741 if (odev) { 741 if (odev) {
742 if ((idx = ll_name_to_index(odev)) == 0) { 742 if ((idx = ll_name_to_index(odev)) == 0) {
743 bb_error_msg("Cannot find device \"%s\"", odev); 743 bb_error_msg("cannot find device \"%s\"", odev);
744 return -1; 744 return -1;
745 } 745 }
746 addattr32(&req.n, sizeof(req), RTA_OIF, idx); 746 addattr32(&req.n, sizeof(req), RTA_OIF, idx);
@@ -761,16 +761,16 @@ static int iproute_get(int argc, char **argv)
761 struct rtattr * tb[RTA_MAX+1]; 761 struct rtattr * tb[RTA_MAX+1];
762 762
763 if (print_route(NULL, &req.n, (void*)stdout) < 0) { 763 if (print_route(NULL, &req.n, (void*)stdout) < 0) {
764 bb_error_msg_and_die("An error :-)"); 764 bb_error_msg_and_die("an error :-)");
765 } 765 }
766 766
767 if (req.n.nlmsg_type != RTM_NEWROUTE) { 767 if (req.n.nlmsg_type != RTM_NEWROUTE) {
768 bb_error_msg("Not a route?"); 768 bb_error_msg("not a route?");
769 return -1; 769 return -1;
770 } 770 }
771 len -= NLMSG_LENGTH(sizeof(*r)); 771 len -= NLMSG_LENGTH(sizeof(*r));
772 if (len < 0) { 772 if (len < 0) {
773 bb_error_msg("Wrong len %d", len); 773 bb_error_msg("wrong len %d", len);
774 return -1; 774 return -1;
775 } 775 }
776 776
@@ -781,7 +781,7 @@ static int iproute_get(int argc, char **argv)
781 tb[RTA_PREFSRC]->rta_type = RTA_SRC; 781 tb[RTA_PREFSRC]->rta_type = RTA_SRC;
782 r->rtm_src_len = 8*RTA_PAYLOAD(tb[RTA_PREFSRC]); 782 r->rtm_src_len = 8*RTA_PAYLOAD(tb[RTA_PREFSRC]);
783 } else if (!tb[RTA_SRC]) { 783 } else if (!tb[RTA_SRC]) {
784 bb_error_msg("Failed to connect the route"); 784 bb_error_msg("failed to connect the route");
785 return -1; 785 return -1;
786 } 786 }
787 if (!odev && tb[RTA_OIF]) { 787 if (!odev && tb[RTA_OIF]) {
@@ -802,7 +802,7 @@ static int iproute_get(int argc, char **argv)
802 } 802 }
803 803
804 if (print_route(NULL, &req.n, (void*)stdout) < 0) { 804 if (print_route(NULL, &req.n, (void*)stdout) < 0) {
805 bb_error_msg_and_die("An error :-)"); 805 bb_error_msg_and_die("an error :-)");
806 } 806 }
807 807
808 exit(0); 808 exit(0);
@@ -849,7 +849,7 @@ int do_iproute(int argc, char **argv)
849 case 12: /* flush */ 849 case 12: /* flush */
850 return iproute_list_or_flush(argc-1, argv+1, 1); 850 return iproute_list_or_flush(argc-1, argv+1, 1);
851 default: 851 default:
852 bb_error_msg_and_die("Unknown command %s", *argv); 852 bb_error_msg_and_die("unknown command %s", *argv);
853 } 853 }
854 854
855 return iproute_modify(cmd, flags, argc-1, argv+1); 855 return iproute_modify(cmd, flags, argc-1, argv+1);
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c
index 806d8657d..2b9d3055e 100644
--- a/networking/libiproute/iptunnel.c
+++ b/networking/libiproute/iptunnel.c
@@ -164,26 +164,26 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
164 if (strcmp(*argv, "ipip") == 0 || 164 if (strcmp(*argv, "ipip") == 0 ||
165 strcmp(*argv, "ip/ip") == 0) { 165 strcmp(*argv, "ip/ip") == 0) {
166 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPIP) { 166 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPIP) {
167 bb_error_msg("You managed to ask for more than one tunnel mode."); 167 bb_error_msg("you managed to ask for more than one tunnel mode");
168 exit(-1); 168 exit(-1);
169 } 169 }
170 p->iph.protocol = IPPROTO_IPIP; 170 p->iph.protocol = IPPROTO_IPIP;
171 } else if (strcmp(*argv, "gre") == 0 || 171 } else if (strcmp(*argv, "gre") == 0 ||
172 strcmp(*argv, "gre/ip") == 0) { 172 strcmp(*argv, "gre/ip") == 0) {
173 if (p->iph.protocol && p->iph.protocol != IPPROTO_GRE) { 173 if (p->iph.protocol && p->iph.protocol != IPPROTO_GRE) {
174 bb_error_msg("You managed to ask for more than one tunnel mode."); 174 bb_error_msg("you managed to ask for more than one tunnel mode");
175 exit(-1); 175 exit(-1);
176 } 176 }
177 p->iph.protocol = IPPROTO_GRE; 177 p->iph.protocol = IPPROTO_GRE;
178 } else if (strcmp(*argv, "sit") == 0 || 178 } else if (strcmp(*argv, "sit") == 0 ||
179 strcmp(*argv, "ipv6/ip") == 0) { 179 strcmp(*argv, "ipv6/ip") == 0) {
180 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) { 180 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) {
181 bb_error_msg("You managed to ask for more than one tunnel mode."); 181 bb_error_msg("you managed to ask for more than one tunnel mode");
182 exit(-1); 182 exit(-1);
183 } 183 }
184 p->iph.protocol = IPPROTO_IPV6; 184 p->iph.protocol = IPPROTO_IPV6;
185 } else { 185 } else {
186 bb_error_msg("Cannot guess tunnel mode."); 186 bb_error_msg("cannot guess tunnel mode");
187 exit(-1); 187 exit(-1);
188 } 188 }
189 } else if (strcmp(*argv, "key") == 0) { 189 } else if (strcmp(*argv, "key") == 0) {
@@ -306,7 +306,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
306 306
307 if (p->iph.protocol == IPPROTO_IPIP || p->iph.protocol == IPPROTO_IPV6) { 307 if (p->iph.protocol == IPPROTO_IPIP || p->iph.protocol == IPPROTO_IPV6) {
308 if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) { 308 if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) {
309 bb_error_msg("Keys are not allowed with ipip and sit."); 309 bb_error_msg("keys are not allowed with ipip and sit");
310 return -1; 310 return -1;
311 } 311 }
312 } 312 }
@@ -326,7 +326,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
326 p->o_flags |= GRE_KEY; 326 p->o_flags |= GRE_KEY;
327 } 327 }
328 if (IN_MULTICAST(ntohl(p->iph.daddr)) && !p->iph.saddr) { 328 if (IN_MULTICAST(ntohl(p->iph.daddr)) && !p->iph.saddr) {
329 bb_error_msg("Broadcast tunnel requires a source address."); 329 bb_error_msg("broadcast tunnel requires a source address");
330 return -1; 330 return -1;
331 } 331 }
332 return 0; 332 return 0;
@@ -462,7 +462,7 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
462 buf[sizeof(buf) - 1] = 0; 462 buf[sizeof(buf) - 1] = 0;
463 if ((ptr = strchr(buf, ':')) == NULL || 463 if ((ptr = strchr(buf, ':')) == NULL ||
464 (*ptr++ = 0, sscanf(buf, "%s", name) != 1)) { 464 (*ptr++ = 0, sscanf(buf, "%s", name) != 1)) {
465 bb_error_msg("Wrong format of /proc/net/dev. Sorry."); 465 bb_error_msg("wrong format of /proc/net/dev. Sorry");
466 return -1; 466 return -1;
467 } 467 }
468 if (sscanf(ptr, "%lu%lu%lu%lu%lu%lu%lu%*d%lu%lu%lu%lu%lu%lu%lu", 468 if (sscanf(ptr, "%lu%lu%lu%lu%lu%lu%lu%*d%lu%lu%lu%lu%lu%lu%lu",
@@ -475,7 +475,7 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
475 continue; 475 continue;
476 type = do_ioctl_get_iftype(name); 476 type = do_ioctl_get_iftype(name);
477 if (type == -1) { 477 if (type == -1) {
478 bb_error_msg("Failed to get type of [%s]", name); 478 bb_error_msg("failed to get type of [%s]", name);
479 continue; 479 continue;
480 } 480 }
481 if (type != ARPHRD_TUNNEL && type != ARPHRD_IPGRE && type != ARPHRD_SIT) 481 if (type != ARPHRD_TUNNEL && type != ARPHRD_IPGRE && type != ARPHRD_SIT)
@@ -490,7 +490,7 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
490 (p->i_key && p1.i_key != p->i_key)) 490 (p->i_key && p1.i_key != p->i_key))
491 continue; 491 continue;
492 print_tunnel(&p1); 492 print_tunnel(&p1);
493 printf("\n"); 493 puts("");
494 } 494 }
495 return 0; 495 return 0;
496} 496}
@@ -521,7 +521,7 @@ static int do_show(int argc, char **argv)
521 return -1; 521 return -1;
522 522
523 print_tunnel(&p); 523 print_tunnel(&p);
524 printf("\n"); 524 puts("");
525 return 0; 525 return 0;
526} 526}
527 527
@@ -541,6 +541,6 @@ int do_iptunnel(int argc, char **argv)
541 } else 541 } else
542 return do_show(0, NULL); 542 return do_show(0, NULL);
543 543
544 bb_error_msg("Command \"%s\" is unknown.", *argv); 544 bb_error_msg("command \"%s\" is unknown", *argv);
545 exit(-1); 545 exit(-1);
546} 546}