From 5256e00e8b9015dd1a976d647fc71dc7efbd8cf8 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 10 Feb 2015 18:30:16 +0100 Subject: net: support globbing and disjunction in Match logic Match{Name,OrginalName,Type,Driver,Path} can now take a space-separated glob of matches. --- src/network/networkd-network-bus.c | 8 ++++---- src/network/networkd-network-gperf.gperf | 8 ++++---- src/network/networkd-network.c | 8 ++++---- src/network/networkd.h | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/network') diff --git a/src/network/networkd-network-bus.c b/src/network/networkd-network-bus.c index f1b58b322f..36b40d32b9 100644 --- a/src/network/networkd-network-bus.c +++ b/src/network/networkd-network-bus.c @@ -68,10 +68,10 @@ const sd_bus_vtable network_vtable[] = { SD_BUS_PROPERTY("Description", "s", NULL, offsetof(Network, description), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("SourcePath", "s", NULL, offsetof(Network, filename), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("MatchMAC", "as", property_get_ether_addrs, offsetof(Network, match_mac), SD_BUS_VTABLE_PROPERTY_CONST), - SD_BUS_PROPERTY("MatchPath", "s", NULL, offsetof(Network, match_path), SD_BUS_VTABLE_PROPERTY_CONST), - SD_BUS_PROPERTY("MatchDriver", "s", NULL, offsetof(Network, match_driver), SD_BUS_VTABLE_PROPERTY_CONST), - SD_BUS_PROPERTY("MatchType", "s", NULL, offsetof(Network, match_type), SD_BUS_VTABLE_PROPERTY_CONST), - SD_BUS_PROPERTY("MatchName", "s", NULL, offsetof(Network, match_name), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("MatchPath", "as", NULL, offsetof(Network, match_path), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("MatchDriver", "as", NULL, offsetof(Network, match_driver), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("MatchType", "as", NULL, offsetof(Network, match_type), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("MatchName", "as", NULL, offsetof(Network, match_name), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_VTABLE_END }; diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 1731e04228..9f6e65f98e 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -16,10 +16,10 @@ struct ConfigPerfItem; %includes %% Match.MACAddress, config_parse_hwaddr, 0, offsetof(Network, match_mac) -Match.Path, config_parse_string, 0, offsetof(Network, match_path) -Match.Driver, config_parse_string, 0, offsetof(Network, match_driver) -Match.Type, config_parse_string, 0, offsetof(Network, match_type) -Match.Name, config_parse_ifname, 0, offsetof(Network, match_name) +Match.Path, config_parse_strv, 0, offsetof(Network, match_path) +Match.Driver, config_parse_strv, 0, offsetof(Network, match_driver) +Match.Type, config_parse_strv, 0, offsetof(Network, match_type) +Match.Name, config_parse_ifnames, 0, offsetof(Network, match_name) Match.Host, config_parse_net_condition, CONDITION_HOST, offsetof(Network, match_host) Match.Virtualization, config_parse_net_condition, CONDITION_VIRTUALIZATION, offsetof(Network, match_virt) Match.KernelCommandLine, config_parse_net_condition, CONDITION_KERNEL_COMMAND_LINE, offsetof(Network, match_kernel) diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 3ebd4d7d58..c90f730f10 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -196,10 +196,10 @@ void network_free(Network *network) { free(network->filename); free(network->match_mac); - free(network->match_path); - free(network->match_driver); - free(network->match_type); - free(network->match_name); + strv_free(network->match_path); + strv_free(network->match_driver); + strv_free(network->match_type); + strv_free(network->match_name); free(network->description); free(network->dhcp_vendor_class_identifier); diff --git a/src/network/networkd.h b/src/network/networkd.h index 691d603020..fdd0684fca 100644 --- a/src/network/networkd.h +++ b/src/network/networkd.h @@ -100,10 +100,10 @@ struct Network { char *name; struct ether_addr *match_mac; - char *match_path; - char *match_driver; - char *match_type; - char *match_name; + char **match_path; + char **match_driver; + char **match_type; + char **match_name; Condition *match_host; Condition *match_virt; -- cgit v1.2.3-54-g00ecf