Routing Rule Object Allocation/Freeage | |
| rtnl_rule * | rtnl_rule_alloc (void) |
| Allocate a new rule object. | |
| void | rtnl_rule_put (struct rtnl_rule *rule) |
| Give back reference on routing rule object. | |
| void | rtnl_rule_free (struct rtnl_rule *rule) |
| Free routing rule object. | |
Routing Rule Cache Management | |
| nl_cache * | rtnl_rule_alloc_cache_by_family (struct nl_handle *handle, int family) |
| Build a rule cache including all rules of the specified family currently configured in the kernel. | |
| nl_cache * | rtnl_rule_alloc_cache (struct nl_handle *handle) |
| Build a rule cache including all rules currently configured in the kernel. | |
Rule Addition | |
| nl_msg * | rtnl_rule_build_add_request (struct rtnl_rule *tmpl, int flags) |
| Build netlink request message to add a new rule. | |
| int | rtnl_rule_add (struct nl_handle *handle, struct rtnl_rule *tmpl, int flags) |
| Add a new rule. | |
Rule Deletion | |
| nl_msg * | rtnl_rule_build_delete_request (struct rtnl_rule *rule, int flags) |
| Build a netlink request message to delete a rule. | |
| int | rtnl_rule_delete (struct nl_handle *handle, struct rtnl_rule *rule, int flags) |
| Delete a rule. | |
Attribute Modification | |
| void | rtnl_rule_set_family (struct rtnl_rule *rule, int family) |
| Set the address family of a rule to the specified value. | |
| int | rtnl_rule_get_family (struct rtnl_rule *rule) |
| Get the address family of a rule. | |
| void | rtnl_rule_set_prio (struct rtnl_rule *rule, int prio) |
| Set the priority of a rule to the specified value. | |
| int | rtnl_rule_get_prio (struct rtnl_rule *rule) |
| Get the priority of a rule. | |
| void | rtnl_rule_set_fwmark (struct rtnl_rule *rule, uint64_t fwmark) |
| Set the firewall mark of a rule to the specified value. | |
| uint64_t | rtnl_rule_get_fwmark (struct rtnl_rule *rule) |
| Get the firewall mark of a rule. | |
| void | rtnl_rule_set_table (struct rtnl_rule *rule, int table) |
| Set the table index of a rule to the specified value. | |
| int | rtnl_rule_get_table (struct rtnl_rule *rule) |
| Get the table index of a rule. | |
| void | rtnl_rule_set_dsfield (struct rtnl_rule *rule, int dsfield) |
| Set the dsfield of a rule to the specified value. | |
| int | rtnl_rule_get_dsfield (struct rtnl_rule *rule) |
| Get the dsfield of a rule. | |
| void | rtnl_rule_set_src_len (struct rtnl_rule *rule, int len) |
| Set the source address prefix length of a rule to the specified value. | |
| int | rtnl_rule_get_src_len (struct rtnl_rule *rule) |
| Get the source address prefix length of a rule. | |
| void | rtnl_rule_set_dst_len (struct rtnl_rule *rule, int len) |
| Set the destination address prefix length of a rule to the specified value. | |
| int | rtnl_rule_get_dst_len (struct rtnl_rule *rule) |
| Get the destination address prefix length of a rule. | |
| int | rtnl_rule_set_src (struct rtnl_rule *rule, struct nl_addr *src) |
| Set the source address of a rule. | |
| nl_addr * | rtnl_rule_get_src (struct rtnl_rule *rule) |
| Get the source address of a rule. | |
| int | rtnl_rule_set_dst (struct rtnl_rule *rule, struct nl_addr *dst) |
| Set the destination address of a rule. | |
| nl_addr * | rtnl_rule_get_dst (struct rtnl_rule *rule) |
| Get the destination address of a rule. | |
| int | rtnl_rule_set_iif (struct rtnl_rule *rule, const char *dev) |
| Set incoming interface of routing rule object. | |
| char * | rtnl_rule_get_iif (struct rtnl_rule *rule) |
| Get incoming interface of routing rule object. | |
| void | rtnl_rule_set_action (struct rtnl_rule *rule, int type) |
| Set action of routing rule object. | |
| int | rtnl_rule_get_action (struct rtnl_rule *rule) |
| Get action of routing rule object. | |
| void | rtnl_rule_set_realms (struct rtnl_rule *rule, realm_t realms) |
| Set realms of routing rule object. | |
| realm_t | rtnl_rule_get_realms (struct rtnl_rule *rule) |
| Get realms of routing rule object. | |
| struct rtnl_rule* rtnl_rule_alloc | ( | void | ) |
Allocate a new rule object.
Definition at line 387 of file rule.c.
References nl_object_alloc_from_ops().
| void rtnl_rule_put | ( | struct rtnl_rule * | rule | ) |
Give back reference on routing rule object.
| rule | Routing rule object to be given back. |
Definition at line 399 of file rule.c.
References nl_object_put().
| void rtnl_rule_free | ( | struct rtnl_rule * | rule | ) |
Free routing rule object.
| rule | Routing rule object to be freed. |
Definition at line 410 of file rule.c.
References nl_object_free().
| struct nl_cache* rtnl_rule_alloc_cache_by_family | ( | struct nl_handle * | handle, | |
| int | family | |||
| ) |
Build a rule cache including all rules of the specified family currently configured in the kernel.
| handle | netlink handle | |
| family | address family |
Definition at line 435 of file rule.c.
References nl_cache_alloc_from_ops(), and nl_cache_update().
Referenced by rtnl_rule_alloc_cache().
| struct nl_cache* rtnl_rule_alloc_cache | ( | struct nl_handle * | handle | ) |
Build a rule cache including all rules currently configured in the kernel.
| handle | netlink handle |
Definition at line 464 of file rule.c.
References rtnl_rule_alloc_cache_by_family().
| struct nl_msg* rtnl_rule_build_add_request | ( | struct rtnl_rule * | tmpl, | |
| int | flags | |||
| ) |
Build netlink request message to add a new rule.
| tmpl | template with data of new rule | |
| flags | additional netlink message flags |
rtnl_rule_set_* functions.
Definition at line 549 of file rule.c.
References NLM_F_CREATE.
Referenced by rtnl_rule_add().
| int rtnl_rule_add | ( | struct nl_handle * | handle, | |
| struct rtnl_rule * | tmpl, | |||
| int | flags | |||
| ) |
Add a new rule.
| handle | netlink handle | |
| tmpl | template with requested changes | |
| flags | additional netlink message flags |
Definition at line 566 of file rule.c.
References nl_send_auto_complete(), nl_wait_for_ack(), nlmsg_free(), and rtnl_rule_build_add_request().
| struct nl_msg* rtnl_rule_build_delete_request | ( | struct rtnl_rule * | rule, | |
| int | flags | |||
| ) |
Build a netlink request message to delete a rule.
| rule | rule to delete | |
| flags | additional netlink message flags |
Definition at line 603 of file rule.c.
Referenced by rtnl_rule_delete().
| int rtnl_rule_delete | ( | struct nl_handle * | handle, | |
| struct rtnl_rule * | rule, | |||
| int | flags | |||
| ) |
Delete a rule.
| handle | netlink handle | |
| rule | rule to delete | |
| flags | additional netlink message flags |
Definition at line 620 of file rule.c.
References nl_send_auto_complete(), nl_wait_for_ack(), nlmsg_free(), and rtnl_rule_build_delete_request().
| void rtnl_rule_set_family | ( | struct rtnl_rule * | rule, | |
| int | family | |||
| ) |
| int rtnl_rule_get_family | ( | struct rtnl_rule * | rule | ) |
| void rtnl_rule_set_prio | ( | struct rtnl_rule * | rule, | |
| int | prio | |||
| ) |
| int rtnl_rule_get_prio | ( | struct rtnl_rule * | rule | ) |
| void rtnl_rule_set_fwmark | ( | struct rtnl_rule * | rule, | |
| uint64_t | fwmark | |||
| ) |
| uint64_t rtnl_rule_get_fwmark | ( | struct rtnl_rule * | rule | ) |
| void rtnl_rule_set_table | ( | struct rtnl_rule * | rule, | |
| int | table | |||
| ) |
| int rtnl_rule_get_table | ( | struct rtnl_rule * | rule | ) |
| void rtnl_rule_set_dsfield | ( | struct rtnl_rule * | rule, | |
| int | dsfield | |||
| ) |
| int rtnl_rule_get_dsfield | ( | struct rtnl_rule * | rule | ) |
| void rtnl_rule_set_src_len | ( | struct rtnl_rule * | rule, | |
| int | len | |||
| ) |
Set the source address prefix length of a rule to the specified value.
| rule | rule to change | |
| len | new source address length |
Definition at line 770 of file rule.c.
References nl_addr_set_prefixlen().
| int rtnl_rule_get_src_len | ( | struct rtnl_rule * | rule | ) |
| void rtnl_rule_set_dst_len | ( | struct rtnl_rule * | rule, | |
| int | len | |||
| ) |
Set the destination address prefix length of a rule to the specified value.
| rule | rule to change | |
| len | new destination address length |
Definition at line 796 of file rule.c.
References nl_addr_set_prefixlen().
| int rtnl_rule_get_dst_len | ( | struct rtnl_rule * | rule | ) |
| int rtnl_rule_set_src | ( | struct rtnl_rule * | rule, | |
| struct nl_addr * | src | |||
| ) |
Set the source address of a rule.
| rule | rule to change | |
| src | new source address |
| struct nl_addr* rtnl_rule_get_src | ( | struct rtnl_rule * | rule | ) |
| int rtnl_rule_set_dst | ( | struct rtnl_rule * | rule, | |
| struct nl_addr * | dst | |||
| ) |
Set the destination address of a rule.
| rule | rule to change | |
| dst | new destination address |
| struct nl_addr* rtnl_rule_get_dst | ( | struct rtnl_rule * | rule | ) |
| int rtnl_rule_set_iif | ( | struct rtnl_rule * | rule, | |
| const char * | dev | |||
| ) |
| char* rtnl_rule_get_iif | ( | struct rtnl_rule * | rule | ) |
| void rtnl_rule_set_action | ( | struct rtnl_rule * | rule, | |
| int | type | |||
| ) |
| int rtnl_rule_get_action | ( | struct rtnl_rule * | rule | ) |
| void rtnl_rule_set_realms | ( | struct rtnl_rule * | rule, | |
| realm_t | realms | |||
| ) |
| realm_t rtnl_rule_get_realms | ( | struct rtnl_rule * | rule | ) |
1.5.1