1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3 
4 #include <linux/nl80211.h>
5 #include <stdbool.h>
6 
7 #include "sd-device.h"
8 
9 #include "conf-parser.h"
10 #include "ether-addr-util.h"
11 #include "set.h"
12 
13 typedef struct NetMatch {
14         Set *hw_addr;
15         Set *permanent_hw_addr;
16         char **path;
17         char **driver;
18         char **iftype; /* udev's DEVTYPE field or ARPHRD_XXX, e.g. ether, wlan. */
19         char **kind;   /* IFLA_INFO_KIND attribute, e.g. gre, gretap, erspan. */
20         char **ifname;
21         char **property;
22         char **wlan_iftype;
23         char **ssid;
24         Set *bssid;
25 } NetMatch;
26 
27 void net_match_clear(NetMatch *match);
28 bool net_match_is_empty(const NetMatch *match);
29 
30 int net_match_config(
31                 const NetMatch *match,
32                 sd_device *device,
33                 const struct hw_addr_data *hw_addr,
34                 const struct hw_addr_data *permanent_hw_addr,
35                 const char *driver,
36                 unsigned short iftype,
37                 const char *kind,
38                 const char *ifname,
39                 char * const *alternative_names,
40                 enum nl80211_iftype wlan_iftype,
41                 const char *ssid,
42                 const struct ether_addr *bssid);
43 
44 CONFIG_PARSER_PROTOTYPE(config_parse_net_condition);
45 CONFIG_PARSER_PROTOTYPE(config_parse_match_strv);
46 CONFIG_PARSER_PROTOTYPE(config_parse_match_ifnames);
47 CONFIG_PARSER_PROTOTYPE(config_parse_match_property);
48