mirror of
https://github.com/systemd/systemd.git
synced 2024-10-27 01:55:22 +03:00
sd-netlink: drop unnecessary forward declaration
This commit is contained in:
parent
c03916164d
commit
04ab97a829
@ -26,7 +26,6 @@ static const genl_family genl_families[] = {
|
||||
int sd_genl_socket_open(sd_netlink **ret) {
|
||||
return netlink_open_family(ret, NETLINK_GENERIC);
|
||||
}
|
||||
static int lookup_id(sd_netlink *nl, sd_genl_family_t family, uint16_t *id);
|
||||
|
||||
static int genl_message_new(sd_netlink *nl, sd_genl_family_t family, uint16_t nlmsg_type, uint8_t cmd, sd_netlink_message **ret) {
|
||||
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *m = NULL;
|
||||
@ -73,17 +72,6 @@ static int genl_message_new(sd_netlink *nl, sd_genl_family_t family, uint16_t nl
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sd_genl_message_new(sd_netlink *nl, sd_genl_family_t family, uint8_t cmd, sd_netlink_message **ret) {
|
||||
uint16_t id;
|
||||
int r;
|
||||
|
||||
r = lookup_id(nl, family, &id);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return genl_message_new(nl, family, id, cmd, ret);
|
||||
}
|
||||
|
||||
static int lookup_id(sd_netlink *nl, sd_genl_family_t family, uint16_t *id) {
|
||||
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL, *reply = NULL;
|
||||
uint16_t u;
|
||||
@ -129,6 +117,17 @@ static int lookup_id(sd_netlink *nl, sd_genl_family_t family, uint16_t *id) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sd_genl_message_new(sd_netlink *nl, sd_genl_family_t family, uint8_t cmd, sd_netlink_message **ret) {
|
||||
uint16_t id;
|
||||
int r;
|
||||
|
||||
r = lookup_id(nl, family, &id);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return genl_message_new(nl, family, id, cmd, ret);
|
||||
}
|
||||
|
||||
int nlmsg_type_to_genl_family(const sd_netlink *nl, uint16_t type, sd_genl_family_t *ret) {
|
||||
void *p;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user