diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2013-12-05 23:48:30 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2013-12-09 14:38:09 (GMT) |
commit | efdde42fcc063d725af0a92d24966c499998a8c0 (patch) | |
tree | 8076de130964131ed2178a6fd60d4e98b114baa7 /lib/route | |
parent | 507897a53ee033b3cc9375582a5b790c39b65271 (diff) | |
download | libnl-efdde42fcc063d725af0a92d24966c499998a8c0.zip libnl-efdde42fcc063d725af0a92d24966c499998a8c0.tar.gz libnl-efdde42fcc063d725af0a92d24966c499998a8c0.tar.bz2 |
basic: add action removal API
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'lib/route')
-rw-r--r-- | lib/route/cls/basic.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/route/cls/basic.c b/lib/route/cls/basic.c index b7449c0..c5c5cb0 100644 --- a/lib/route/cls/basic.c +++ b/lib/route/cls/basic.c @@ -232,6 +232,25 @@ int rtnl_basic_add_action(struct rtnl_cls *cls, struct rtnl_act *act) b->b_mask |= BASIC_ATTR_ACTION; return rtnl_act_append(&b->b_act, act); } + +int rtnl_basic_del_action(struct rtnl_cls *cls, struct rtnl_act *act) +{ + struct rtnl_basic *b; + int ret; + + if (!act) + return 0; + + if (!(b = rtnl_tc_data(TC_CAST(cls)))) + return -NLE_NOMEM; + + if (!(b->b_mask & BASIC_ATTR_ACTION)) + return -NLE_INVAL; + ret = rtnl_act_remove(&b->b_act, act); + if (!b->b_act) + b->b_mask &= ~BASIC_ATTR_ACTION; + return ret; +} /** @} */ static struct rtnl_tc_ops basic_ops = { |