summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-04-14 18:07:34 +0200
committerTom Gundersen <teg@jklm.no>2014-04-19 16:47:52 +0200
commit6e20c8f8fa095b28ef4e08d9dae494abed6f275f (patch)
tree7f1045e6e4b0693e4bc835f2ec999324bbdce623
parent7182867e7970741d294237aa83022fcb2774af69 (diff)
sd-rtnl: message - expose DUMP flag in the api
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c16
-rw-r--r--src/systemd/sd-rtnl.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index 17b928059f..3362958f36 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -213,6 +213,22 @@ int sd_rtnl_message_new_link(sd_rtnl *rtnl, sd_rtnl_message **ret,
return 0;
}
+int sd_rtnl_message_request_dump(sd_rtnl_message *m, int dump) {
+ assert_return(m, -EINVAL);
+ assert_return(m->hdr, -EINVAL);
+ assert_return(m->hdr->nlmsg_type == RTM_GETLINK ||
+ m->hdr->nlmsg_type == RTM_GETADDR ||
+ m->hdr->nlmsg_type == RTM_GETROUTE,
+ -EINVAL);
+
+ if (dump)
+ m->hdr->nlmsg_flags |= NLM_F_DUMP;
+ else
+ m->hdr->nlmsg_flags &= ~NLM_F_DUMP;
+
+ return 0;
+}
+
int sd_rtnl_message_addr_set_prefixlen(sd_rtnl_message *m, unsigned char prefixlen) {
struct ifaddrmsg *ifa;
diff --git a/src/systemd/sd-rtnl.h b/src/systemd/sd-rtnl.h
index 6fbaee092c..93f5ab9b6c 100644
--- a/src/systemd/sd-rtnl.h
+++ b/src/systemd/sd-rtnl.h
@@ -77,6 +77,7 @@ int sd_rtnl_message_new_route(sd_rtnl *rtnl, sd_rtnl_message **ret, uint16_t nlm
sd_rtnl_message *sd_rtnl_message_ref(sd_rtnl_message *m);
sd_rtnl_message *sd_rtnl_message_unref(sd_rtnl_message *m);
+int sd_rtnl_message_request_dump(sd_rtnl_message *m, int dump);
int sd_rtnl_message_get_errno(sd_rtnl_message *m);
int sd_rtnl_message_get_type(sd_rtnl_message *m, uint16_t *type);
int sd_rtnl_message_is_broadcast(sd_rtnl_message *m);