Skip to content

Commit

Permalink
route: merge branch 'shanmugh-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
thom311 committed May 3, 2017
2 parents b9a5a83 + eb481fb commit b5513d4
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/netlink/route/action.h
Expand Up @@ -22,6 +22,7 @@ extern "C" {
#endif

extern struct rtnl_act *rtnl_act_alloc(void);
extern struct rtnl_act *rtnl_act_next(struct rtnl_act *);
extern void rtnl_act_get(struct rtnl_act *);
extern void rtnl_act_put(struct rtnl_act *);
extern int rtnl_act_build_add_request(struct rtnl_act *, int,
Expand Down
1 change: 1 addition & 0 deletions include/netlink/route/cls/basic.h
Expand Up @@ -28,6 +28,7 @@ extern void rtnl_basic_set_ematch(struct rtnl_cls *,
extern struct rtnl_ematch_tree *rtnl_basic_get_ematch(struct rtnl_cls *);
extern int rtnl_basic_add_action(struct rtnl_cls *, struct rtnl_act *);
extern int rtnl_basic_del_action(struct rtnl_cls *, struct rtnl_act *);
extern struct rtnl_act* rtnl_basic_get_action(struct rtnl_cls *);

#ifdef __cplusplus
}
Expand Down
1 change: 1 addition & 0 deletions include/netlink/route/cls/u32.h
Expand Up @@ -50,6 +50,7 @@ extern int rtnl_u32_add_key_in6_addr(struct rtnl_cls *, const struct in6_addr *,
uint8_t, int, int);
extern int rtnl_u32_add_action(struct rtnl_cls *, struct rtnl_act *);
extern int rtnl_u32_del_action(struct rtnl_cls *, struct rtnl_act *);
extern struct rtnl_act* rtnl_u32_get_action(struct rtnl_cls *);

#ifdef __cplusplus
}
Expand Down
9 changes: 9 additions & 0 deletions lib/route/act.c
Expand Up @@ -27,6 +27,15 @@
static struct nl_object_ops act_obj_ops;
static struct nl_cache_ops rtnl_act_ops;

struct rtnl_act * rtnl_act_next(struct rtnl_act *act)
{
if (act == NULL) {
return NULL;
}

return act->a_next;
}

int rtnl_act_append(struct rtnl_act **head, struct rtnl_act *new)
{
struct rtnl_act *p_act;
Expand Down
13 changes: 13 additions & 0 deletions lib/route/cls/basic.c
Expand Up @@ -233,6 +233,19 @@ int rtnl_basic_add_action(struct rtnl_cls *cls, struct rtnl_act *act)
return rtnl_act_append(&b->b_act, act);
}

struct rtnl_act* rtnl_basic_get_action(struct rtnl_cls *cls)
{
struct rtnl_basic *b;

if (!(b = rtnl_tc_data_peek(TC_CAST(cls))))
return NULL;

if (!(b->b_mask & BASIC_ATTR_ACTION))
return NULL;

return b->b_act;
}

int rtnl_basic_del_action(struct rtnl_cls *cls, struct rtnl_act *act)
{
struct rtnl_basic *b;
Expand Down
13 changes: 13 additions & 0 deletions lib/route/cls/u32.c
Expand Up @@ -560,6 +560,19 @@ int rtnl_u32_add_action(struct rtnl_cls *cls, struct rtnl_act *act)
return rtnl_act_append(&u->cu_act, act);
}

struct rtnl_act* rtnl_u32_get_action(struct rtnl_cls *cls)
{
struct rtnl_u32 *u;

if (!(u = rtnl_tc_data_peek(TC_CAST(cls))))
return NULL;

if (!(u->cu_mask & U32_ATTR_ACTION))
return NULL;

return u->cu_act;
}

int rtnl_u32_del_action(struct rtnl_cls *cls, struct rtnl_act *act)
{
struct rtnl_u32 *u;
Expand Down
3 changes: 3 additions & 0 deletions libnl-route-3.sym
Expand Up @@ -1034,8 +1034,11 @@ global:

libnl_3_4 {
global:
rtnl_act_next;
rtnl_basic_get_action;
rtnl_link_inet6_flags2str;
rtnl_link_inet6_str2flags;
rtnl_link_inet6_get_flags;
rtnl_link_inet6_set_flags;
rtnl_u32_get_action;
} libnl_3_2_29;

0 comments on commit b5513d4

Please sign in to comment.