libnl
3.2.24-rc1
|
Macros | |
#define | RULE_ATTR_FLAGS 0x0008 |
#define | RULE_ATTR_FLAGS 0x0008 |
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... | |
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.
sock | Netlink socket. |
family | Address family or AF_UNSPEC. |
result | Pointer to store resulting cache. |
Allocates a new rule cache, initializes it properly and updates it to include all rules currently configured in the kernel.
Definition at line 331 of file rule.c.
References nl_cache_alloc(), and nl_cache_refill().
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.
tmpl | template with data of new rule |
flags | additional netlink message flags |
result | Result pointer |
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.
Definition at line 440 of file rule.c.
Referenced by rtnl_rule_add().
int rtnl_rule_add | ( | struct nl_sock * | sk, |
struct rtnl_rule * | tmpl, | ||
int | flags | ||
) |
Add a new rule.
sk | Netlink socket. |
tmpl | template with requested changes |
flags | additional netlink message flags |
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.
Definition at line 459 of file rule.c.
References nl_send_auto_complete(), nlmsg_free(), and rtnl_rule_build_add_request().
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.
rule | rule to delete |
flags | additional netlink message flags |
result | Result pointer |
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.
Definition at line 496 of file rule.c.
Referenced by rtnl_rule_delete().
int rtnl_rule_delete | ( | struct nl_sock * | sk, |
struct rtnl_rule * | rule, | ||
int | flags | ||
) |
Delete a rule.
sk | Netlink socket. |
rule | rule to delete |
flags | additional netlink message flags |
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.
Definition at line 514 of file rule.c.
References nl_send_auto_complete(), nlmsg_free(), and rtnl_rule_build_delete_request().