Skip to content

Commit 0889a27

Browse files
committed
route: cls: flower: extend API
The following API has been added: - rtnl_flower_set_src_port_range - rtnl_flower_get_src_port_range - rtnl_flower_set_dst_port_range - rtnl_flower_get_dst_port_range - rtnl_flower_set_tcp_src_port - rtnl_flower_set_tcp_dst_port - rtnl_flower_get_tcp_src_port - rtnl_flower_get_tcp_dst_port - rtnl_flower_set_udp_src_port - rtnl_flower_set_udp_dst_port - rtnl_flower_get_udp_src_port - rtnl_flower_get_udp_dst_port
1 parent c71f865 commit 0889a27

File tree

4 files changed

+426
-0
lines changed

4 files changed

+426
-0
lines changed

include/netlink-private/types.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,14 @@ struct rtnl_flower
643643
uint8_t cf_ip_proto;
644644
uint8_t cf_ip_ttl;
645645
uint8_t cf_ip_ttl_mask;
646+
uint16_t cf_src_port_min;
647+
uint16_t cf_src_port_max;
648+
uint16_t cf_dst_port_min;
649+
uint16_t cf_dst_port_max;
650+
uint16_t cf_tcp_src_port;
651+
uint16_t cf_tcp_dst_port;
652+
uint16_t cf_udp_src_port;
653+
uint16_t cf_udp_dst_port;
646654
};
647655

648656
struct rtnl_cgroup

include/netlink/route/cls/flower.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ extern int rtnl_flower_append_action(struct rtnl_cls *, struct rtnl_act *);
6060
extern int rtnl_flower_del_action(struct rtnl_cls *, struct rtnl_act *);
6161
extern struct rtnl_act* rtnl_flower_get_action(struct rtnl_cls *);
6262

63+
extern int rtnl_flower_set_src_port_range(struct rtnl_cls *cls, uint16_t min, uint16_t max);
64+
extern int rtnl_flower_get_src_port_range(struct rtnl_cls *cls, uint16_t *min, uint16_t *max);
65+
extern int rtnl_flower_set_dst_port_range(struct rtnl_cls *cls, uint16_t min, uint16_t max);
66+
extern int rtnl_flower_get_dst_port_range(struct rtnl_cls *cls, uint16_t *min, uint16_t *max);
67+
68+
extern int rtnl_flower_set_tcp_src_port(struct rtnl_cls *cls, uint16_t port);
69+
extern int rtnl_flower_set_tcp_dst_port(struct rtnl_cls *cls, uint16_t port);
70+
extern int rtnl_flower_get_tcp_src_port(struct rtnl_cls *cls, uint16_t *port);
71+
extern int rtnl_flower_get_tcp_dst_port(struct rtnl_cls *cls, uint16_t *port);
72+
73+
extern int rtnl_flower_set_udp_src_port(struct rtnl_cls *cls, uint16_t port);
74+
extern int rtnl_flower_set_udp_dst_port(struct rtnl_cls *cls, uint16_t port);
75+
extern int rtnl_flower_get_udp_src_port(struct rtnl_cls *cls, uint16_t *port);
76+
extern int rtnl_flower_get_udp_dst_port(struct rtnl_cls *cls, uint16_t *port);
77+
6378
#ifdef __cplusplus
6479
}
6580
#endif

0 commit comments

Comments
 (0)