1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

Merge pull request #13836 from systemd/assert-cleanups-and-constification

Assert cleanups and constification
This commit is contained in:
Yu Watanabe 2019-10-25 13:36:00 +09:00 committed by GitHub
commit f2106b1789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 101 additions and 121 deletions

View File

@ -58,3 +58,8 @@
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,8 +162,6 @@ 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

@ -1,9 +0,0 @@
/* 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;
}

View File

@ -1,11 +0,0 @@
/* 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

@ -35,6 +35,7 @@
#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"
@ -58,7 +59,6 @@
#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

@ -548,16 +548,14 @@ 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) {
_cleanup_(sd_dhcp_option_unrefp) sd_dhcp_option *p = NULL;
_cleanup_free_ void *q = NULL;
assert_return(ret, -EINVAL);
assert_return(length == 0 || data, -EINVAL);
assert(ret);
q = memdup(data, length);
_cleanup_free_ void *q = memdup(data, length);
if (!q)
return -ENOMEM;
p = new(sd_dhcp_option, 1);
sd_dhcp_option *p = new(sd_dhcp_option, 1);
if (!p)
return -ENOMEM;
@ -2050,7 +2048,8 @@ sd_event *sd_dhcp_client_get_event(sd_dhcp_client *client) {
}
static sd_dhcp_client *dhcp_client_free(sd_dhcp_client *client) {
assert(client);
if (!client)
return NULL;
log_dhcp_client(client, "FREE");
@ -2076,11 +2075,9 @@ 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);
client = new(sd_dhcp_client, 1);
_cleanup_(sd_dhcp_client_unrefp) sd_dhcp_client *client = new(sd_dhcp_client, 1);
if (!client)
return -ENOMEM;

View File

@ -838,8 +838,7 @@ _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(devtype);
assert(device);
assert_return(device, -EINVAL);
r = device_read_uevent_file(device);
if (r < 0)
@ -848,9 +847,10 @@ _public_ int sd_device_get_devtype(sd_device *device, const char **devtype) {
if (!device->devtype)
return -ENOENT;
*devtype = device->devtype;
if (devtype)
*devtype = device->devtype;
return 0;
return !!device->devtype;
}
_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(sd_netlink *nl, uint16_t type, sd_genl_family *ret) {
int nlmsg_type_to_genl_family(const 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(sd_netlink *nl, uint16_t type, sd_genl_family *ret
return 0;
}
int sd_genl_message_get_family(sd_netlink *nl, sd_netlink_message *m, sd_genl_family *family) {
int sd_genl_message_get_family(const sd_netlink *nl, const 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(sd_netlink *nl, uint16_t type, sd_genl_family *ret);
int nlmsg_type_to_genl_family(const 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(sd_netlink_message *m, uint16_t *type) {
int sd_netlink_message_get_type(const 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(sd_netlink_message *m) {
int sd_netlink_message_is_broadcast(const 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(sd_netlink_message *m) {
int sd_netlink_message_is_error(const 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(sd_netlink_message *m) {
int sd_netlink_message_get_errno(const 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(sd_netlink_slot *slot, sd_netlink_destroy_t *callback) {
int sd_netlink_slot_get_destroy_callback(const 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(sd_netlink_slot *slot) {
int sd_netlink_slot_get_floating(const 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(sd_netlink_slot *slot, const char **description) {
int sd_netlink_slot_get_description(const sd_netlink_slot *slot, const char **description) {
assert_return(slot, -EINVAL);
if (description)

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(sd_netlink_message *m, unsigned *flags) {
int sd_rtnl_message_route_get_flags(const 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(sd_netlink_message *m, int *family) {
int sd_rtnl_message_route_get_family(const 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(sd_netlink_message *m, unsigned char *type) {
int sd_rtnl_message_route_get_type(const 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(sd_netlink_message *m, unsigned char *protocol) {
int sd_rtnl_message_route_get_protocol(const 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(sd_netlink_message *m, unsigned char *pro
return 0;
}
int sd_rtnl_message_route_get_scope(sd_netlink_message *m, unsigned char *scope) {
int sd_rtnl_message_route_get_scope(const 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(sd_netlink_message *m, unsigned char *scope)
return 0;
}
int sd_rtnl_message_route_get_tos(sd_netlink_message *m, unsigned char *tos) {
int sd_rtnl_message_route_get_tos(const 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(sd_netlink_message *m, unsigned char *tos) {
return 0;
}
int sd_rtnl_message_route_get_table(sd_netlink_message *m, unsigned char *table) {
int sd_rtnl_message_route_get_table(const 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(sd_netlink_message *m, unsigned char *table)
return 0;
}
int sd_rtnl_message_route_get_dst_prefixlen(sd_netlink_message *m, unsigned char *dst_len) {
int sd_rtnl_message_route_get_dst_prefixlen(const 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(sd_netlink_message *m, unsigned char
return 0;
}
int sd_rtnl_message_route_get_src_prefixlen(sd_netlink_message *m, unsigned char *src_len) {
int sd_rtnl_message_route_get_src_prefixlen(const 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(sd_netlink_message *m, uint8_t *family) {
int sd_rtnl_message_nexthop_get_family(const 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(sd_netlink_message *m, uint8_t *flags) {
int sd_rtnl_message_neigh_get_flags(const 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(sd_netlink_message *m, uint8_t *flags) {
return 0;
}
int sd_rtnl_message_neigh_get_state(sd_netlink_message *m, uint16_t *state) {
int sd_rtnl_message_neigh_get_state(const 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(sd_netlink_message *m, uint16_t *state) {
return 0;
}
int sd_rtnl_message_neigh_get_family(sd_netlink_message *m, int *family) {
int sd_rtnl_message_neigh_get_family(const sd_netlink_message *m, int *family) {
struct ndmsg *ndm;
assert_return(m, -EINVAL);
@ -417,7 +417,7 @@ int sd_rtnl_message_neigh_get_family(sd_netlink_message *m, int *family) {
return 0;
}
int sd_rtnl_message_neigh_get_ifindex(sd_netlink_message *m, int *index) {
int sd_rtnl_message_neigh_get_ifindex(const 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(sd_netlink_message *m, int *family) {
int sd_rtnl_message_addr_get_family(const sd_netlink_message *m, int *family) {
struct ifaddrmsg *ifa;
assert_return(m, -EINVAL);
@ -583,7 +583,7 @@ int sd_rtnl_message_addr_get_family(sd_netlink_message *m, int *family) {
return 0;
}
int sd_rtnl_message_addr_get_prefixlen(sd_netlink_message *m, unsigned char *prefixlen) {
int sd_rtnl_message_addr_get_prefixlen(const 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(sd_netlink_message *m, unsigned char *pre
return 0;
}
int sd_rtnl_message_addr_get_scope(sd_netlink_message *m, unsigned char *scope) {
int sd_rtnl_message_addr_get_scope(const 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(sd_netlink_message *m, unsigned char *scope)
return 0;
}
int sd_rtnl_message_addr_get_flags(sd_netlink_message *m, unsigned char *flags) {
int sd_rtnl_message_addr_get_flags(const 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(sd_netlink_message *m, unsigned char *flags)
return 0;
}
int sd_rtnl_message_addr_get_ifindex(sd_netlink_message *m, int *ifindex) {
int sd_rtnl_message_addr_get_ifindex(const 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(sd_netlink_message *m, int *ifindex) {
int sd_rtnl_message_link_get_ifindex(const sd_netlink_message *m, int *ifindex) {
struct ifinfomsg *ifi;
assert_return(m, -EINVAL);
@ -703,7 +703,7 @@ int sd_rtnl_message_link_get_ifindex(sd_netlink_message *m, int *ifindex) {
return 0;
}
int sd_rtnl_message_link_get_flags(sd_netlink_message *m, unsigned *flags) {
int sd_rtnl_message_link_get_flags(const sd_netlink_message *m, unsigned *flags) {
struct ifinfomsg *ifi;
assert_return(m, -EINVAL);
@ -718,7 +718,7 @@ int sd_rtnl_message_link_get_flags(sd_netlink_message *m, unsigned *flags) {
return 0;
}
int sd_rtnl_message_link_get_type(sd_netlink_message *m, unsigned short *type) {
int sd_rtnl_message_link_get_type(const 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(sd_netlink_message *m, unsigned short *type) {
return 0;
}
int sd_rtnl_message_get_family(sd_netlink_message *m, int *family) {
int sd_rtnl_message_get_family(const 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(sd_netlink_message *m, unsigned char *prefixlen) {
int sd_rtnl_message_addrlabel_get_prefixlen(const 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(sd_netlink_message *m, unsigned char *tos) {
int sd_rtnl_message_routing_policy_rule_get_tos(const 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(sd_netlink_message *m, unsigned char *table) {
int sd_rtnl_message_routing_policy_rule_get_table(const 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(sd_netlink_message *m, unsigned *flags) {
int sd_rtnl_message_routing_policy_rule_get_flags(const 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(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) {
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(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) {
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(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) {
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(sd_netlink *rtnl) {
static bool rtnl_pid_changed(const 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(sd_netlink *rtnl) {
int sd_netlink_get_events(const sd_netlink *rtnl) {
assert_return(rtnl, -EINVAL);
assert_return(!rtnl_pid_changed(rtnl), -ECHILD);
@ -683,7 +683,7 @@ int sd_netlink_get_events(sd_netlink *rtnl) {
return 0;
}
int sd_netlink_get_timeout(sd_netlink *rtnl, uint64_t *timeout_usec) {
int sd_netlink_get_timeout(const sd_netlink *rtnl, uint64_t *timeout_usec) {
struct reply_callback *c;
assert_return(rtnl, -EINVAL);

View File

@ -24,6 +24,7 @@
#include "alloc-util.h"
#include "ask-password-api.h"
#include "def.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-util.h"
@ -34,7 +35,6 @@
#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"

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(sd_netlink *nl);
int sd_netlink_get_timeout(sd_netlink *nl, uint64_t *timeout);
int sd_netlink_get_events(const sd_netlink *nl);
int sd_netlink_get_timeout(const 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(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_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_set_flags(sd_netlink_message *m, uint16_t flags);
int sd_netlink_message_is_broadcast(sd_netlink_message *m);
int sd_netlink_message_is_broadcast(const 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(sd_netlink_message *m, int *family);
int sd_rtnl_message_get_family(const 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(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_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_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(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_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_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(sd_netlink_message *m, unsigned *flags);
int sd_rtnl_message_route_get_family(sd_netlink_message *m, int *family);
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_set_family(sd_netlink_message *m, int family);
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_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_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(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_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(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_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_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(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_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(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_set_table(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_get_table(const 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(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_set_rtm_dst_prefixlen(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_get_rtm_dst_prefixlen(const 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(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_set_flags(sd_netlink_message *m, unsigned flags);
int sd_rtnl_message_routing_policy_rule_get_flags(sd_netlink_message *m, unsigned *flags);
int sd_rtnl_message_routing_policy_rule_get_flags(const 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(sd_netlink *nl, sd_netlink_message *m, sd_genl_family *family);
int sd_genl_message_get_family(const sd_netlink *nl, const 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(sd_netlink_slot *slot, sd_netlink_destroy_t *callback);
int sd_netlink_slot_get_destroy_callback(const 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(sd_netlink_slot *slot);
int sd_netlink_slot_get_floating(const sd_netlink_slot *slot);
int sd_netlink_slot_set_floating(sd_netlink_slot *slot, int b);
int sd_netlink_slot_get_description(sd_netlink_slot *slot, const char **description);
int sd_netlink_slot_get_description(const 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);