3 @@ -17,6 +17,13 @@ ifeq ($(IP_CONFIG_SETNS),y)
8 +ifeq ($(IP_CONFIG_TINY),y)
9 + STATIC_SYM_FILTER:=iplink_can.c iplink_ipoib.c iplink_vxlan.c
10 + CFLAGS += -DIPROUTE2_TINY
12 +STATIC_SYM_SOURCES:=$(filter-out $(STATIC_SYM_FILTER),$(wildcard *.c))
14 ALLOBJ=$(IPOBJ) $(RTMONOBJ)
15 SCRIPTS=ifcfg rtpr routel routef
17 @@ -44,7 +51,7 @@ else
20 static-syms.o: static-syms.h
21 -static-syms.h: $(wildcard *.c)
22 +static-syms.h: $(STATIC_SYM_SOURCES)
24 for s in `grep -B 3 '\<dlsym' $$files | sed -n '/snprintf/{s:.*"\([^"]*\)".*:\1:;s:%s::;p}'` ; do \
25 sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
28 @@ -73,30 +73,42 @@ static const struct cmd {
29 int (*func)(int argc, char **argv);
31 { "address", do_ipaddr },
32 +#ifndef IPROUTE2_TINY
33 { "addrlabel", do_ipaddrlabel },
35 { "maddress", do_multiaddr },
36 { "route", do_iproute },
37 { "rule", do_iprule },
38 { "neighbor", do_ipneigh },
39 { "neighbour", do_ipneigh },
40 +#ifndef IPROUTE2_TINY
41 { "ntable", do_ipntable },
42 { "ntbl", do_ipntable },
44 { "link", do_iplink },
45 +#ifndef IPROUTE2_TINY
46 { "l2tp", do_ipl2tp },
49 { "tunnel", do_iptunnel },
50 { "tunl", do_iptunnel },
51 +#ifndef IPROUTE2_TINY
52 { "tuntap", do_iptuntap },
53 { "tap", do_iptuntap },
54 { "token", do_iptoken },
55 { "tcpmetrics", do_tcp_metrics },
56 { "tcp_metrics", do_tcp_metrics },
58 { "monitor", do_ipmonitor },
59 +#ifndef IPROUTE2_TINY
62 { "mroute", do_multiroute },
63 { "mrule", do_multirule },
64 { "netns", do_netns },
65 +#ifndef IPROUTE2_TINY
66 { "netconf", do_ipnetconf },
73 @@ -710,6 +710,7 @@ const char *rt_addr_n2a(int af, int len,
74 return inet_ntop(af, addr, buf, buflen);
76 return mpls_ntop(af, addr, buf, buflen);
77 +#ifndef IPROUTE2_TINY
79 return ipx_ntop(af, addr, buf, buflen);
81 @@ -718,6 +719,7 @@ const char *rt_addr_n2a(int af, int len,
82 memcpy(dna.a_addr, addr, 2);
83 return dnet_ntop(af, &dna, buf, buflen);
87 return ll_addr_n2a(addr, len, ARPHRD_VOID, buf, buflen);
91 @@ -4,6 +4,10 @@ ifeq ($(IP_CONFIG_SETNS),y)
92 CFLAGS += -DHAVE_SETNS
95 +ifeq ($(IP_CONFIG_TINY),y)
96 + CFLAGS += -DIPROUTE2_TINY
101 UTILOBJ = utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o \