diff options
author | Tom Gundersen <teg@jklm.no> | 2015-02-10 18:30:16 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-02-10 22:30:35 +0100 |
commit | 5256e00e8b9015dd1a976d647fc71dc7efbd8cf8 (patch) | |
tree | 371a378a004c556cc4d59122dea969a4148d843c /src/network | |
parent | ea6ec096db5f9f3562b9bbf438da7fe21411c74d (diff) |
net: support globbing and disjunction in Match logic
Match{Name,OrginalName,Type,Driver,Path} can now take a space-separated glob of matches.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-network-bus.c | 8 | ||||
-rw-r--r-- | src/network/networkd-network-gperf.gperf | 8 | ||||
-rw-r--r-- | src/network/networkd-network.c | 8 | ||||
-rw-r--r-- | src/network/networkd.h | 8 |
4 files changed, 16 insertions, 16 deletions
diff --git a/src/network/networkd-network-bus.c b/src/network/networkd-network-bus.c index f1b58b322..36b40d32b 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 1731e0422..9f6e65f98 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 3ebd4d7d5..c90f730f1 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 691d60302..fdd0684fc 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; |