3 @@ -15,6 +15,13 @@ RTMONOBJ=rtmon.o
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 @@ -74,32 +74,44 @@ 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 },
50 { "macsec", do_ipmacsec },
51 { "tunnel", do_iptunnel },
52 { "tunl", do_iptunnel },
53 +#ifndef IPROUTE2_TINY
54 { "tuntap", do_iptuntap },
55 { "tap", do_iptuntap },
56 { "token", do_iptoken },
57 { "tcpmetrics", do_tcp_metrics },
58 { "tcp_metrics", do_tcp_metrics },
60 { "monitor", do_ipmonitor },
61 +#ifndef IPROUTE2_TINY
64 { "mroute", do_multiroute },
65 { "mrule", do_multirule },
66 { "netns", do_netns },
67 +#ifndef IPROUTE2_TINY
68 { "netconf", do_ipnetconf },
75 @@ -817,6 +817,7 @@ const char *rt_addr_n2a_r(int af, int le
76 return inet_ntop(af, addr, buf, buflen);
78 return mpls_ntop(af, addr, buf, buflen);
79 +#ifndef IPROUTE2_TINY
81 return ipx_ntop(af, addr, buf, buflen);
83 @@ -826,6 +827,7 @@ const char *rt_addr_n2a_r(int af, int le
84 memcpy(dna.a_addr, addr, 2);
85 return dnet_ntop(af, &dna, buf, buflen);
89 return ll_addr_n2a(addr, len, ARPHRD_VOID, buf, buflen);
93 @@ -2,6 +2,10 @@ include ../config.mk
97 +ifeq ($(IP_CONFIG_TINY),y)
98 + CFLAGS += -DIPROUTE2_TINY
101 UTILOBJ = utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o \
102 inet_proto.o namespace.o json_writer.o json_print.o \
103 names.o color.o bpf.o exec.o fs.o