9#include <netlink/netlink.h>
10#include <netlink/cache.h>
11#include <netlink/addr.h>
12#include <netlink/route/route.h>
13#include <linux/fib_rules.h>
22extern struct rtnl_rule * rtnl_rule_alloc(
void);
23extern void rtnl_rule_put(
struct rtnl_rule *);
27extern void rtnl_rule_dump(
struct rtnl_rule *, FILE *,
struct nl_dump_params *);
31extern int rtnl_rule_add(
struct nl_sock *,
struct rtnl_rule *,
int);
38extern void rtnl_rule_set_family(
struct rtnl_rule *,
int);
39extern int rtnl_rule_get_family(
struct rtnl_rule *);
40extern void rtnl_rule_set_prio(
struct rtnl_rule *, uint32_t);
41extern uint32_t rtnl_rule_get_prio(
struct rtnl_rule *);
42extern void rtnl_rule_set_mark(
struct rtnl_rule *, uint32_t);
43extern uint32_t rtnl_rule_get_mark(
struct rtnl_rule *);
44extern void rtnl_rule_set_mask(
struct rtnl_rule *, uint32_t);
45extern uint32_t rtnl_rule_get_mask(
struct rtnl_rule *);
46extern void rtnl_rule_set_table(
struct rtnl_rule *, uint32_t);
47extern uint32_t rtnl_rule_get_table(
struct rtnl_rule *);
48extern void rtnl_rule_set_dsfield(
struct rtnl_rule *, uint8_t);
49extern uint8_t rtnl_rule_get_dsfield(
struct rtnl_rule *);
50extern int rtnl_rule_set_src(
struct rtnl_rule *,
struct nl_addr *);
51extern struct nl_addr * rtnl_rule_get_src(
struct rtnl_rule *);
52extern int rtnl_rule_set_dst(
struct rtnl_rule *,
struct nl_addr *);
53extern struct nl_addr * rtnl_rule_get_dst(
struct rtnl_rule *);
54extern void rtnl_rule_set_action(
struct rtnl_rule *, uint8_t);
55extern uint8_t rtnl_rule_get_action(
struct rtnl_rule *);
56extern int rtnl_rule_set_iif(
struct rtnl_rule *,
const char *);
57extern char * rtnl_rule_get_iif(
struct rtnl_rule *);
58extern int rtnl_rule_set_oif(
struct rtnl_rule *,
const char *);
59extern char * rtnl_rule_get_oif(
struct rtnl_rule *);
60extern void rtnl_rule_set_realms(
struct rtnl_rule *, uint32_t);
61extern uint32_t rtnl_rule_get_realms(
struct rtnl_rule *);
62extern void rtnl_rule_set_goto(
struct rtnl_rule *, uint32_t);
63extern uint32_t rtnl_rule_get_goto(
struct rtnl_rule *);
66extern int rtnl_rule_set_protocol(
struct rtnl_rule *, uint8_t);
67extern int rtnl_rule_get_protocol(
struct rtnl_rule *, uint8_t *);
68extern int rtnl_rule_set_ipproto(
struct rtnl_rule *, uint8_t);
69extern int rtnl_rule_get_ipproto(
struct rtnl_rule *, uint8_t *);
70extern int rtnl_rule_set_sport(
struct rtnl_rule *, uint16_t start);
71extern int rtnl_rule_set_sport_range(
struct rtnl_rule *,
74extern int rtnl_rule_get_sport(
struct rtnl_rule *, uint16_t *start,
76extern int rtnl_rule_set_dport(
struct rtnl_rule *, uint16_t start);
77extern int rtnl_rule_set_dport_range(
struct rtnl_rule *,
80extern int rtnl_rule_get_dport(
struct rtnl_rule *, uint16_t *start,
int rtnl_rule_delete(struct nl_sock *, struct rtnl_rule *, int)
Delete a rule.
int rtnl_rule_build_delete_request(struct rtnl_rule *, int, struct nl_msg **)
Build a netlink request message to delete a rule.
int rtnl_rule_alloc_cache(struct nl_sock *, int, struct nl_cache **)
Build a rule cache including all rules currently configured in the kernel.
int rtnl_rule_get_l3mdev(struct rtnl_rule *)
Get l3mdev value of the rule (FRA_L3MDEV)
void rtnl_rule_set_l3mdev(struct rtnl_rule *, int)
Set l3mdev value of the rule (FRA_L3MDEV)
int rtnl_rule_build_add_request(struct rtnl_rule *, int, struct nl_msg **)
Build netlink request message to add a new rule.
int rtnl_rule_add(struct nl_sock *, struct rtnl_rule *, int)
Add a new rule.