Skip to content

Commit 7e19cc5

Browse files
committed
net-condition: move net_match_config() and related conf parsers
1 parent 1929ed0 commit 7e19cc5

File tree

13 files changed

+458
-442
lines changed

13 files changed

+458
-442
lines changed

src/libsystemd-network/network-internal.c

Lines changed: 0 additions & 396 deletions
Large diffs are not rendered by default.

src/libsystemd-network/network-internal.h

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,12 @@
11
/* SPDX-License-Identifier: LGPL-2.1+ */
22
#pragma once
33

4-
#include <linux/nl80211.h>
54
#include <stdbool.h>
5+
#include <stdio.h>
66

77
#include "sd-device.h"
88
#include "sd-dhcp-lease.h"
99

10-
#include "conf-parser.h"
11-
#include "set.h"
12-
#include "strv.h"
13-
14-
bool net_match_config(Set *match_mac,
15-
Set *match_permanent_mac,
16-
char * const *match_paths,
17-
char * const *match_drivers,
18-
char * const *match_iftypes,
19-
char * const *match_names,
20-
char * const *match_property,
21-
char * const *match_wifi_iftype,
22-
char * const *match_ssid,
23-
Set *match_bssid,
24-
sd_device *device,
25-
const struct ether_addr *dev_mac,
26-
const struct ether_addr *dev_permanent_mac,
27-
const char *dev_driver,
28-
unsigned short dev_iftype,
29-
const char *dev_name,
30-
char * const *alternative_names,
31-
enum nl80211_iftype dev_wifi_iftype,
32-
const char *dev_ssid,
33-
const struct ether_addr *dev_bssid);
34-
35-
CONFIG_PARSER_PROTOTYPE(config_parse_net_condition);
36-
CONFIG_PARSER_PROTOTYPE(config_parse_match_strv);
37-
CONFIG_PARSER_PROTOTYPE(config_parse_match_ifnames);
38-
CONFIG_PARSER_PROTOTYPE(config_parse_match_property);
39-
4010
int net_get_unique_predictable_data(sd_device *device, bool use_sysname, uint64_t *result);
4111
const char *net_get_name_persistent(sd_device *device);
4212

src/libsystemd-network/sd-dhcp6-client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "random-util.h"
2626
#include "socket-util.h"
2727
#include "string-table.h"
28+
#include "strv.h"
2829
#include "util.h"
2930
#include "web-util.h"
3031

src/network/netdev/netdev-gperf.gperf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
77
#include "bond.h"
88
#include "bridge.h"
99
#include "conf-parser.h"
10+
#include "fou-tunnel.h"
1011
#include "geneve.h"
1112
#include "ipvlan.h"
13+
#include "l2tp-tunnel.h"
1214
#include "macsec.h"
1315
#include "macvlan.h"
16+
#include "net-condition.h"
17+
#include "netdev.h"
1418
#include "tunnel.h"
1519
#include "tuntap.h"
1620
#include "veth.h"
1721
#include "vlan-util.h"
1822
#include "vlan.h"
19-
#include "vxlan.h"
2023
#include "vrf.h"
21-
#include "netdev.h"
22-
#include "network-internal.h"
2324
#include "vxcan.h"
25+
#include "vxlan.h"
2426
#include "wireguard.h"
25-
#include "fou-tunnel.h"
26-
#include "l2tp-tunnel.h"
2727
#include "xfrm.h"
2828
%}
2929
struct ConfigPerfItem;

src/network/networkd-dhcp4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "networkd-manager.h"
1818
#include "networkd-network.h"
1919
#include "string-table.h"
20-
#include "string-util.h"
20+
#include "strv.h"
2121
#include "sysctl-util.h"
2222
#include "web-util.h"
2323

src/network/networkd-network-gperf.gperf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
55
#include <stddef.h>
66
#include "conf-parser.h"
77
#include "netem.h"
8-
#include "network-internal.h"
8+
#include "net-condition.h"
99
#include "networkd-address-label.h"
1010
#include "networkd-address.h"
1111
#include "networkd-can.h"

src/network/networkd-network.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
#include "fd-util.h"
1313
#include "hostname-util.h"
1414
#include "in-addr-util.h"
15-
#include "networkd-dhcp-server.h"
16-
#include "network-internal.h"
15+
#include "net-condition.h"
1716
#include "networkd-address-label.h"
1817
#include "networkd-address.h"
1918
#include "networkd-dhcp-common.h"
19+
#include "networkd-dhcp-server.h"
2020
#include "networkd-fdb.h"
2121
#include "networkd-manager.h"
2222
#include "networkd-mdb.h"

src/network/test-networkd-conf.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
/* SPDX-License-Identifier: LGPL-2.1+ */
22

3-
#include "ether-addr-util.h"
43
#include "hexdecoct.h"
54
#include "log.h"
65
#include "macro.h"
7-
#include "set.h"
8-
#include "string-util.h"
9-
10-
#include "network-internal.h"
6+
#include "net-condition.h"
117
#include "networkd-conf.h"
128
#include "networkd-network.h"
9+
#include "strv.h"
1310

1411
static void test_config_parse_duid_type_one(const char *rvalue, int ret, DUIDType expected, usec_t expected_time) {
1512
DUID actual = {};

src/shared/meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ shared_sources = files('''
169169
module-util.h
170170
mount-util.c
171171
mount-util.h
172+
net-condition.c
173+
net-condition.h
172174
netif-naming-scheme.c
173175
netif-naming-scheme.h
174176
nscd-flush.c

0 commit comments

Comments
 (0)