#include "socket-util.h"
#include "string-table.h"
#include "strv.h"
+#include "wifi-util.h"
void net_match_clear(NetMatch *match) {
if (!match)
return true;
}
-static const char *const wifi_iftype_table[NL80211_IFTYPE_MAX+1] = {
- [NL80211_IFTYPE_ADHOC] = "ad-hoc",
- [NL80211_IFTYPE_STATION] = "station",
- [NL80211_IFTYPE_AP] = "ap",
- [NL80211_IFTYPE_AP_VLAN] = "ap-vlan",
- [NL80211_IFTYPE_WDS] = "wds",
- [NL80211_IFTYPE_MONITOR] = "monitor",
- [NL80211_IFTYPE_MESH_POINT] = "mesh-point",
- [NL80211_IFTYPE_P2P_CLIENT] = "p2p-client",
- [NL80211_IFTYPE_P2P_GO] = "p2p-go",
- [NL80211_IFTYPE_P2P_DEVICE] = "p2p-device",
- [NL80211_IFTYPE_OCB] = "ocb",
- [NL80211_IFTYPE_NAN] = "nan",
-};
-
-DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(wifi_iftype, enum nl80211_iftype);
-
int net_match_config(
const NetMatch *match,
sd_device *device,
if (!net_condition_test_property(match->property, device))
return false;
- if (!net_condition_test_strv(match->wifi_iftype, wifi_iftype_to_string(wifi_iftype)))
+ if (!net_condition_test_strv(match->wifi_iftype, nl80211_iftype_to_string(wifi_iftype)))
return false;
if (!net_condition_test_strv(match->ssid, ssid))
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "log.h"
+#include "string-table.h"
#include "string-util.h"
#include "wifi-util.h"
*ret_bssid = ETHER_ADDR_NULL;
return 0;
}
+
+static const char * const nl80211_iftype_table[NUM_NL80211_IFTYPES] = {
+ [NL80211_IFTYPE_ADHOC] = "ad-hoc",
+ [NL80211_IFTYPE_STATION] = "station",
+ [NL80211_IFTYPE_AP] = "ap",
+ [NL80211_IFTYPE_AP_VLAN] = "ap-vlan",
+ [NL80211_IFTYPE_WDS] = "wds",
+ [NL80211_IFTYPE_MONITOR] = "monitor",
+ [NL80211_IFTYPE_MESH_POINT] = "mesh-point",
+ [NL80211_IFTYPE_P2P_CLIENT] = "p2p-client",
+ [NL80211_IFTYPE_P2P_GO] = "p2p-go",
+ [NL80211_IFTYPE_P2P_DEVICE] = "p2p-device",
+ [NL80211_IFTYPE_OCB] = "ocb",
+ [NL80211_IFTYPE_NAN] = "nan",
+};
+
+DEFINE_STRING_TABLE_LOOKUP_TO_STRING(nl80211_iftype, enum nl80211_iftype);
int wifi_get_interface(sd_netlink *genl, int ifindex, enum nl80211_iftype *ret_iftype, char **ret_ssid);
int wifi_get_station(sd_netlink *genl, int ifindex, struct ether_addr *ret_bssid);
+
+const char *nl80211_iftype_to_string(enum nl80211_iftype iftype) _const_;