#include "util.h"
#include "refcnt.h"
+#include "missing.h"
#include "sd-rtnl.h"
#include "rtnl-util.h"
return 0;
}
-int sd_rtnl_message_new_route(sd_rtnl *rtnl, uint16_t nlmsg_type,
- unsigned char rtm_family,
- sd_rtnl_message **ret) {
+int sd_rtnl_message_new_route(sd_rtnl *rtnl, sd_rtnl_message **ret,
+ uint16_t nlmsg_type, unsigned char rtm_family) {
struct rtmsg *rtm;
int r;
return 0;
}
-int sd_rtnl_message_new_link(sd_rtnl *rtnl, uint16_t nlmsg_type, int index,
- sd_rtnl_message **ret) {
+int sd_rtnl_message_new_link(sd_rtnl *rtnl, sd_rtnl_message **ret,
+ uint16_t nlmsg_type, int index) {
struct ifinfomsg *ifi;
int r;
return 0;
}
-int sd_rtnl_message_new_addr(sd_rtnl *rtnl, uint16_t nlmsg_type, int index,
- unsigned char family,
- sd_rtnl_message **ret) {
+int sd_rtnl_message_new_addr(sd_rtnl *rtnl, sd_rtnl_message **ret,
+ uint16_t nlmsg_type, int index,
+ unsigned char family) {
struct ifaddrmsg *ifa;
int r;
break;
else
return -ENOTSUP;
- break;
+
default:
return -ENOTSUP;
}
if (k > 0)
switch (m->hdr->nlmsg_type) {
- struct ifinfomsg *ifi;
- struct ifaddrmsg *ifa;
- struct rtmsg *rtm;
-
/* check that the size matches the message type */
case NLMSG_ERROR:
if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr)))
if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifinfomsg)))
k = -EIO;
else {
+ struct ifinfomsg *ifi;
+
ifi = NLMSG_DATA(m->hdr);
UPDATE_RTA(m, IFLA_RTA(ifi));
}
if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifaddrmsg)))
k = -EIO;
else {
+ struct ifaddrmsg *ifa;
+
ifa = NLMSG_DATA(m->hdr);
UPDATE_RTA(m, IFA_RTA(ifa));
}
if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct rtmsg)))
k = -EIO;
else {
+ struct rtmsg *rtm;
+
rtm = NLMSG_DATA(m->hdr);
UPDATE_RTA(m, RTM_RTA(rtm));
}