Compare commits

..

No commits in common. "1bcefad91907e134a853430f18689b50e39ac5f7" and "a5648b809457d120500b2acb18b31e2168a4817a" have entirely different histories.

44 changed files with 184 additions and 6821 deletions

View File

@ -153,18 +153,6 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>WLANInterfaceType=</varname></term>
<listitem>
<para>A whitespace-separated list of wireless network type. Supported values are
<literal>ad-hoc</literal>, <literal>station</literal>, <literal>ap</literal>,
<literal>ap-vlan</literal>, <literal>wds</literal>, <literal>monitor</literal>,
<literal>mesh-point</literal>, <literal>p2p-client</literal>, <literal>p2p-go</literal>,
<literal>p2p-device</literal>, <literal>ocb</literal>, and <literal>nan</literal>. If the
list is prefixed with a "!", the test is inverted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>SSID=</varname></term>
<listitem>

View File

@ -1,6 +0,0 @@
[Match]
Type=wifi
WLANInterfaceType=ad-hoc
[Network]
LinkLocalAddressing=yes

View File

@ -1,8 +0,0 @@
[Match]
Type=wifi
WLANInterfaceType=ap
[Network]
Address=0.0.0.0/24
DHCPServer=yes
IPMasquerade=yes

View File

@ -1,6 +0,0 @@
[Match]
Type=wifi
WLANInterfaceType=station
[Network]
DHCP=yes

View File

@ -2093,7 +2093,7 @@ int analyze_security(sd_bus *bus, char **units, AnalyzeSecurityFlags flags) {
fflush(stdout);
}
r = unit_name_mangle(*i, 0, &mangled);
r = unit_name_mangle_with_suffix(*i, 0, ".service", &mangled);
if (r < 0)
return log_error_errno(r, "Failed to mangle unit name '%s': %m", *i);

View File

@ -58,8 +58,3 @@
STRV_MAKE(CONF_PATHS(n))
#define HIGH_RLIMIT_MEMLOCK (1024ULL*1024ULL*64ULL)
#define PLYMOUTH_SOCKET { \
.un.sun_family = AF_UNIX, \
.un.sun_path = "\0/org/freedesktop/plymouthd", \
}

View File

@ -162,6 +162,8 @@ basic_sources = files('''
parse-util.h
path-util.c
path-util.h
plymouth-util.c
plymouth-util.h
prioq.c
prioq.h
proc-cmdline.c

View File

@ -0,0 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <unistd.h>
#include "plymouth-util.h"
bool plymouth_running(void) {
return access("/run/plymouth/pid", F_OK) >= 0;
}

11
src/basic/plymouth-util.h Normal file
View File

@ -0,0 +1,11 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <stdbool.h>
#define PLYMOUTH_SOCKET { \
.un.sun_family = AF_UNIX, \
.un.sun_path = "\0/org/freedesktop/plymouthd", \
}
bool plymouth_running(void);

View File

@ -597,10 +597,10 @@ static bool do_escape_mangle(const char *f, bool allow_globs, char *t) {
*
* If @allow_globs, globs characters are preserved. Otherwise, they are escaped.
*/
int unit_name_mangle_with_suffix(const char *name, const char *operation, UnitNameMangle flags, const char *suffix, char **ret) {
int unit_name_mangle_with_suffix(const char *name, UnitNameMangle flags, const char *suffix, char **ret) {
char *s;
int r;
bool mangled, suggest_escape = true;
bool mangled;
assert(name);
assert(suffix);
@ -617,14 +617,10 @@ int unit_name_mangle_with_suffix(const char *name, const char *operation, UnitNa
goto good;
/* Already a fully valid globbing expression? If so, no mangling is necessary either... */
if (string_is_glob(name) && in_charset(name, VALID_CHARS_GLOB)) {
if (flags & UNIT_NAME_MANGLE_GLOB)
goto good;
log_full(flags & UNIT_NAME_MANGLE_WARN ? LOG_NOTICE : LOG_DEBUG,
"Glob pattern passed%s%s, but globs are not supported for this.",
operation ? " " : "", operation ?: "");
suggest_escape = false;
}
if ((flags & UNIT_NAME_MANGLE_GLOB) &&
string_is_glob(name) &&
in_charset(name, VALID_CHARS_GLOB))
goto good;
if (is_device_path(name)) {
r = unit_name_from_path(name, ".device", ret);
@ -649,12 +645,11 @@ int unit_name_mangle_with_suffix(const char *name, const char *operation, UnitNa
mangled = do_escape_mangle(name, flags & UNIT_NAME_MANGLE_GLOB, s);
if (mangled)
log_full(flags & UNIT_NAME_MANGLE_WARN ? LOG_NOTICE : LOG_DEBUG,
"Invalid unit name \"%s\" escaped as \"%s\"%s.",
name, s,
suggest_escape ? " (maybe you should use systemd-escape?)" : "");
"Invalid unit name \"%s\" was escaped as \"%s\" (maybe you should use systemd-escape?)",
name, s);
/* Append a suffix if it doesn't have any, but only if this is not a glob, so that we can allow
* "foo.*" as a valid glob. */
/* Append a suffix if it doesn't have any, but only if this is not a glob, so that we can allow "foo.*" as a
* valid glob. */
if ((!(flags & UNIT_NAME_MANGLE_GLOB) || !string_is_glob(s)) && unit_name_to_type(s) < 0)
strcat(s, suffix);

View File

@ -52,10 +52,10 @@ typedef enum UnitNameMangle {
UNIT_NAME_MANGLE_WARN = 1 << 1,
} UnitNameMangle;
int unit_name_mangle_with_suffix(const char *name, const char *operation, UnitNameMangle flags, const char *suffix, char **ret);
int unit_name_mangle_with_suffix(const char *name, UnitNameMangle flags, const char *suffix, char **ret);
static inline int unit_name_mangle(const char *name, UnitNameMangle flags, char **ret) {
return unit_name_mangle_with_suffix(name, NULL, flags, ".service", ret);
return unit_name_mangle_with_suffix(name, flags, ".service", ret);
}
bool service_unit_name_is_valid(const char *name);

View File

@ -35,7 +35,6 @@
#include "dbus-manager.h"
#include "dbus-unit.h"
#include "dbus.h"
#include "def.h"
#include "dirent-util.h"
#include "env-util.h"
#include "escape.h"
@ -59,6 +58,7 @@
#include "parse-util.h"
#include "path-lookup.h"
#include "path-util.h"
#include "plymouth-util.h"
#include "process-util.h"
#include "ratelimit.h"
#include "rlimit-util.h"

View File

@ -227,7 +227,7 @@ static int write_dependency(FILE *f, const char *opts,
STRV_FOREACH(s, names) {
char *x;
r = unit_name_mangle_with_suffix(*s, "as dependency", 0, ".mount", &x);
r = unit_name_mangle_with_suffix(*s, 0, ".mount", &x);
if (r < 0)
return log_error_errno(r, "Failed to generate unit name: %m");
r = strv_consume(&units, x);

View File

@ -20,7 +20,6 @@
#include "parse-util.h"
#include "siphash24.h"
#include "socket-util.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "utf8.h"
@ -137,36 +136,17 @@ static int net_condition_test_property(char * const *match_property, sd_device *
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);
bool net_match_config(Set *match_mac,
char * const *match_paths,
char * const *match_drivers,
char * const *match_types,
char * const *match_names,
char * const *match_property,
char * const *match_wifi_iftype,
char * const *match_ssid,
Set *match_bssid,
sd_device *device,
const struct ether_addr *dev_mac,
const char *dev_name,
enum nl80211_iftype wifi_iftype,
const char *ssid,
const struct ether_addr *bssid) {
@ -202,9 +182,6 @@ bool net_match_config(Set *match_mac,
if (!net_condition_test_property(match_property, device))
return false;
if (!net_condition_test_strv(match_wifi_iftype, wifi_iftype_to_string(wifi_iftype)))
return false;
if (!net_condition_test_strv(match_ssid, ssid))
return false;

View File

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <linux/nl80211.h>
#include <stdbool.h>
#include "sd-device.h"
@ -21,13 +20,11 @@ bool net_match_config(Set *match_mac,
char * const *match_type,
char * const *match_name,
char * const *match_property,
char * const *match_wifi_iftype,
char * const *match_ssid,
Set *match_bssid,
sd_device *device,
const struct ether_addr *dev_mac,
const char *dev_name,
enum nl80211_iftype wifi_iftype,
const char *ssid,
const struct ether_addr *bssid);

View File

@ -548,14 +548,16 @@ static sd_dhcp_option* dhcp_option_free(sd_dhcp_option *i) {
}
int sd_dhcp_option_new(uint8_t option, void *data, size_t length, sd_dhcp_option **ret) {
assert_return(ret, -EINVAL);
assert_return(length == 0 || data, -EINVAL);
_cleanup_(sd_dhcp_option_unrefp) sd_dhcp_option *p = NULL;
_cleanup_free_ void *q = NULL;
_cleanup_free_ void *q = memdup(data, length);
assert(ret);
q = memdup(data, length);
if (!q)
return -ENOMEM;
sd_dhcp_option *p = new(sd_dhcp_option, 1);
p = new(sd_dhcp_option, 1);
if (!p)
return -ENOMEM;
@ -2048,8 +2050,7 @@ sd_event *sd_dhcp_client_get_event(sd_dhcp_client *client) {
}
static sd_dhcp_client *dhcp_client_free(sd_dhcp_client *client) {
if (!client)
return NULL;
assert(client);
log_dhcp_client(client, "FREE");
@ -2075,9 +2076,11 @@ static sd_dhcp_client *dhcp_client_free(sd_dhcp_client *client) {
DEFINE_TRIVIAL_REF_UNREF_FUNC(sd_dhcp_client, sd_dhcp_client, dhcp_client_free);
int sd_dhcp_client_new(sd_dhcp_client **ret, int anonymize) {
_cleanup_(sd_dhcp_client_unrefp) sd_dhcp_client *client = NULL;
assert_return(ret, -EINVAL);
_cleanup_(sd_dhcp_client_unrefp) sd_dhcp_client *client = new(sd_dhcp_client, 1);
client = new(sd_dhcp_client, 1);
if (!client)
return -ENOMEM;

View File

@ -838,7 +838,8 @@ _public_ int sd_device_get_subsystem(sd_device *device, const char **ret) {
_public_ int sd_device_get_devtype(sd_device *device, const char **devtype) {
int r;
assert_return(device, -EINVAL);
assert(devtype);
assert(device);
r = device_read_uevent_file(device);
if (r < 0)
@ -847,10 +848,9 @@ _public_ int sd_device_get_devtype(sd_device *device, const char **devtype) {
if (!device->devtype)
return -ENOENT;
if (devtype)
*devtype = device->devtype;
*devtype = device->devtype;
return !!device->devtype;
return 0;
}
_public_ int sd_device_get_parent_with_subsystem_devtype(sd_device *child, const char *subsystem, const char *devtype, sd_device **ret) {

View File

@ -136,7 +136,7 @@ static int lookup_id(sd_netlink *nl, sd_genl_family family, uint16_t *id) {
return 0;
}
int nlmsg_type_to_genl_family(const sd_netlink *nl, uint16_t type, sd_genl_family *ret) {
int nlmsg_type_to_genl_family(sd_netlink *nl, uint16_t type, sd_genl_family *ret) {
void *p;
assert_return(nl, -EINVAL);
@ -160,7 +160,7 @@ int nlmsg_type_to_genl_family(const sd_netlink *nl, uint16_t type, sd_genl_famil
return 0;
}
int sd_genl_message_get_family(const sd_netlink *nl, const sd_netlink_message *m, sd_genl_family *family) {
int sd_genl_message_get_family(sd_netlink *nl, sd_netlink_message *m, sd_genl_family *family) {
uint16_t type;
int r;

View File

@ -3,4 +3,4 @@
#include "sd-netlink.h"
int nlmsg_type_to_genl_family(const sd_netlink *nl, uint16_t type, sd_genl_family *ret);
int nlmsg_type_to_genl_family(sd_netlink *nl, uint16_t type, sd_genl_family *ret);

View File

@ -114,7 +114,7 @@ sd_netlink_message *sd_netlink_message_unref(sd_netlink_message *m) {
return NULL;
}
int sd_netlink_message_get_type(const sd_netlink_message *m, uint16_t *type) {
int sd_netlink_message_get_type(sd_netlink_message *m, uint16_t *type) {
assert_return(m, -EINVAL);
assert_return(type, -EINVAL);
@ -132,7 +132,7 @@ int sd_netlink_message_set_flags(sd_netlink_message *m, uint16_t flags) {
return 0;
}
int sd_netlink_message_is_broadcast(const sd_netlink_message *m) {
int sd_netlink_message_is_broadcast(sd_netlink_message *m) {
assert_return(m, -EINVAL);
return m->broadcast;
@ -1001,14 +1001,14 @@ uint32_t rtnl_message_get_serial(sd_netlink_message *m) {
return m->hdr->nlmsg_seq;
}
int sd_netlink_message_is_error(const sd_netlink_message *m) {
int sd_netlink_message_is_error(sd_netlink_message *m) {
assert_return(m, 0);
assert_return(m->hdr, 0);
return m->hdr->nlmsg_type == NLMSG_ERROR;
}
int sd_netlink_message_get_errno(const sd_netlink_message *m) {
int sd_netlink_message_get_errno(sd_netlink_message *m) {
struct nlmsgerr *err;
assert_return(m, -EINVAL);

View File

@ -142,7 +142,7 @@ void *sd_netlink_slot_set_userdata(sd_netlink_slot *slot, void *userdata) {
return ret;
}
int sd_netlink_slot_get_destroy_callback(const sd_netlink_slot *slot, sd_netlink_destroy_t *callback) {
int sd_netlink_slot_get_destroy_callback(sd_netlink_slot *slot, sd_netlink_destroy_t *callback) {
assert_return(slot, -EINVAL);
if (callback)
@ -158,7 +158,7 @@ int sd_netlink_slot_set_destroy_callback(sd_netlink_slot *slot, sd_netlink_destr
return 0;
}
int sd_netlink_slot_get_floating(const sd_netlink_slot *slot) {
int sd_netlink_slot_get_floating(sd_netlink_slot *slot) {
assert_return(slot, -EINVAL);
return slot->floating;
@ -186,7 +186,7 @@ int sd_netlink_slot_set_floating(sd_netlink_slot *slot, int b) {
return 1;
}
int sd_netlink_slot_get_description(const sd_netlink_slot *slot, const char **description) {
int sd_netlink_slot_get_description(sd_netlink_slot *slot, const char **description) {
assert_return(slot, -EINVAL);
if (description)

View File

@ -993,7 +993,6 @@ static const NLType genl_nl80211_types[] = {
[NL80211_ATTR_IFINDEX] = { .type = NETLINK_TYPE_U32 },
[NL80211_ATTR_MAC] = { .type = NETLINK_TYPE_ETHER_ADDR },
[NL80211_ATTR_SSID] = { .type = NETLINK_TYPE_STRING },
[NL80211_ATTR_IFTYPE] = { .type = NETLINK_TYPE_U32 },
};
static const NLTypeSystem genl_nl80211_type_system = {

View File

@ -80,7 +80,7 @@ int sd_rtnl_message_route_set_flags(sd_netlink_message *m, unsigned flags) {
return 0;
}
int sd_rtnl_message_route_get_flags(const sd_netlink_message *m, unsigned *flags) {
int sd_rtnl_message_route_get_flags(sd_netlink_message *m, unsigned *flags) {
struct rtmsg *rtm;
assert_return(m, -EINVAL);
@ -109,7 +109,7 @@ int sd_rtnl_message_route_set_table(sd_netlink_message *m, unsigned char table)
return 0;
}
int sd_rtnl_message_route_get_family(const sd_netlink_message *m, int *family) {
int sd_rtnl_message_route_get_family(sd_netlink_message *m, int *family) {
struct rtmsg *rtm;
assert_return(m, -EINVAL);
@ -138,7 +138,7 @@ int sd_rtnl_message_route_set_family(sd_netlink_message *m, int family) {
return 0;
}
int sd_rtnl_message_route_get_type(const sd_netlink_message *m, unsigned char *type) {
int sd_rtnl_message_route_get_type(sd_netlink_message *m, unsigned char *type) {
struct rtmsg *rtm;
assert_return(m, -EINVAL);
@ -167,7 +167,7 @@ int sd_rtnl_message_route_set_type(sd_netlink_message *m, unsigned char type) {
return 0;
}
int sd_rtnl_message_route_get_protocol(const sd_netlink_message *m, unsigned char *protocol) {
int sd_rtnl_message_route_get_protocol(sd_netlink_message *m, unsigned char *protocol) {
struct rtmsg *rtm;
assert_return(m, -EINVAL);
@ -182,7 +182,7 @@ int sd_rtnl_message_route_get_protocol(const sd_netlink_message *m, unsigned cha
return 0;
}
int sd_rtnl_message_route_get_scope(const sd_netlink_message *m, unsigned char *scope) {
int sd_rtnl_message_route_get_scope(sd_netlink_message *m, unsigned char *scope) {
struct rtmsg *rtm;
assert_return(m, -EINVAL);
@ -197,7 +197,7 @@ int sd_rtnl_message_route_get_scope(const sd_netlink_message *m, unsigned char *
return 0;
}
int sd_rtnl_message_route_get_tos(const sd_netlink_message *m, unsigned char *tos) {
int sd_rtnl_message_route_get_tos(sd_netlink_message *m, unsigned char *tos) {
struct rtmsg *rtm;
assert_return(m, -EINVAL);
@ -212,7 +212,7 @@ int sd_rtnl_message_route_get_tos(const sd_netlink_message *m, unsigned char *to
return 0;
}
int sd_rtnl_message_route_get_table(const sd_netlink_message *m, unsigned char *table) {
int sd_rtnl_message_route_get_table(sd_netlink_message *m, unsigned char *table) {
struct rtmsg *rtm;
assert_return(m, -EINVAL);
@ -227,7 +227,7 @@ int sd_rtnl_message_route_get_table(const sd_netlink_message *m, unsigned char *
return 0;
}
int sd_rtnl_message_route_get_dst_prefixlen(const sd_netlink_message *m, unsigned char *dst_len) {
int sd_rtnl_message_route_get_dst_prefixlen(sd_netlink_message *m, unsigned char *dst_len) {
struct rtmsg *rtm;
assert_return(m, -EINVAL);
@ -242,7 +242,7 @@ int sd_rtnl_message_route_get_dst_prefixlen(const sd_netlink_message *m, unsigne
return 0;
}
int sd_rtnl_message_route_get_src_prefixlen(const sd_netlink_message *m, unsigned char *src_len) {
int sd_rtnl_message_route_get_src_prefixlen(sd_netlink_message *m, unsigned char *src_len) {
struct rtmsg *rtm;
assert_return(m, -EINVAL);
@ -338,7 +338,7 @@ int sd_rtnl_message_nexthop_set_family(sd_netlink_message *m, uint8_t family) {
return 0;
}
int sd_rtnl_message_nexthop_get_family(const sd_netlink_message *m, uint8_t *family) {
int sd_rtnl_message_nexthop_get_family(sd_netlink_message *m, uint8_t *family) {
struct nhmsg *nhm;
assert_return(m, -EINVAL);
@ -376,7 +376,7 @@ int sd_rtnl_message_neigh_set_state(sd_netlink_message *m, uint16_t state) {
return 0;
}
int sd_rtnl_message_neigh_get_flags(const sd_netlink_message *m, uint8_t *flags) {
int sd_rtnl_message_neigh_get_flags(sd_netlink_message *m, uint8_t *flags) {
struct ndmsg *ndm;
assert_return(m, -EINVAL);
@ -389,7 +389,7 @@ int sd_rtnl_message_neigh_get_flags(const sd_netlink_message *m, uint8_t *flags)
return 0;
}
int sd_rtnl_message_neigh_get_state(const sd_netlink_message *m, uint16_t *state) {
int sd_rtnl_message_neigh_get_state(sd_netlink_message *m, uint16_t *state) {
struct ndmsg *ndm;
assert_return(m, -EINVAL);
@ -402,7 +402,7 @@ int sd_rtnl_message_neigh_get_state(const sd_netlink_message *m, uint16_t *state
return 0;
}
int sd_rtnl_message_neigh_get_family(const sd_netlink_message *m, int *family) {
int sd_rtnl_message_neigh_get_family(sd_netlink_message *m, int *family) {
struct ndmsg *ndm;
assert_return(m, -EINVAL);
@ -417,7 +417,7 @@ int sd_rtnl_message_neigh_get_family(const sd_netlink_message *m, int *family) {
return 0;
}
int sd_rtnl_message_neigh_get_ifindex(const sd_netlink_message *m, int *index) {
int sd_rtnl_message_neigh_get_ifindex(sd_netlink_message *m, int *index) {
struct ndmsg *ndm;
assert_return(m, -EINVAL);
@ -568,7 +568,7 @@ int sd_rtnl_message_addr_set_scope(sd_netlink_message *m, unsigned char scope) {
return 0;
}
int sd_rtnl_message_addr_get_family(const sd_netlink_message *m, int *family) {
int sd_rtnl_message_addr_get_family(sd_netlink_message *m, int *family) {
struct ifaddrmsg *ifa;
assert_return(m, -EINVAL);
@ -583,7 +583,7 @@ int sd_rtnl_message_addr_get_family(const sd_netlink_message *m, int *family) {
return 0;
}
int sd_rtnl_message_addr_get_prefixlen(const sd_netlink_message *m, unsigned char *prefixlen) {
int sd_rtnl_message_addr_get_prefixlen(sd_netlink_message *m, unsigned char *prefixlen) {
struct ifaddrmsg *ifa;
assert_return(m, -EINVAL);
@ -598,7 +598,7 @@ int sd_rtnl_message_addr_get_prefixlen(const sd_netlink_message *m, unsigned cha
return 0;
}
int sd_rtnl_message_addr_get_scope(const sd_netlink_message *m, unsigned char *scope) {
int sd_rtnl_message_addr_get_scope(sd_netlink_message *m, unsigned char *scope) {
struct ifaddrmsg *ifa;
assert_return(m, -EINVAL);
@ -613,7 +613,7 @@ int sd_rtnl_message_addr_get_scope(const sd_netlink_message *m, unsigned char *s
return 0;
}
int sd_rtnl_message_addr_get_flags(const sd_netlink_message *m, unsigned char *flags) {
int sd_rtnl_message_addr_get_flags(sd_netlink_message *m, unsigned char *flags) {
struct ifaddrmsg *ifa;
assert_return(m, -EINVAL);
@ -628,7 +628,7 @@ int sd_rtnl_message_addr_get_flags(const sd_netlink_message *m, unsigned char *f
return 0;
}
int sd_rtnl_message_addr_get_ifindex(const sd_netlink_message *m, int *ifindex) {
int sd_rtnl_message_addr_get_ifindex(sd_netlink_message *m, int *ifindex) {
struct ifaddrmsg *ifa;
assert_return(m, -EINVAL);
@ -688,7 +688,7 @@ int sd_rtnl_message_new_addr_update(sd_netlink *rtnl, sd_netlink_message **ret,
return 0;
}
int sd_rtnl_message_link_get_ifindex(const sd_netlink_message *m, int *ifindex) {
int sd_rtnl_message_link_get_ifindex(sd_netlink_message *m, int *ifindex) {
struct ifinfomsg *ifi;
assert_return(m, -EINVAL);
@ -703,7 +703,7 @@ int sd_rtnl_message_link_get_ifindex(const sd_netlink_message *m, int *ifindex)
return 0;
}
int sd_rtnl_message_link_get_flags(const sd_netlink_message *m, unsigned *flags) {
int sd_rtnl_message_link_get_flags(sd_netlink_message *m, unsigned *flags) {
struct ifinfomsg *ifi;
assert_return(m, -EINVAL);
@ -718,7 +718,7 @@ int sd_rtnl_message_link_get_flags(const sd_netlink_message *m, unsigned *flags)
return 0;
}
int sd_rtnl_message_link_get_type(const sd_netlink_message *m, unsigned short *type) {
int sd_rtnl_message_link_get_type(sd_netlink_message *m, unsigned short *type) {
struct ifinfomsg *ifi;
assert_return(m, -EINVAL);
@ -733,7 +733,7 @@ int sd_rtnl_message_link_get_type(const sd_netlink_message *m, unsigned short *t
return 0;
}
int sd_rtnl_message_get_family(const sd_netlink_message *m, int *family) {
int sd_rtnl_message_get_family(sd_netlink_message *m, int *family) {
assert_return(m, -EINVAL);
assert_return(family, -EINVAL);
@ -831,7 +831,7 @@ int sd_rtnl_message_addrlabel_set_prefixlen(sd_netlink_message *m, unsigned char
return 0;
}
int sd_rtnl_message_addrlabel_get_prefixlen(const sd_netlink_message *m, unsigned char *prefixlen) {
int sd_rtnl_message_addrlabel_get_prefixlen(sd_netlink_message *m, unsigned char *prefixlen) {
struct ifaddrlblmsg *addrlabel;
assert_return(m, -EINVAL);
@ -882,7 +882,7 @@ int sd_rtnl_message_routing_policy_rule_set_tos(sd_netlink_message *m, unsigned
return 0;
}
int sd_rtnl_message_routing_policy_rule_get_tos(const sd_netlink_message *m, unsigned char *tos) {
int sd_rtnl_message_routing_policy_rule_get_tos(sd_netlink_message *m, unsigned char *tos) {
struct rtmsg *routing_policy_rule;
assert_return(m, -EINVAL);
@ -910,7 +910,7 @@ int sd_rtnl_message_routing_policy_rule_set_table(sd_netlink_message *m, unsigne
return 0;
}
int sd_rtnl_message_routing_policy_rule_get_table(const sd_netlink_message *m, unsigned char *table) {
int sd_rtnl_message_routing_policy_rule_get_table(sd_netlink_message *m, unsigned char *table) {
struct rtmsg *routing_policy_rule;
assert_return(m, -EINVAL);
@ -937,7 +937,7 @@ int sd_rtnl_message_routing_policy_rule_set_flags(sd_netlink_message *m, unsigne
return 0;
}
int sd_rtnl_message_routing_policy_rule_get_flags(const sd_netlink_message *m, unsigned *flags) {
int sd_rtnl_message_routing_policy_rule_get_flags(sd_netlink_message *m, unsigned *flags) {
struct rtmsg *routing_policy_rule;
assert_return(m, -EINVAL);
@ -964,7 +964,7 @@ int sd_rtnl_message_routing_policy_rule_set_rtm_type(sd_netlink_message *m, unsi
return 0;
}
int sd_rtnl_message_routing_policy_rule_get_rtm_type(const sd_netlink_message *m, unsigned char *type) {
int sd_rtnl_message_routing_policy_rule_get_rtm_type(sd_netlink_message *m, unsigned char *type) {
struct rtmsg *routing_policy_rule;
assert_return(m, -EINVAL);
@ -992,7 +992,7 @@ int sd_rtnl_message_routing_policy_rule_set_rtm_dst_prefixlen(sd_netlink_message
return 0;
}
int sd_rtnl_message_routing_policy_rule_get_rtm_dst_prefixlen(const sd_netlink_message *m, unsigned char *len) {
int sd_rtnl_message_routing_policy_rule_get_rtm_dst_prefixlen(sd_netlink_message *m, unsigned char *len) {
struct rtmsg *routing_policy_rule;
assert_return(m, -EINVAL);
@ -1020,7 +1020,7 @@ int sd_rtnl_message_routing_policy_rule_set_rtm_src_prefixlen(sd_netlink_message
return 0;
}
int sd_rtnl_message_routing_policy_rule_get_rtm_src_prefixlen(const sd_netlink_message *m, unsigned char *len) {
int sd_rtnl_message_routing_policy_rule_get_rtm_src_prefixlen(sd_netlink_message *m, unsigned char *len) {
struct rtmsg *routing_policy_rule;
assert_return(m, -EINVAL);

View File

@ -79,7 +79,7 @@ int sd_netlink_new_from_netlink(sd_netlink **ret, int fd) {
return 0;
}
static bool rtnl_pid_changed(const sd_netlink *rtnl) {
static bool rtnl_pid_changed(sd_netlink *rtnl) {
assert(rtnl);
/* We don't support people creating an rtnl connection and
@ -673,7 +673,7 @@ int sd_netlink_call(sd_netlink *rtnl,
}
}
int sd_netlink_get_events(const sd_netlink *rtnl) {
int sd_netlink_get_events(sd_netlink *rtnl) {
assert_return(rtnl, -EINVAL);
assert_return(!rtnl_pid_changed(rtnl), -ECHILD);
@ -683,7 +683,7 @@ int sd_netlink_get_events(const sd_netlink *rtnl) {
return 0;
}
int sd_netlink_get_timeout(const sd_netlink *rtnl, uint64_t *timeout_usec) {
int sd_netlink_get_timeout(sd_netlink *rtnl, uint64_t *timeout_usec) {
struct reply_callback *c;
assert_return(rtnl, -EINVAL);

View File

@ -66,7 +66,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argc >= 0);
assert(argv);
while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0)
while ((c = getopt_long(argc, argv, "hqcv", options, NULL)) >= 0)
switch (c) {

View File

@ -167,7 +167,6 @@ typedef struct LinkInfo {
NetDevPort port;
/* wlan info */
enum nl80211_iftype wlan_iftype;
char *ssid;
struct ether_addr bssid;
@ -385,7 +384,7 @@ static void acquire_ether_link_info(int *fd, LinkInfo *link) {
static void acquire_wlan_link_info(LinkInfo *link) {
_cleanup_(sd_netlink_unrefp) sd_netlink *genl = NULL;
const char *type = NULL;
int r, k = 0;
int r, k;
if (link->sd_device)
(void) sd_device_get_devtype(link->sd_device, &type);
@ -400,15 +399,13 @@ static void acquire_wlan_link_info(LinkInfo *link) {
(void) sd_netlink_inc_rcvbuf(genl, RCVBUF_SIZE);
r = wifi_get_interface(genl, link->ifindex, &link->wlan_iftype, &link->ssid);
r = wifi_get_ssid(genl, link->ifindex, &link->ssid);
if (r < 0)
log_debug_errno(r, "%s: failed to query ssid: %m", link->name);
if (link->iftype == NL80211_IFTYPE_STATION) {
k = wifi_get_station(genl, link->ifindex, &link->bssid);
if (k < 0)
log_debug_errno(k, "%s: failed to query bssid: %m", link->name);
}
k = wifi_get_bssid(genl, link->ifindex, &link->bssid);
if (k < 0)
log_debug_errno(k, "%s: failed to query bssid: %m", link->name);
link->has_wlan_link_info = r > 0 || k > 0;
}

View File

@ -2865,7 +2865,7 @@ int link_reconfigure(Link *link, bool force) {
return 0;
r = network_get(link->manager, link->sd_device, link->ifname,
&link->mac, link->wlan_iftype, link->ssid, &link->bssid, &network);
&link->mac, link->ssid, &link->bssid, &network);
if (r == -ENOENT) {
link_enter_unmanaged(link);
return 0;
@ -2959,7 +2959,7 @@ static int link_initialized_and_synced(Link *link) {
return r;
r = network_get(link->manager, link->sd_device, link->ifname,
&link->mac, link->wlan_iftype, link->ssid, &link->bssid, &network);
&link->mac, link->ssid, &link->bssid, &network);
if (r == -ENOENT) {
link_enter_unmanaged(link);
return 0;

View File

@ -2,7 +2,6 @@
#pragma once
#include <endian.h>
#include <linux/nl80211.h>
#include "sd-bus.h"
#include "sd-device.h"
@ -57,7 +56,6 @@ typedef struct Link {
sd_device *sd_device;
/* wlan */
enum nl80211_iftype wlan_iftype;
char *ssid;
struct ether_addr bssid;

View File

@ -29,7 +29,6 @@ Match.MACAddress, config_parse_hwaddrs,
Match.Path, config_parse_match_strv, 0, offsetof(Network, match_path)
Match.Driver, config_parse_match_strv, 0, offsetof(Network, match_driver)
Match.Type, config_parse_match_strv, 0, offsetof(Network, match_type)
Match.WLANInterfaceType, config_parse_match_strv, 0, offsetof(Network, match_wlan_iftype)
Match.SSID, config_parse_match_strv, 0, offsetof(Network, match_ssid)
Match.BSSID, config_parse_hwaddrs, 0, offsetof(Network, match_bssid)
Match.Name, config_parse_match_ifnames, 0, offsetof(Network, match_name)

View File

@ -595,7 +595,6 @@ static Network *network_free(Network *network) {
strv_free(network->match_type);
strv_free(network->match_name);
strv_free(network->match_property);
strv_free(network->match_wlan_iftype);
strv_free(network->match_ssid);
set_free_free(network->match_bssid);
condition_free_list(network->conditions);
@ -702,8 +701,7 @@ int network_get_by_name(Manager *manager, const char *name, Network **ret) {
int network_get(Manager *manager, sd_device *device,
const char *ifname, const struct ether_addr *address,
enum nl80211_iftype wlan_iftype, const char *ssid, const struct ether_addr *bssid,
Network **ret) {
const char *ssid, const struct ether_addr *bssid, Network **ret) {
Network *network;
Iterator i;
@ -713,8 +711,8 @@ int network_get(Manager *manager, sd_device *device,
ORDERED_HASHMAP_FOREACH(network, manager->networks, i)
if (net_match_config(network->match_mac, network->match_path, network->match_driver,
network->match_type, network->match_name, network->match_property,
network->match_wlan_iftype, network->match_ssid, network->match_bssid,
device, address, ifname, wlan_iftype, ssid, bssid)) {
network->match_ssid, network->match_bssid,
device, address, ifname, ssid, bssid)) {
if (network->match_name && device) {
const char *attr;
uint8_t name_assign_type = NET_NAME_UNKNOWN;

View File

@ -1,8 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <linux/nl80211.h>
#include "sd-bus.h"
#include "sd-device.h"
@ -66,7 +64,6 @@ struct Network {
char **match_type;
char **match_name;
char **match_property;
char **match_wlan_iftype;
char **match_ssid;
Set *match_bssid;
LIST_HEAD(Condition, conditions);
@ -294,7 +291,7 @@ int network_verify(Network *network);
int network_get_by_name(Manager *manager, const char *name, Network **ret);
int network_get(Manager *manager, sd_device *device, const char *ifname, const struct ether_addr *mac,
enum nl80211_iftype wlan_iftype, const char *ssid, const struct ether_addr *bssid, Network **ret);
const char *ssid, const struct ether_addr *bssid, Network **ret);
int network_apply(Network *network, Link *link);
void network_apply_anonymize_if_set(Network *network);

View File

@ -16,7 +16,7 @@
int wifi_get_info(Link *link) {
const char *type;
int r, s = 0;
int r, s;
assert(link);
@ -33,26 +33,24 @@ int wifi_get_info(Link *link) {
return 0;
_cleanup_free_ char *ssid = NULL;
r = wifi_get_interface(link->manager->genl, link->ifindex, &link->wlan_iftype, &ssid);
r = wifi_get_ssid(link->manager->genl, link->ifindex, &ssid);
if (r < 0)
return r;
if (r > 0 && streq_ptr(link->ssid, ssid))
r = 0;
free_and_replace(link->ssid, ssid);
if (link->wlan_iftype == NL80211_IFTYPE_STATION) {
struct ether_addr old_bssid = link->bssid;
s = wifi_get_station(link->manager->genl, link->ifindex, &link->bssid);
if (s < 0)
return s;
if (s > 0 && memcmp(&old_bssid, &link->bssid, sizeof old_bssid) == 0)
s = 0;
}
struct ether_addr old_bssid = link->bssid;
s = wifi_get_bssid(link->manager->genl, link->ifindex, &link->bssid);
if (s < 0)
return s;
if (s > 0 && memcmp(&old_bssid, &link->bssid, sizeof old_bssid) == 0)
s = 0;
if (r > 0 || s > 0) {
char buf[ETHER_ADDR_TO_STRING_MAX];
if (link->wlan_iftype == NL80211_IFTYPE_STATION && link->ssid)
if (link->ssid)
log_link_info(link, "Connected WiFi access point: %s (%s)",
link->ssid, ether_addr_to_string(&link->bssid, buf));
return 1;

View File

@ -125,7 +125,7 @@ static void test_network_get(Manager *manager, sd_device *loopback) {
/* let's assume that the test machine does not have a .network file
that applies to the loopback device... */
assert_se(network_get(manager, loopback, "lo", &mac, 0, NULL, NULL, &network) == -ENOENT);
assert_se(network_get(manager, loopback, "lo", &mac, NULL, NULL, &network) == -ENOENT);
assert_se(!network);
}

View File

@ -258,7 +258,7 @@ int allocate_scope(
if (r < 0)
return log_error_errno(r, "Could not watch job: %m");
r = unit_name_mangle_with_suffix(machine_name, "as machine name", 0, ".scope", &scope);
r = unit_name_mangle_with_suffix(machine_name, 0, ".scope", &scope);
if (r < 0)
return log_error_errno(r, "Failed to mangle scope name: %m");
@ -350,7 +350,7 @@ int terminate_scope(
_cleanup_free_ char *scope = NULL;
int r;
r = unit_name_mangle_with_suffix(machine_name, "to terminate", 0, ".scope", &scope);
r = unit_name_mangle_with_suffix(machine_name, 0, ".scope", &scope);
if (r < 0)
return log_error_errno(r, "Failed to mangle scope name: %m");

View File

@ -515,7 +515,6 @@ int dns_stream_new(
.n_ref = 1,
.fd = -1,
.protocol = protocol,
.type = type,
};
r = ordered_set_ensure_allocated(&s->write_queue, &dns_packet_hash_ops);

View File

@ -641,9 +641,7 @@ static int transient_cgroup_set_properties(sd_bus_message *m) {
if (!isempty(arg_slice)) {
_cleanup_free_ char *slice = NULL;
r = unit_name_mangle_with_suffix(arg_slice, "as slice",
arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN,
".slice", &slice);
r = unit_name_mangle_with_suffix(arg_slice, arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN, ".slice", &slice);
if (r < 0)
return log_error_errno(r, "Failed to mangle name '%s': %m", arg_slice);
@ -1114,9 +1112,7 @@ static int start_transient_service(
}
if (arg_unit) {
r = unit_name_mangle_with_suffix(arg_unit, "as unit",
arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN,
".service", &service);
r = unit_name_mangle_with_suffix(arg_unit, arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN, ".service", &service);
if (r < 0)
return log_error_errno(r, "Failed to mangle unit name: %m");
} else {
@ -1359,9 +1355,7 @@ static int start_transient_scope(sd_bus *bus) {
return log_oom();
if (arg_unit) {
r = unit_name_mangle_with_suffix(arg_unit, "as unit",
arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN,
".scope", &scope);
r = unit_name_mangle_with_suffix(arg_unit, arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN, ".scope", &scope);
if (r < 0)
return log_error_errno(r, "Failed to mangle scope name: %m");
} else {
@ -1536,15 +1530,11 @@ static int start_transient_trigger(
break;
default:
r = unit_name_mangle_with_suffix(arg_unit, "as unit",
arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN,
".service", &service);
r = unit_name_mangle_with_suffix(arg_unit, arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN, ".service", &service);
if (r < 0)
return log_error_errno(r, "Failed to mangle unit name: %m");
r = unit_name_mangle_with_suffix(arg_unit, "as trigger",
arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN,
suffix, &trigger);
r = unit_name_mangle_with_suffix(arg_unit, arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN, suffix, &trigger);
if (r < 0)
return log_error_errno(r, "Failed to mangle unit name: %m");

View File

@ -24,7 +24,6 @@
#include "alloc-util.h"
#include "ask-password-api.h"
#include "def.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-util.h"
@ -35,6 +34,7 @@
#include "memory-util.h"
#include "missing.h"
#include "mkdir.h"
#include "plymouth-util.h"
#include "process-util.h"
#include "random-util.h"
#include "signal-util.h"

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
#include "netlink-util.h"
#include "wifi-util.h"
int wifi_get_interface(sd_netlink *genl, int ifindex, enum nl80211_iftype *iftype, char **ssid) {
int wifi_get_ssid(sd_netlink *genl, int ifindex, char **ssid) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *m = NULL, *reply = NULL;
sd_genl_family family;
int r;
@ -40,25 +40,14 @@ int wifi_get_interface(sd_netlink *genl, int ifindex, enum nl80211_iftype *iftyp
return 0;
}
if (iftype) {
uint32_t t;
r = sd_netlink_message_read_u32(reply, NL80211_ATTR_IFTYPE, &t);
if (r < 0)
return log_debug_errno(r, "Failed to get NL80211_ATTR_IFTYPE attribute: %m");
*iftype = t;
}
if (ssid) {
r = sd_netlink_message_read_string_strdup(reply, NL80211_ATTR_SSID, ssid);
if (r < 0 && r != -ENODATA)
return log_debug_errno(r, "Failed to get NL80211_ATTR_SSID attribute: %m");
}
r = sd_netlink_message_read_string_strdup(reply, NL80211_ATTR_SSID, ssid);
if (r < 0 && r != -ENODATA)
return log_debug_errno(r, "Failed to get NL80211_ATTR_SSID attribute: %m");
return r == -ENODATA ? 0 : 1;
}
int wifi_get_station(sd_netlink *genl, int ifindex, struct ether_addr *bssid) {
int wifi_get_bssid(sd_netlink *genl, int ifindex, struct ether_addr *bssid) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *m = NULL, *reply = NULL;
sd_genl_family family;
int r;

View File

@ -2,9 +2,7 @@
#pragma once
#include <linux/nl80211.h>
#include "netlink-util.h"
int wifi_get_interface(sd_netlink *genl, int ifindex, enum nl80211_iftype *iftype, char **ssid);
int wifi_get_station(sd_netlink *genl, int ifindex, struct ether_addr *bssid);
int wifi_get_ssid(sd_netlink *genl, int ifindex, char **ssid);
int wifi_get_bssid(sd_netlink *genl, int ifindex, struct ether_addr *bssid);

View File

@ -761,7 +761,10 @@ static int expand_names(sd_bus *bus, char **names, const char* suffix, char ***r
char *t;
UnitNameMangle options = UNIT_NAME_MANGLE_GLOB | (arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN);
r = unit_name_mangle_with_suffix(*name, NULL, options, suffix ?: ".service", &t);
if (suffix)
r = unit_name_mangle_with_suffix(*name, options, suffix, &t);
else
r = unit_name_mangle(*name, options, &t);
if (r < 0)
return log_error_errno(r, "Failed to mangle name: %m");
@ -2179,9 +2182,7 @@ static int set_default(int argc, char *argv[], void *userdata) {
assert(argc >= 2);
assert(argv);
r = unit_name_mangle_with_suffix(argv[1], "set-default",
arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN,
".target", &unit);
r = unit_name_mangle_with_suffix(argv[1], arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN, ".target", &unit);
if (r < 0)
return log_error_errno(r, "Failed to mangle unit name: %m");
@ -6564,7 +6565,7 @@ static int enable_sysv_units(const char *verb, char **args) {
return r;
}
static int mangle_names(const char *operation, char **original_names, char ***mangled_names) {
static int mangle_names(char **original_names, char ***mangled_names) {
char **i, **l, **name;
int r;
@ -6584,9 +6585,7 @@ static int mangle_names(const char *operation, char **original_names, char ***ma
return log_oom();
}
} else {
r = unit_name_mangle_with_suffix(*name, operation,
arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN,
".service", i);
r = unit_name_mangle(*name, arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN, i);
if (r < 0) {
*i = NULL;
strv_free(l);
@ -6697,7 +6696,7 @@ static int enable_unit(int argc, char *argv[], void *userdata) {
if (!argv[1])
return 0;
r = mangle_names("to enable", strv_skip(argv, 1), &names);
r = mangle_names(strv_skip(argv, 1), &names);
if (r < 0)
return r;
@ -6924,13 +6923,11 @@ static int add_dependency(int argc, char *argv[], void *userdata) {
if (!argv[1])
return 0;
r = unit_name_mangle_with_suffix(argv[1], "as target",
arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN,
".target", &target);
r = unit_name_mangle_with_suffix(argv[1], arg_quiet ? 0 : UNIT_NAME_MANGLE_WARN, ".target", &target);
if (r < 0)
return log_error_errno(r, "Failed to mangle unit name: %m");
r = mangle_names("as dependency", strv_skip(argv, 2), &names);
r = mangle_names(strv_skip(argv, 2), &names);
if (r < 0)
return r;
@ -7116,7 +7113,7 @@ static int unit_is_enabled(int argc, char *argv[], void *userdata) {
char **name;
int r;
r = mangle_names("to check", strv_skip(argv, 1), &names);
r = mangle_names(strv_skip(argv, 1), &names);
if (r < 0)
return r;

View File

@ -66,8 +66,8 @@ int sd_netlink_call_async(sd_netlink *nl, sd_netlink_slot **ret_slot, sd_netlink
int sd_netlink_call(sd_netlink *nl, sd_netlink_message *message, uint64_t timeout,
sd_netlink_message **reply);
int sd_netlink_get_events(const sd_netlink *nl);
int sd_netlink_get_timeout(const sd_netlink *nl, uint64_t *timeout);
int sd_netlink_get_events(sd_netlink *nl);
int sd_netlink_get_timeout(sd_netlink *nl, uint64_t *timeout);
int sd_netlink_process(sd_netlink *nl, sd_netlink_message **ret);
int sd_netlink_wait(sd_netlink *nl, uint64_t timeout);
@ -122,11 +122,11 @@ sd_netlink_message *sd_netlink_message_ref(sd_netlink_message *m);
sd_netlink_message *sd_netlink_message_unref(sd_netlink_message *m);
int sd_netlink_message_request_dump(sd_netlink_message *m, int dump);
int sd_netlink_message_is_error(const sd_netlink_message *m);
int sd_netlink_message_get_errno(const sd_netlink_message *m);
int sd_netlink_message_get_type(const sd_netlink_message *m, uint16_t *type);
int sd_netlink_message_is_error(sd_netlink_message *m);
int sd_netlink_message_get_errno(sd_netlink_message *m);
int sd_netlink_message_get_type(sd_netlink_message *m, uint16_t *type);
int sd_netlink_message_set_flags(sd_netlink_message *m, uint16_t flags);
int sd_netlink_message_is_broadcast(const sd_netlink_message *m);
int sd_netlink_message_is_broadcast(sd_netlink_message *m);
/* rtnl */
@ -136,23 +136,23 @@ int sd_rtnl_message_new_addr(sd_netlink *nl, sd_netlink_message **ret, uint16_t
int sd_rtnl_message_new_route(sd_netlink *nl, sd_netlink_message **ret, uint16_t nlmsg_type, int rtm_family, unsigned char rtm_protocol);
int sd_rtnl_message_new_neigh(sd_netlink *nl, sd_netlink_message **ret, uint16_t msg_type, int index, int nda_family);
int sd_rtnl_message_get_family(const sd_netlink_message *m, int *family);
int sd_rtnl_message_get_family(sd_netlink_message *m, int *family);
int sd_rtnl_message_addr_set_prefixlen(sd_netlink_message *m, unsigned char prefixlen);
int sd_rtnl_message_addr_set_scope(sd_netlink_message *m, unsigned char scope);
int sd_rtnl_message_addr_set_flags(sd_netlink_message *m, unsigned char flags);
int sd_rtnl_message_addr_get_family(const sd_netlink_message *m, int *family);
int sd_rtnl_message_addr_get_prefixlen(const sd_netlink_message *m, unsigned char *prefixlen);
int sd_rtnl_message_addr_get_scope(const sd_netlink_message *m, unsigned char *scope);
int sd_rtnl_message_addr_get_flags(const sd_netlink_message *m, unsigned char *flags);
int sd_rtnl_message_addr_get_ifindex(const sd_netlink_message *m, int *ifindex);
int sd_rtnl_message_addr_get_family(sd_netlink_message *m, int *family);
int sd_rtnl_message_addr_get_prefixlen(sd_netlink_message *m, unsigned char *prefixlen);
int sd_rtnl_message_addr_get_scope(sd_netlink_message *m, unsigned char *scope);
int sd_rtnl_message_addr_get_flags(sd_netlink_message *m, unsigned char *flags);
int sd_rtnl_message_addr_get_ifindex(sd_netlink_message *m, int *ifindex);
int sd_rtnl_message_link_set_flags(sd_netlink_message *m, unsigned flags, unsigned change);
int sd_rtnl_message_link_set_type(sd_netlink_message *m, unsigned type);
int sd_rtnl_message_link_set_family(sd_netlink_message *m, unsigned family);
int sd_rtnl_message_link_get_ifindex(const sd_netlink_message *m, int *ifindex);
int sd_rtnl_message_link_get_flags(const sd_netlink_message *m, unsigned *flags);
int sd_rtnl_message_link_get_type(const sd_netlink_message *m, unsigned short *type);
int sd_rtnl_message_link_get_ifindex(sd_netlink_message *m, int *ifindex);
int sd_rtnl_message_link_get_flags(sd_netlink_message *m, unsigned *flags);
int sd_rtnl_message_link_get_type(sd_netlink_message *m, unsigned short *type);
int sd_rtnl_message_route_set_dst_prefixlen(sd_netlink_message *m, unsigned char prefixlen);
int sd_rtnl_message_route_set_src_prefixlen(sd_netlink_message *m, unsigned char prefixlen);
@ -160,52 +160,52 @@ int sd_rtnl_message_route_set_scope(sd_netlink_message *m, unsigned char scope);
int sd_rtnl_message_route_set_flags(sd_netlink_message *m, unsigned flags);
int sd_rtnl_message_route_set_table(sd_netlink_message *m, unsigned char table);
int sd_rtnl_message_route_set_type(sd_netlink_message *m, unsigned char type);
int sd_rtnl_message_route_get_flags(const sd_netlink_message *m, unsigned *flags);
int sd_rtnl_message_route_get_family(const sd_netlink_message *m, int *family);
int sd_rtnl_message_route_get_flags(sd_netlink_message *m, unsigned *flags);
int sd_rtnl_message_route_get_family(sd_netlink_message *m, int *family);
int sd_rtnl_message_route_set_family(sd_netlink_message *m, int family);
int sd_rtnl_message_route_get_protocol(const sd_netlink_message *m, unsigned char *protocol);
int sd_rtnl_message_route_get_scope(const sd_netlink_message *m, unsigned char *scope);
int sd_rtnl_message_route_get_tos(const sd_netlink_message *m, unsigned char *tos);
int sd_rtnl_message_route_get_table(const sd_netlink_message *m, unsigned char *table);
int sd_rtnl_message_route_get_dst_prefixlen(const sd_netlink_message *m, unsigned char *dst_len);
int sd_rtnl_message_route_get_src_prefixlen(const sd_netlink_message *m, unsigned char *src_len);
int sd_rtnl_message_route_get_type(const sd_netlink_message *m, unsigned char *type);
int sd_rtnl_message_route_get_protocol(sd_netlink_message *m, unsigned char *protocol);
int sd_rtnl_message_route_get_scope(sd_netlink_message *m, unsigned char *scope);
int sd_rtnl_message_route_get_tos(sd_netlink_message *m, unsigned char *tos);
int sd_rtnl_message_route_get_table(sd_netlink_message *m, unsigned char *table);
int sd_rtnl_message_route_get_dst_prefixlen(sd_netlink_message *m, unsigned char *dst_len);
int sd_rtnl_message_route_get_src_prefixlen(sd_netlink_message *m, unsigned char *src_len);
int sd_rtnl_message_route_get_type(sd_netlink_message *m, unsigned char *type);
int sd_rtnl_message_new_nexthop(sd_netlink *rtnl, sd_netlink_message **ret, uint16_t nhmsg_type, int nh_family, unsigned char nh_protocol);
int sd_rtnl_message_nexthop_set_flags(sd_netlink_message *m, uint8_t flags);
int sd_rtnl_message_nexthop_set_family(sd_netlink_message *m, uint8_t family);
int sd_rtnl_message_nexthop_get_family(const sd_netlink_message *m, uint8_t *family);
int sd_rtnl_message_nexthop_get_family(sd_netlink_message *m, uint8_t *family);
int sd_rtnl_message_neigh_set_flags(sd_netlink_message *m, uint8_t flags);
int sd_rtnl_message_neigh_set_state(sd_netlink_message *m, uint16_t state);
int sd_rtnl_message_neigh_get_family(const sd_netlink_message *m, int *family);
int sd_rtnl_message_neigh_get_ifindex(const sd_netlink_message *m, int *family);
int sd_rtnl_message_neigh_get_state(const sd_netlink_message *m, uint16_t *state);
int sd_rtnl_message_neigh_get_flags(const sd_netlink_message *m, uint8_t *flags);
int sd_rtnl_message_neigh_get_family(sd_netlink_message *m, int *family);
int sd_rtnl_message_neigh_get_ifindex(sd_netlink_message *m, int *family);
int sd_rtnl_message_neigh_get_state(sd_netlink_message *m, uint16_t *state);
int sd_rtnl_message_neigh_get_flags(sd_netlink_message *m, uint8_t *flags);
int sd_rtnl_message_new_addrlabel(sd_netlink *rtnl, sd_netlink_message **ret, uint16_t nlmsg_type, int ifindex, int ifal_family);
int sd_rtnl_message_addrlabel_set_prefixlen(sd_netlink_message *m, unsigned char prefixlen);
int sd_rtnl_message_addrlabel_get_prefixlen(const sd_netlink_message *m, unsigned char *prefixlen);
int sd_rtnl_message_addrlabel_get_prefixlen(sd_netlink_message *m, unsigned char *prefixlen);
int sd_rtnl_message_new_routing_policy_rule(sd_netlink *rtnl, sd_netlink_message **ret, uint16_t nlmsg_type, int ifal_family);
int sd_rtnl_message_routing_policy_rule_set_tos(sd_netlink_message *m, unsigned char tos);
int sd_rtnl_message_routing_policy_rule_get_tos(const sd_netlink_message *m, unsigned char *tos);
int sd_rtnl_message_routing_policy_rule_get_tos(sd_netlink_message *m, unsigned char *tos);
int sd_rtnl_message_routing_policy_rule_set_table(sd_netlink_message *m, unsigned char table);
int sd_rtnl_message_routing_policy_rule_get_table(const sd_netlink_message *m, unsigned char *table);
int sd_rtnl_message_routing_policy_rule_get_table(sd_netlink_message *m, unsigned char *table);
int sd_rtnl_message_routing_policy_rule_set_rtm_src_prefixlen(sd_netlink_message *m, unsigned char len);
int sd_rtnl_message_routing_policy_rule_get_rtm_src_prefixlen(const sd_netlink_message *m, unsigned char *len);
int sd_rtnl_message_routing_policy_rule_get_rtm_src_prefixlen(sd_netlink_message *m, unsigned char *len);
int sd_rtnl_message_routing_policy_rule_set_rtm_dst_prefixlen(sd_netlink_message *m, unsigned char len);
int sd_rtnl_message_routing_policy_rule_get_rtm_dst_prefixlen(const sd_netlink_message *m, unsigned char *len);
int sd_rtnl_message_routing_policy_rule_get_rtm_dst_prefixlen(sd_netlink_message *m, unsigned char *len);
int sd_rtnl_message_routing_policy_rule_set_rtm_type(sd_netlink_message *m, unsigned char type);
int sd_rtnl_message_routing_policy_rule_get_rtm_type(const sd_netlink_message *m, unsigned char *type);
int sd_rtnl_message_routing_policy_rule_get_rtm_type(sd_netlink_message *m, unsigned char *type);
int sd_rtnl_message_routing_policy_rule_set_flags(sd_netlink_message *m, unsigned flags);
int sd_rtnl_message_routing_policy_rule_get_flags(const sd_netlink_message *m, unsigned *flags);
int sd_rtnl_message_routing_policy_rule_get_flags(sd_netlink_message *m, unsigned *flags);
/* genl */
int sd_genl_socket_open(sd_netlink **nl);
int sd_genl_message_new(sd_netlink *nl, sd_genl_family family, uint8_t cmd, sd_netlink_message **m);
int sd_genl_message_get_family(const sd_netlink *nl, const sd_netlink_message *m, sd_genl_family *family);
int sd_genl_message_get_family(sd_netlink *nl, sd_netlink_message *m, sd_genl_family *family);
/* slot */
sd_netlink_slot *sd_netlink_slot_ref(sd_netlink_slot *nl);
@ -214,11 +214,11 @@ sd_netlink_slot *sd_netlink_slot_unref(sd_netlink_slot *nl);
sd_netlink *sd_netlink_slot_get_netlink(sd_netlink_slot *slot);
void *sd_netlink_slot_get_userdata(sd_netlink_slot *slot);
void *sd_netlink_slot_set_userdata(sd_netlink_slot *slot, void *userdata);
int sd_netlink_slot_get_destroy_callback(const sd_netlink_slot *slot, sd_netlink_destroy_t *callback);
int sd_netlink_slot_get_destroy_callback(sd_netlink_slot *slot, sd_netlink_destroy_t *callback);
int sd_netlink_slot_set_destroy_callback(sd_netlink_slot *slot, sd_netlink_destroy_t callback);
int sd_netlink_slot_get_floating(const sd_netlink_slot *slot);
int sd_netlink_slot_get_floating(sd_netlink_slot *slot);
int sd_netlink_slot_set_floating(sd_netlink_slot *slot, int b);
int sd_netlink_slot_get_description(const sd_netlink_slot *slot, const char **description);
int sd_netlink_slot_get_description(sd_netlink_slot *slot, const char **description);
int sd_netlink_slot_set_description(sd_netlink_slot *slot, const char *description);
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_netlink, sd_netlink_unref);

View File

@ -242,8 +242,8 @@ int link_config_get(link_config_ctx *ctx, sd_device *device, link_config **ret)
LIST_FOREACH(links, link, ctx->links) {
if (net_match_config(link->match_mac, link->match_path, link->match_driver,
link->match_type, link->match_name, link->match_property, NULL, NULL, NULL,
device, NULL, NULL, 0, NULL, NULL)) {
link->match_type, link->match_name, link->match_property, NULL, NULL,
device, NULL, NULL, NULL, NULL)) {
if (link->match_name && !strv_contains(link->match_name, "*")) {
unsigned name_assign_type = NET_NAME_UNKNOWN;

View File

@ -19,7 +19,6 @@ Type=
Driver=
Architecture=
Path=
WLANInterfaceType=
SSID=
BSSID=
Name=