diff options
Diffstat (limited to 'src/network/networkd-routing-policy-rule.h')
-rw-r--r-- | src/network/networkd-routing-policy-rule.h | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/network/networkd-routing-policy-rule.h b/src/network/networkd-routing-policy-rule.h index f4a0d5138f..b35126e2cf 100644 --- a/src/network/networkd-routing-policy-rule.h +++ b/src/network/networkd-routing-policy-rule.h @@ -1,12 +1,13 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once - #include <inttypes.h> +#include <linux/fib_rules.h> #include <stdbool.h> #include "in-addr-util.h" #include "conf-parser.h" +#include "missing_fib_rules.h" typedef struct RoutingPolicyRule RoutingPolicyRule; @@ -24,7 +25,10 @@ struct RoutingPolicyRule { Link *link; NetworkConfigSection *section; + bool invert_rule; + uint8_t tos; + uint8_t protocol; uint32_t table; uint32_t fwmark; @@ -41,6 +45,9 @@ struct RoutingPolicyRule { union in_addr_union to; union in_addr_union from; + struct fib_rule_port_range sport; + struct fib_rule_port_range dport; + LIST_FIELDS(RoutingPolicyRule, rules); }; @@ -49,17 +56,18 @@ void routing_policy_rule_free(RoutingPolicyRule *rule); DEFINE_TRIVIAL_CLEANUP_FUNC(RoutingPolicyRule*, routing_policy_rule_free); -int routing_policy_rule_configure(RoutingPolicyRule *address, Link *link, sd_netlink_message_handler_t callback, bool update); -int routing_policy_rule_remove(RoutingPolicyRule *routing_policy_rule, Link *link, sd_netlink_message_handler_t callback); -int link_routing_policy_rule_remove_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata); -int link_routing_policy_rule_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata); +int routing_policy_rule_configure(RoutingPolicyRule *address, Link *link, link_netlink_message_handler_t callback, bool update); +int routing_policy_rule_remove(RoutingPolicyRule *routing_policy_rule, Link *link, link_netlink_message_handler_t callback); int routing_policy_rule_add(Manager *m, int family, const union in_addr_union *from, uint8_t from_prefixlen, const union in_addr_union *to, uint8_t to_prefixlen, - uint8_t tos, uint32_t fwmark, uint32_t table, char *iif, char *oif, RoutingPolicyRule **ret); + uint8_t tos, uint32_t fwmark, uint32_t table, const char *iif, const char *oif, uint8_t protocol, const struct fib_rule_port_range *sport, + const struct fib_rule_port_range *dport, RoutingPolicyRule **ret); int routing_policy_rule_add_foreign(Manager *m, int family, const union in_addr_union *from, uint8_t from_prefixlen, const union in_addr_union *to, uint8_t to_prefixlen, - uint8_t tos, uint32_t fwmark, uint32_t table, char *iif, char *oif, RoutingPolicyRule **ret); + uint8_t tos, uint32_t fwmark, uint32_t table, const char *iif, const char *oif, uint8_t protocol, const struct fib_rule_port_range *sport, + const struct fib_rule_port_range *dport, RoutingPolicyRule **ret); int routing_policy_rule_get(Manager *m, int family, const union in_addr_union *from, uint8_t from_prefixlen, const union in_addr_union *to, uint8_t to_prefixlen, uint8_t tos, - uint32_t fwmark, uint32_t table, char *iif, char *oif, RoutingPolicyRule **ret); + uint32_t fwmark, uint32_t table, const char *iif, const char *oif, uint8_t protocol, struct fib_rule_port_range *sport, + struct fib_rule_port_range *dport, RoutingPolicyRule **ret); int routing_policy_rule_make_local(Manager *m, RoutingPolicyRule *rule); int routing_policy_serialize_rules(Set *rules, FILE *f); int routing_policy_load_rules(const char *state_file, Set **rules); @@ -71,3 +79,6 @@ CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_fwmark_mask); CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_prefix); CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_priority); CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_device); +CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_port_range); +CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_ip_protocol); +CONFIG_PARSER_PROTOTYPE(config_parse_routing_policy_rule_invert); |