Saves a minor 12b.
lib-$(CONFIG_INETD) += inetd.o
lib-$(CONFIG_IP) += ip.o
lib-$(CONFIG_IPCALC) += ipcalc.o
-lib-$(CONFIG_IPADDR) += ipaddr.o
-lib-$(CONFIG_IPLINK) += iplink.o
-lib-$(CONFIG_IPROUTE) += iproute.o
-lib-$(CONFIG_IPRULE) += iprule.o
-lib-$(CONFIG_IPTUNNEL) += iptunnel.o
lib-$(CONFIG_NAMEIF) += nameif.o
lib-$(CONFIG_NC) += nc.o
lib-$(CONFIG_NETSTAT) += netstat.o
{
bb_show_usage();
}
+
+static int (*ip_func)(int argc, char **argv) = ip_print_help;
+
+static int ip_do(int argc, char **argv)
+{
+ ip_parse_common_args(&argc, &argv);
+ return ip_func(argc-1, argv+1);
+}
+
+#if ENABLE_FEATURE_IP_ADDRESS
+int ipaddr_main(int argc, char **argv);
+int ipaddr_main(int argc, char **argv)
+{
+ ip_func = do_ipaddr;
+ return ip_do(argc, argv);
+}
+#endif
+#if ENABLE_FEATURE_IP_LINK
+int iplink_main(int argc, char **argv);
+int iplink_main(int argc, char **argv)
+{
+ ip_func = do_iplink;
+ return ip_do(argc, argv);
+}
+#endif
+#if ENABLE_FEATURE_IP_ROUTE
+int iproute_main(int argc, char **argv);
+int iproute_main(int argc, char **argv)
+{
+ ip_func = do_iproute;
+ return ip_do(argc, argv);
+}
+#endif
+#if ENABLE_FEATURE_IP_RULE
+int iprule_main(int argc, char **argv);
+int iprule_main(int argc, char **argv)
+{
+ ip_func = do_iprule;
+ return ip_do(argc, argv);
+}
+#endif
+#if ENABLE_FEATURE_IP_TUNNEL
+int iptunnel_main(int argc, char **argv);
+int iptunnel_main(int argc, char **argv)
+{
+ ip_func = do_iptunnel;
+ return ip_do(argc, argv);
+}
+#endif
+
+
int ip_main(int argc, char **argv);
int ip_main(int argc, char **argv)
{
USE_FEATURE_IP_RULE(IP_rule,)
IP_none
};
- int (*ip_func)(int argc, char **argv) = ip_print_help;
ip_parse_common_args(&argc, &argv);
if (argc > 1) {
+++ /dev/null
-/* vi: set sw=4 ts=4: */
-/*
- * ip.c "ip" utility frontend.
- *
- * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
- *
- *
- * Changes:
- *
- * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
- */
-
-#include "libiproute/utils.h"
-#include "libiproute/ip_common.h"
-
-#include "busybox.h"
-
-int ipaddr_main(int argc, char **argv);
-int ipaddr_main(int argc, char **argv)
-{
- ip_parse_common_args(&argc, &argv);
-
- return do_ipaddr(argc-1, argv+1);
-}
+++ /dev/null
-/* vi: set sw=4 ts=4: */
-/*
- * ip.c "ip" utility frontend.
- *
- * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
- *
- *
- * Changes:
- *
- * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
- */
-
-#include "libiproute/utils.h"
-#include "libiproute/ip_common.h"
-
-#include "busybox.h"
-
-int iplink_main(int argc, char **argv);
-int iplink_main(int argc, char **argv)
-{
- ip_parse_common_args(&argc, &argv);
-
- return do_iplink(argc-1, argv+1);
-}
+++ /dev/null
-/* vi: set sw=4 ts=4: */
-/*
- * ip.c "ip" utility frontend.
- *
- * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
- *
- *
- * Changes:
- *
- * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
- */
-
-#include "libiproute/utils.h"
-#include "libiproute/ip_common.h"
-
-#include "busybox.h"
-
-int iproute_main(int argc, char **argv);
-int iproute_main(int argc, char **argv)
-{
- ip_parse_common_args(&argc, &argv);
-
- return do_iproute(argc-1, argv+1);
-}
+++ /dev/null
-/* vi: set sw=4 ts=4: */
-/*
- * ip.c "ip" utility frontend.
- *
- * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
- *
- *
- * Changes:
- *
- * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
- */
-
-#include "libiproute/utils.h"
-#include "libiproute/ip_common.h"
-
-#include "busybox.h"
-
-int iprule_main(int argc, char **argv);
-int iprule_main(int argc, char **argv)
-{
- ip_parse_common_args(&argc, &argv);
-
- return do_iprule(argc-1, argv+1);
-}
+++ /dev/null
-/* vi: set sw=4 ts=4: */
-/*
- * ip.c "ip" utility frontend.
- *
- * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
- *
- *
- * Changes:
- *
- * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
- */
-
-#include "libiproute/utils.h"
-#include "libiproute/ip_common.h"
-
-#include "busybox.h"
-
-int iptunnel_main(int argc, char **argv);
-int iptunnel_main(int argc, char **argv)
-{
- ip_parse_common_args(&argc, &argv);
-
- return do_iptunnel(argc-1, argv+1);
-}