Allocation/Freeing | |
struct rtnl_rule * | rtnl_rule_alloc (void) |
void | rtnl_rule_put (struct rtnl_rule *rule) |
Cache Management | |
int | rtnl_rule_alloc_cache (struct nl_sock *sock, int family, struct nl_cache **result) |
Build a rule cache including all rules currently configured in the kernel. More... | |
Rule Addition | |
int | rtnl_rule_build_add_request (struct rtnl_rule *tmpl, int flags, struct nl_msg **result) |
Build netlink request message to add a new rule. More... | |
int | rtnl_rule_add (struct nl_sock *sk, struct rtnl_rule *tmpl, int flags) |
Add a new rule. More... | |
Rule Deletion | |
int | rtnl_rule_build_delete_request (struct rtnl_rule *rule, int flags, struct nl_msg **result) |
Build a netlink request message to delete a rule. More... | |
int | rtnl_rule_delete (struct nl_sock *sk, struct rtnl_rule *rule, int flags) |
Delete a rule. More... | |
Add a new rule.
Builds a netlink message by calling rtnl_rule_build_add_request(), sends the request to the kernel and waits for the next ACK to be received and thus blocks until the request has been fullfilled.
References nl_send_auto_complete(), nlmsg_free(), and rtnl_rule_build_add_request().
References nl_object_alloc().
Referenced by nl_cli_rule_alloc().
Build a rule cache including all rules currently configured in the kernel.
Allocates a new rule cache, initializes it properly and updates it to include all rules currently configured in the kernel.
References nl_cache::c_iarg1, nl_cache_alloc(), nl_cache_refill(), and NLE_NOMEM.
Referenced by nl_cli_rule_alloc_cache().
Build netlink request message to add a new rule.
Builds a new netlink message requesting a addition of a new rule. The netlink message header isn't fully equipped with all relevant fields and must thus be sent out via nl_send_auto_complete() or supplemented as needed. tmpl must contain the attributes of the new address set via rtnl_rule_set_*
functions.
References NLM_F_CREATE, and RTM_NEWRULE.
Referenced by rtnl_rule_add().
Build a netlink request message to delete a rule.
Builds a new netlink message requesting a deletion of a rule. The netlink message header isn't fully equipped with all relevant fields and must thus be sent out via nl_send_auto_complete() or supplemented as needed. rule must point to an existing address.
References RTM_DELRULE.
Referenced by rtnl_rule_delete().
Delete a rule.
Builds a netlink message by calling rtnl_rule_build_delete_request(), sends the request to the kernel and waits for the next ACK to be received and thus blocks until the request has been fullfilled.
References nl_send_auto_complete(), nlmsg_free(), and rtnl_rule_build_delete_request().
References NLE_NOATTR, and rtnl_rule::r_type.
References rtnl_rule::r_dsfield.
References rtnl_rule::r_dst_len.
References rtnl_rule::r_family.
References NULL, and rtnl_rule::r_iif.
References rtnl_rule::r_mark.
References rtnl_rule::r_prio.
References rtnl_rule::r_realms.
References rtnl_rule::r_src_len.
References rtnl_rule::r_table.
References rtnl_rule::r_type, and type.
References rtnl_rule::r_dsfield.
References rtnl_rule::r_dst, and rtnl_rule::r_dst_len.
References len, nl_addr_set_prefixlen(), rtnl_rule::r_dst, and rtnl_rule::r_dst_len.
References rtnl_rule::r_family.
Referenced by nl_cli_rule_parse_family().
References IFNAMSIZ, NLE_RANGE, and rtnl_rule::r_iif.
References mark, and rtnl_rule::r_mark.
References rtnl_rule::r_prio.
References rtnl_rule::r_realms.
References rtnl_rule::r_src, and rtnl_rule::r_src_len.
References len, nl_addr_set_prefixlen(), rtnl_rule::r_src, and rtnl_rule::r_src_len.
References rtnl_rule::r_table.