summaryrefslogtreecommitdiff
path: root/src/defs.h
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2021-10-18 05:13:34 +0200
committerDmitry V. Levin <ldv@strace.io>2021-11-12 15:41:37 +0000
commit63ef457326729e018855b9f394bfb62432e0930a (patch)
treeaad4147596090e90fe855f167f036ab643529843 /src/defs.h
parent03c3b1ccd0627d3555cbb8ab443e9902d3c7efc9 (diff)
downloadstrace-63ef457326729e018855b9f394bfb62432e0930a.tar.gz
rtnl_link: implement IFLA_AF_SPEC decoding for AF_BRIDGE
It is special with relation to the others as it employs a completely different structure, disregarding the existing one. * src/xlat/rtnl_ifla_af_spec_bridge_attrs.in: New file. * src/xlat/rtnl_ifla_af_spec_bridge_vlan_tunnel_info_attrs.in: Likewise. * src/xlat/rtnl_ifla_bridge_flags.in: Likewise. * src/xlat/rtnl_ifla_bridge_modes.in: Likewise. * src/defs.h (nl_bridge_vlan_flags): New declaration. * src/rtnl_link.c: Include <linux/if_bridge.h>, "xlat/rtnl_ifla_af_spec_bridge_attrs.h", "xlat/rtnl_ifla_af_spec_bridge_vlan_tunnel_info_attrs.h", "xlat/rtnl_ifla_bridge_flags.h", and "xlat/rtnl_ifla_bridge_modes.h". (decode_ifla_bridge_flags, decode_ifla_bridge_mode, decode_ifla_bridge_vlan_info, decode_bridge_vlan_info_flags, decode_ifla_bridge_vlan_tunnel_info): New functions. (ifla_af_spec_bridge_vlan_tunnel_info_decoders, ifla_af_spec_bridge_nla_decoders): New decoder tables. (decode_ifla_af_spec): Add special handling for the ifi_family=AF_BRIDGE case by calling decode_nlattr directly with rtnl_ifla_af_spec_bridge_attrs and ifla_af_spec_bridge_nla_decoders. * tests/nlattr_ifla_af_spec.c: Include <linux/if_bridge.h>. (msg_af, msg_af_str): New static variables. (IFLA_AF): New macro, define to msg_af. (IFLA_AF_STR): New macro, define to msg_af_str. (init_IFLA_BRIDGE_VLAN_TUNNEL_INFO_msg, print_IFLA_BRIDGE_VLAN_TUNNEL_INFO_msg): New functions, defined via AF_SPEC_FUNCS. (main): Check unsupported IFLA_AF_SPEC address families for each ifinfomsg address family, skip AF_BRIDGE; add AF_BRIDGE IFLA_AF_SPEC checks. * NEWS: Mention it.
Diffstat (limited to 'src/defs.h')
-rw-r--r--src/defs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/defs.h b/src/defs.h
index c809ade77..45e2b4a71 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -415,6 +415,7 @@ extern const struct xlat ip_type_of_services[];
extern const struct xlat ipc_private[];
extern const struct xlat msg_flags[];
extern const struct xlat netlink_protocols[];
+extern const struct xlat nl_bridge_vlan_flags[];
extern const struct xlat nl_netfilter_msg_types[];
extern const struct xlat nl_route_types[];
extern const struct xlat open_access_modes[];