Skip to content

Commit 155fa12

Browse files
ppiaoldv-alt
authored andcommitted
rtnl_tc_action: decode tcamsg netlink attributes
* rtnl_tc_action.c (tcamsg_nla_decoders): New array. (decode_tcamsg): Use it.
1 parent 16f073a commit 155fa12

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

rtnl_tc_action.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@
3737

3838
#include "xlat/rtnl_tc_action_attrs.h"
3939

40+
static const nla_decoder_t tcamsg_nla_decoders[] = {
41+
[TCA_ACT_KIND] = decode_nla_str,
42+
[TCA_ACT_OPTIONS] = NULL, /* unimplemented */
43+
[TCA_ACT_INDEX] = decode_nla_u32,
44+
[TCA_ACT_STATS] = decode_nla_tc_stats,
45+
[TCA_ACT_PAD] = NULL,
46+
[TCA_ACT_COOKIE] = NULL /* default parser */
47+
};
48+
4049
DECL_NETLINK_ROUTE_DECODER(decode_tcamsg)
4150
{
4251
struct tcamsg tca = { .tca_family = family };
@@ -49,6 +58,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_tcamsg)
4958
tprints(", ");
5059
decode_nlattr(tcp, addr + offset, len - offset,
5160
rtnl_tc_action_attrs, "TCA_ACT_???",
52-
NULL, 0, NULL);
61+
tcamsg_nla_decoders,
62+
ARRAY_SIZE(tcamsg_nla_decoders), NULL);
5363
}
5464
}

0 commit comments

Comments
 (0)