2 * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
3 * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
4 * Copyright (c) 2016-2018 The strace developers.
7 * SPDX-License-Identifier: LGPL-2.1-or-later
11 #include "netlink_route.h"
13 #include "print_fields.h"
16 #include <linux/rtnetlink.h>
18 #include "xlat/rtnl_tc_action_attrs.h"
20 static const nla_decoder_t tcamsg_nla_decoders[] = {
21 [TCA_ACT_KIND] = decode_nla_str,
22 [TCA_ACT_OPTIONS] = NULL, /* unimplemented */
23 [TCA_ACT_INDEX] = decode_nla_u32,
24 [TCA_ACT_STATS] = decode_nla_tc_stats,
26 [TCA_ACT_COOKIE] = NULL /* default parser */
29 DECL_NETLINK_ROUTE_DECODER(decode_tcamsg)
31 struct tcamsg tca = { .tca_family = family };
33 PRINT_FIELD_XVAL("{", tca, tca_family, addrfams, "AF_???");
36 const size_t offset = NLMSG_ALIGN(sizeof(tca));
39 decode_nlattr(tcp, addr + offset, len - offset,
40 rtnl_tc_action_attrs, "TCA_ACT_???",
42 ARRAY_SIZE(tcamsg_nla_decoders), NULL);