mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2026-01-27 14:34:22 +00:00
Support the "dsa" kind of rtnl_link_ops exported by the kernel, and
export reads/writes to IFLA_DSA_MASTER.
Examples:
$ ip link set swp0 type dsa conduit eth1
$ ip -d link show dev swp0
(...)
dsa conduit eth0
$ ip -d -j link show swp0
[
{
"link": "eth1",
"linkinfo": {
"info_kind": "dsa",
"info_data": {
"conduit": "eth1"
}
},
}
]
Note that by construction and as shown in the example, the IFLA_LINK
reported by a DSA user port is identical to what is reported through
IFLA_DSA_MASTER. However IFLA_LINK is not writable, and overloading its
meaning to make it writable would clash with other users of IFLA_LINK
(vlan etc) for which writing this property does not make sense.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
58 lines
1.9 KiB
Makefile
58 lines
1.9 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
|
|
rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
|
|
ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o iptoken.o \
|
|
ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o iplink_dummy.o \
|
|
iplink_ifb.o iplink_nlmon.o iplink_team.o iplink_vcan.o iplink_vxcan.o \
|
|
iplink_vlan.o link_veth.o link_gre.o iplink_can.o iplink_xdp.o \
|
|
iplink_macvlan.o ipl2tp.o link_vti.o link_vti6.o link_xfrm.o \
|
|
iplink_vxlan.o tcp_metrics.o iplink_ipoib.o ipnetconf.o link_ip6tnl.o \
|
|
link_iptnl.o link_gre6.o iplink_bond.o iplink_bond_slave.o iplink_hsr.o \
|
|
iplink_bridge.o iplink_bridge_slave.o iplink_dsa.o ipfou.o iplink_ipvlan.o \
|
|
iplink_geneve.o iplink_vrf.o iproute_lwtunnel.o ipmacsec.o ipila.o \
|
|
ipvrf.o iplink_xstats.o ipseg6.o iplink_netdevsim.o iplink_rmnet.o \
|
|
ipnexthop.o ipmptcp.o iplink_bareudp.o iplink_wwan.o ipioam6.o \
|
|
iplink_amt.o iplink_batadv.o iplink_gtp.o iplink_virt_wifi.o \
|
|
ipstats.o
|
|
|
|
RTMONOBJ=rtmon.o
|
|
|
|
include ../config.mk
|
|
|
|
ALLOBJ=$(IPOBJ) $(RTMONOBJ)
|
|
SCRIPTS=routel
|
|
TARGETS=ip rtmon
|
|
|
|
all: $(TARGETS) $(SCRIPTS)
|
|
|
|
ip: $(IPOBJ) $(LIBNETLINK)
|
|
$(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
|
|
|
|
rtmon: $(RTMONOBJ)
|
|
$(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
|
|
|
|
install: all
|
|
install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)
|
|
install -m 0755 $(SCRIPTS) $(DESTDIR)$(SBINDIR)
|
|
|
|
clean:
|
|
rm -f $(ALLOBJ) $(TARGETS)
|
|
|
|
SHARED_LIBS ?= y
|
|
ifeq ($(SHARED_LIBS),y)
|
|
|
|
LDLIBS += -ldl
|
|
LDFLAGS += -Wl,-export-dynamic
|
|
|
|
else
|
|
|
|
ip: static-syms.o
|
|
static-syms.o: static-syms.h
|
|
static-syms.h: $(wildcard *.c)
|
|
files="$^" ; \
|
|
for s in `grep -B 3 '\<dlsym' $$files | sed -n '/snprintf/{s:.*"\([^"]*\)".*:\1:;s:%s::;p}'` ; do \
|
|
sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
|
|
done > $@
|
|
|
|
endif
|