diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-12 20:58:27 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-12 20:58:27 +0000 |
commit | 6ca409e0e4c198fe3081346eebbae3f068fe605a (patch) | |
tree | 060cb05d99220a1eda399194d1209c269f0e8cd8 /networking/libiproute | |
parent | 4185548984357df91311f30c8e43d95f33922576 (diff) | |
download | busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.gz busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.bz2 busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.zip |
trylink: produce even more info about final link stage
trylink: explain how to modify link and drastically decrease amount
of padding (unfortunately, needs hand editing ATM).
*: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts
size saving: 0.5k
Diffstat (limited to 'networking/libiproute')
-rw-r--r-- | networking/libiproute/ip_parse_common_args.c | 2 | ||||
-rw-r--r-- | networking/libiproute/ipaddress.c | 6 | ||||
-rw-r--r-- | networking/libiproute/iplink.c | 4 | ||||
-rw-r--r-- | networking/libiproute/iproute.c | 10 | ||||
-rw-r--r-- | networking/libiproute/iprule.c | 4 | ||||
-rw-r--r-- | networking/libiproute/iptunnel.c | 4 | ||||
-rw-r--r-- | networking/libiproute/ll_map.c | 2 | ||||
-rw-r--r-- | networking/libiproute/ll_map.h | 2 | ||||
-rw-r--r-- | networking/libiproute/rtm_map.c | 2 |
9 files changed, 18 insertions, 18 deletions
diff --git a/networking/libiproute/ip_parse_common_args.c b/networking/libiproute/ip_parse_common_args.c index 0e429a06f..ff333993f 100644 --- a/networking/libiproute/ip_parse_common_args.c +++ b/networking/libiproute/ip_parse_common_args.c | |||
@@ -26,7 +26,7 @@ void ip_parse_common_args(int *argcp, char ***argvp) | |||
26 | { | 26 | { |
27 | int argc = *argcp; | 27 | int argc = *argcp; |
28 | char **argv = *argvp; | 28 | char **argv = *argvp; |
29 | static const char ip_common_commands[] = | 29 | static const char ip_common_commands[] ALIGN1 = |
30 | "-family\0""inet\0""inet6\0""link\0" | 30 | "-family\0""inet\0""inet6\0""link\0" |
31 | "-4\0""-6\0""-0\0""-oneline\0"; | 31 | "-4\0""-6\0""-0\0""-oneline\0"; |
32 | enum { | 32 | enum { |
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index 8874fdb0a..6a5f2cfbd 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c | |||
@@ -412,7 +412,7 @@ static void ipaddr_reset_filter(int _oneline) | |||
412 | /* Return value becomes exitcode. It's okay to not return at all */ | 412 | /* Return value becomes exitcode. It's okay to not return at all */ |
413 | int ipaddr_list_or_flush(int argc, char **argv, int flush) | 413 | int ipaddr_list_or_flush(int argc, char **argv, int flush) |
414 | { | 414 | { |
415 | static const char option[] = "to\0""scope\0""up\0""label\0""dev\0"; | 415 | static const char option[] ALIGN1 = "to\0""scope\0""up\0""label\0""dev\0"; |
416 | 416 | ||
417 | struct nlmsg_list *linfo = NULL; | 417 | struct nlmsg_list *linfo = NULL; |
418 | struct nlmsg_list *ainfo = NULL; | 418 | struct nlmsg_list *ainfo = NULL; |
@@ -599,7 +599,7 @@ static int default_scope(inet_prefix *lcl) | |||
599 | /* Return value becomes exitcode. It's okay to not return at all */ | 599 | /* Return value becomes exitcode. It's okay to not return at all */ |
600 | static int ipaddr_modify(int cmd, int argc, char **argv) | 600 | static int ipaddr_modify(int cmd, int argc, char **argv) |
601 | { | 601 | { |
602 | static const char option[] = | 602 | static const char option[] ALIGN1 = |
603 | "peer\0""remote\0""broadcast\0""brd\0" | 603 | "peer\0""remote\0""broadcast\0""brd\0" |
604 | "anycast\0""scope\0""dev\0""label\0""local\0"; | 604 | "anycast\0""scope\0""dev\0""label\0""local\0"; |
605 | struct rtnl_handle rth; | 605 | struct rtnl_handle rth; |
@@ -768,7 +768,7 @@ static int ipaddr_modify(int cmd, int argc, char **argv) | |||
768 | /* Return value becomes exitcode. It's okay to not return at all */ | 768 | /* Return value becomes exitcode. It's okay to not return at all */ |
769 | int do_ipaddr(int argc, char **argv) | 769 | int do_ipaddr(int argc, char **argv) |
770 | { | 770 | { |
771 | static const char commands[] = | 771 | static const char commands[] ALIGN1 = |
772 | "add\0""delete\0""list\0""show\0""lst\0""flush\0"; | 772 | "add\0""delete\0""list\0""show\0""lst\0""flush\0"; |
773 | 773 | ||
774 | int command_num = 2; /* default command is list */ | 774 | int command_num = 2; /* default command is list */ |
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c index 69ce84e49..e1c9c6043 100644 --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c | |||
@@ -171,7 +171,7 @@ static int do_set(int argc, char **argv) | |||
171 | struct ifreq ifr0, ifr1; | 171 | struct ifreq ifr0, ifr1; |
172 | char *newname = NULL; | 172 | char *newname = NULL; |
173 | int htype, halen; | 173 | int htype, halen; |
174 | static const char keywords[] = | 174 | static const char keywords[] ALIGN1 = |
175 | "up\0""down\0""name\0""mtu\0""multicast\0""arp\0""addr\0""dev\0" | 175 | "up\0""down\0""name\0""mtu\0""multicast\0""arp\0""addr\0""dev\0" |
176 | "on\0""off\0"; | 176 | "on\0""off\0"; |
177 | enum { ARG_up = 1, ARG_down, ARG_name, ARG_mtu, ARG_multicast, ARG_arp, | 177 | enum { ARG_up = 1, ARG_down, ARG_name, ARG_mtu, ARG_multicast, ARG_arp, |
@@ -275,7 +275,7 @@ static int ipaddr_list_link(int argc, char **argv) | |||
275 | /* Return value becomes exitcode. It's okay to not return at all */ | 275 | /* Return value becomes exitcode. It's okay to not return at all */ |
276 | int do_iplink(int argc, char **argv) | 276 | int do_iplink(int argc, char **argv) |
277 | { | 277 | { |
278 | static const char keywords[] = | 278 | static const char keywords[] ALIGN1 = |
279 | "set\0""show\0""lst\0""list\0"; | 279 | "set\0""show\0""lst\0""list\0"; |
280 | smalluint key; | 280 | smalluint key; |
281 | if (argc <= 0) | 281 | if (argc <= 0) |
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index 0d171c785..fbc721049 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c | |||
@@ -294,7 +294,7 @@ static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED, | |||
294 | /* Return value becomes exitcode. It's okay to not return at all */ | 294 | /* Return value becomes exitcode. It's okay to not return at all */ |
295 | static int iproute_modify(int cmd, unsigned flags, int argc, char **argv) | 295 | static int iproute_modify(int cmd, unsigned flags, int argc, char **argv) |
296 | { | 296 | { |
297 | static const char keywords[] = | 297 | static const char keywords[] ALIGN1 = |
298 | "src\0""via\0""mtu\0""lock\0""protocol\0"USE_FEATURE_IP_RULE("table\0") | 298 | "src\0""via\0""mtu\0""lock\0""protocol\0"USE_FEATURE_IP_RULE("table\0") |
299 | "dev\0""oif\0""to\0"; | 299 | "dev\0""oif\0""to\0"; |
300 | enum { | 300 | enum { |
@@ -489,7 +489,7 @@ static int rtnl_rtcache_request(struct rtnl_handle *rth, int family) | |||
489 | 489 | ||
490 | static void iproute_flush_cache(void) | 490 | static void iproute_flush_cache(void) |
491 | { | 491 | { |
492 | static const char fn[] = "/proc/sys/net/ipv4/route/flush"; | 492 | static const char fn[] ALIGN1 = "/proc/sys/net/ipv4/route/flush"; |
493 | int flush_fd = open_or_warn(fn, O_WRONLY); | 493 | int flush_fd = open_or_warn(fn, O_WRONLY); |
494 | 494 | ||
495 | if (flush_fd < 0) { | 495 | if (flush_fd < 0) { |
@@ -517,7 +517,7 @@ static int iproute_list_or_flush(int argc, char **argv, int flush) | |||
517 | struct rtnl_handle rth; | 517 | struct rtnl_handle rth; |
518 | char *id = NULL; | 518 | char *id = NULL; |
519 | char *od = NULL; | 519 | char *od = NULL; |
520 | static const char keywords[] = | 520 | static const char keywords[] ALIGN1 = |
521 | "protocol\0""all\0""dev\0""oif\0""iif\0""via\0""table\0""cache\0" /*all*/ | 521 | "protocol\0""all\0""dev\0""oif\0""iif\0""via\0""table\0""cache\0" /*all*/ |
522 | "from\0""root\0""match\0""exact\0""to\0"/*root match exact*/; | 522 | "from\0""root\0""match\0""exact\0""to\0"/*root match exact*/; |
523 | enum { | 523 | enum { |
@@ -679,7 +679,7 @@ static int iproute_get(int argc, char **argv) | |||
679 | char *odev = NULL; | 679 | char *odev = NULL; |
680 | bool connected = 0; | 680 | bool connected = 0; |
681 | bool from_ok = 0; | 681 | bool from_ok = 0; |
682 | static const char options[] = | 682 | static const char options[] ALIGN1 = |
683 | "from\0""iif\0""oif\0""dev\0""notify\0""connected\0""to\0"; | 683 | "from\0""iif\0""oif\0""dev\0""notify\0""connected\0""to\0"; |
684 | 684 | ||
685 | memset(&req, 0, sizeof(req)); | 685 | memset(&req, 0, sizeof(req)); |
@@ -824,7 +824,7 @@ static int iproute_get(int argc, char **argv) | |||
824 | /* Return value becomes exitcode. It's okay to not return at all */ | 824 | /* Return value becomes exitcode. It's okay to not return at all */ |
825 | int do_iproute(int argc, char **argv) | 825 | int do_iproute(int argc, char **argv) |
826 | { | 826 | { |
827 | static const char ip_route_commands[] = | 827 | static const char ip_route_commands[] ALIGN1 = |
828 | /*0-3*/ "add\0""append\0""change\0""chg\0" | 828 | /*0-3*/ "add\0""append\0""change\0""chg\0" |
829 | /*4-7*/ "delete\0""get\0""list\0""show\0" | 829 | /*4-7*/ "delete\0""get\0""list\0""show\0" |
830 | /*8..*/ "prepend\0""replace\0""test\0""flush\0"; | 830 | /*8..*/ "prepend\0""replace\0""test\0""flush\0"; |
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c index 8e2a06f4f..18ae6b5ef 100644 --- a/networking/libiproute/iprule.c +++ b/networking/libiproute/iprule.c | |||
@@ -187,7 +187,7 @@ static int iprule_list(int argc, char **argv) | |||
187 | /* Return value becomes exitcode. It's okay to not return at all */ | 187 | /* Return value becomes exitcode. It's okay to not return at all */ |
188 | static int iprule_modify(int cmd, int argc, char **argv) | 188 | static int iprule_modify(int cmd, int argc, char **argv) |
189 | { | 189 | { |
190 | static const char keywords[] = | 190 | static const char keywords[] ALIGN1 = |
191 | "from\0""to\0""preference\0""order\0""priority\0" | 191 | "from\0""to\0""preference\0""order\0""priority\0" |
192 | "tos\0""fwmark\0""realms\0""table\0""lookup\0""dev\0" | 192 | "tos\0""fwmark\0""realms\0""table\0""lookup\0""dev\0" |
193 | "iif\0""nat\0""map-to\0""type\0""help\0"; | 193 | "iif\0""nat\0""map-to\0""type\0""help\0"; |
@@ -313,7 +313,7 @@ static int iprule_modify(int cmd, int argc, char **argv) | |||
313 | /* Return value becomes exitcode. It's okay to not return at all */ | 313 | /* Return value becomes exitcode. It's okay to not return at all */ |
314 | int do_iprule(int argc, char **argv) | 314 | int do_iprule(int argc, char **argv) |
315 | { | 315 | { |
316 | static const char ip_rule_commands[] = | 316 | static const char ip_rule_commands[] ALIGN1 = |
317 | "add\0""delete\0""list\0""show\0"; | 317 | "add\0""delete\0""list\0""show\0"; |
318 | int cmd = 2; /* list */ | 318 | int cmd = 2; /* list */ |
319 | 319 | ||
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c index a2933879c..2b1713556 100644 --- a/networking/libiproute/iptunnel.c +++ b/networking/libiproute/iptunnel.c | |||
@@ -128,7 +128,7 @@ static int do_del_ioctl(const char *basedev, struct ip_tunnel_parm *p) | |||
128 | /* Dies on error */ | 128 | /* Dies on error */ |
129 | static void parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p) | 129 | static void parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p) |
130 | { | 130 | { |
131 | static const char keywords[] = | 131 | static const char keywords[] ALIGN1 = |
132 | "mode\0""ipip\0""ip/ip\0""gre\0""gre/ip\0""sit\0""ipv6/ip\0" | 132 | "mode\0""ipip\0""ip/ip\0""gre\0""gre/ip\0""sit\0""ipv6/ip\0" |
133 | "key\0""ikey\0""okey\0""seq\0""iseq\0""oseq\0" | 133 | "key\0""ikey\0""okey\0""seq\0""iseq\0""oseq\0" |
134 | "csum\0""icsum\0""ocsum\0""nopmtudisc\0""pmtudisc\0" | 134 | "csum\0""icsum\0""ocsum\0""nopmtudisc\0""pmtudisc\0" |
@@ -519,7 +519,7 @@ static int do_show(int argc, char **argv) | |||
519 | /* Return value becomes exitcode. It's okay to not return at all */ | 519 | /* Return value becomes exitcode. It's okay to not return at all */ |
520 | int do_iptunnel(int argc, char **argv) | 520 | int do_iptunnel(int argc, char **argv) |
521 | { | 521 | { |
522 | static const char keywords[] = | 522 | static const char keywords[] ALIGN1 = |
523 | "add\0""change\0""delete\0""show\0""list\0""lst\0"; | 523 | "add\0""change\0""delete\0""show\0""list\0""lst\0"; |
524 | enum { ARG_add = 0, ARG_change, ARG_del, ARG_show, ARG_list, ARG_lst }; | 524 | enum { ARG_add = 0, ARG_change, ARG_del, ARG_show, ARG_list, ARG_lst }; |
525 | int key; | 525 | int key; |
diff --git a/networking/libiproute/ll_map.c b/networking/libiproute/ll_map.c index e8a8279b0..7b5de92c2 100644 --- a/networking/libiproute/ll_map.c +++ b/networking/libiproute/ll_map.c | |||
@@ -131,7 +131,7 @@ unsigned ll_index_to_flags(int idx) | |||
131 | return 0; | 131 | return 0; |
132 | } | 132 | } |
133 | 133 | ||
134 | int xll_name_to_index(const char * const name) | 134 | int xll_name_to_index(const char *const name) |
135 | { | 135 | { |
136 | int ret = 0; | 136 | int ret = 0; |
137 | int sock_fd; | 137 | int sock_fd; |
diff --git a/networking/libiproute/ll_map.h b/networking/libiproute/ll_map.h index 2dfc84422..55e2cf393 100644 --- a/networking/libiproute/ll_map.h +++ b/networking/libiproute/ll_map.h | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | int ll_remember_index(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); | 5 | int ll_remember_index(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); |
6 | int ll_init_map(struct rtnl_handle *rth); | 6 | int ll_init_map(struct rtnl_handle *rth); |
7 | int xll_name_to_index(const char * const name); | 7 | int xll_name_to_index(const char *const name); |
8 | const char *ll_index_to_name(int idx); | 8 | const char *ll_index_to_name(int idx); |
9 | const char *ll_idx_n2a(int idx, char *buf); | 9 | const char *ll_idx_n2a(int idx, char *buf); |
10 | /* int ll_index_to_type(int idx); */ | 10 | /* int ll_index_to_type(int idx); */ |
diff --git a/networking/libiproute/rtm_map.c b/networking/libiproute/rtm_map.c index 96b2d1791..ca2f4436a 100644 --- a/networking/libiproute/rtm_map.c +++ b/networking/libiproute/rtm_map.c | |||
@@ -51,7 +51,7 @@ const char *rtnl_rtntype_n2a(int id, char *buf, int len) | |||
51 | 51 | ||
52 | int rtnl_rtntype_a2n(int *id, char *arg) | 52 | int rtnl_rtntype_a2n(int *id, char *arg) |
53 | { | 53 | { |
54 | static const char keywords[] = | 54 | static const char keywords[] ALIGN1 = |
55 | "local\0""nat\0""broadcast\0""brd\0""anycast\0" | 55 | "local\0""nat\0""broadcast\0""brd\0""anycast\0" |
56 | "multicast\0""prohibit\0""unreachable\0""blackhole\0" | 56 | "multicast\0""prohibit\0""unreachable\0""blackhole\0" |
57 | "xresolve\0""unicast\0""throw\0"; | 57 | "xresolve\0""unicast\0""throw\0"; |