3 @@ -17,6 +17,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 @@ -46,7 +53,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 @@ -48,10 +48,16 @@ static void usage(void)
30 "Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
31 " ip [ -force ] -batch filename\n"
32 +#ifndef IPROUTE2_TINY
33 "where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |\n"
34 " tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |\n"
35 " netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |\n"
36 " vrf | sr | nexthop | mptcp }\n"
38 + "where OBJECT := { link | address | route | rule | neigh | tunnel | maddress |\n"
39 + " mroute | mrule | monitor | netns | macsec | token | ila |\n"
42 " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
43 " -h[uman-readable] | -iec | -j[son] | -p[retty] |\n"
44 " -f[amily] { inet | inet6 | mpls | bridge | link } |\n"
45 @@ -74,36 +80,50 @@ static const struct cmd {
46 int (*func)(int argc, char **argv);
48 { "address", do_ipaddr },
49 +#ifndef IPROUTE2_TINY
50 { "addrlabel", do_ipaddrlabel },
52 { "maddress", do_multiaddr },
53 { "route", do_iproute },
54 { "rule", do_iprule },
55 { "neighbor", do_ipneigh },
56 { "neighbour", do_ipneigh },
57 +#ifndef IPROUTE2_TINY
58 { "ntable", do_ipntable },
59 { "ntbl", do_ipntable },
61 { "link", do_iplink },
62 +#ifndef IPROUTE2_TINY
63 { "l2tp", do_ipl2tp },
67 { "macsec", do_ipmacsec },
68 { "tunnel", do_iptunnel },
69 { "tunl", do_iptunnel },
70 +#ifndef IPROUTE2_TINY
71 { "tuntap", do_iptuntap },
72 { "tap", do_iptuntap },
73 { "token", do_iptoken },
74 { "tcpmetrics", do_tcp_metrics },
75 { "tcp_metrics", do_tcp_metrics },
77 { "monitor", do_ipmonitor },
78 +#ifndef IPROUTE2_TINY
81 { "mroute", do_multiroute },
82 { "mrule", do_multirule },
83 { "netns", do_netns },
84 +#ifndef IPROUTE2_TINY
85 { "netconf", do_ipnetconf },
89 +#ifndef IPROUTE2_TINY
90 { "nexthop", do_ipnh },
91 { "mptcp", do_mptcp },
98 @@ -3,6 +3,10 @@ include ../config.mk
102 +ifeq ($(IP_CONFIG_TINY),y)
103 + CFLAGS += -DIPROUTE2_TINY
106 UTILOBJ = utils.o rt_names.o ll_map.o ll_types.o ll_proto.o ll_addr.o \
107 inet_proto.o namespace.o json_writer.o json_print.o \
108 names.o color.o bpf.o exec.o fs.o cg_map.o