chiark / gitweb /
rtnl: simplify link_new()
[elogind.git] / src / libsystemd-rtnl / test-rtnl.c
index 6c34a8537f6b7b40437989723a03b5888a608566..409a0fa7b25e9dc318ca07547fea5cca36792896 100644 (file)
@@ -37,7 +37,7 @@ static void test_link_configure(sd_rtnl *rtnl, int ifindex) {
         void *data;
 
         /* we'd really like to test NEWLINK, but let's not mess with the running kernel */
-        assert(sd_rtnl_message_link_new(RTM_GETLINK, ifindex, 0, 0, &message) >= 0);
+        assert(sd_rtnl_message_link_new(RTM_GETLINK, ifindex, &message) >= 0);
         assert(sd_rtnl_message_append(message, IFLA_IFNAME, name) >= 0);
         assert(sd_rtnl_message_append(message, IFLA_ADDRESS, ether_aton(mac)) >= 0);
         assert(sd_rtnl_message_append(message, IFLA_MTU, &mtu) >= 0);
@@ -142,7 +142,7 @@ static void test_event_loop(int ifindex) {
         assert(ifname);
 
         assert(sd_rtnl_open(0, &rtnl) >= 0);
-        assert(sd_rtnl_message_link_new(RTM_GETLINK, ifindex, 0, 0, &m) >= 0);
+        assert(sd_rtnl_message_link_new(RTM_GETLINK, ifindex, &m) >= 0);
 
         assert(sd_rtnl_call_async(rtnl, m, &link_handler, ifname, 0, NULL) >= 0);
 
@@ -176,7 +176,7 @@ static void test_async(int ifindex) {
 
         assert(sd_rtnl_open(0, &rtnl) >= 0);
 
-        assert(sd_rtnl_message_link_new(RTM_GETLINK, ifindex, 0, 0, &m) >= 0);
+        assert(sd_rtnl_message_link_new(RTM_GETLINK, ifindex, &m) >= 0);
 
         assert(sd_rtnl_call_async(rtnl, m, &link_handler, ifname, 0, &serial) >= 0);
 
@@ -191,8 +191,8 @@ static void test_pipe(int ifindex) {
 
         assert(sd_rtnl_open(0, &rtnl) >= 0);
 
-        assert(sd_rtnl_message_link_new(RTM_GETLINK, ifindex, 0, 0, &m1) >= 0);
-        assert(sd_rtnl_message_link_new(RTM_GETLINK, ifindex, 0, 0, &m2) >= 0);
+        assert(sd_rtnl_message_link_new(RTM_GETLINK, ifindex, &m1) >= 0);
+        assert(sd_rtnl_message_link_new(RTM_GETLINK, ifindex, &m2) >= 0);
 
         counter ++;
         assert(sd_rtnl_call_async(rtnl, m1, &pipe_handler, &counter, 0, NULL) >= 0);
@@ -211,7 +211,7 @@ static void test_container(void) {
         uint16_t type;
         void *data;
 
-        assert(sd_rtnl_message_link_new(RTM_NEWLINK, 0, 0, 0, &m) >= 0);
+        assert(sd_rtnl_message_link_new(RTM_NEWLINK, 0, &m) >= 0);
 
         assert(sd_rtnl_message_open_container(m, IFLA_LINKINFO) >= 0);
         assert(sd_rtnl_message_open_container(m, IFLA_LINKINFO) == -EINVAL);
@@ -275,7 +275,7 @@ int main(void) {
 
         test_link_configure(rtnl, if_loopback);
 
-        assert(sd_rtnl_message_link_new(RTM_GETLINK, if_loopback, 0, 0, &m) >= 0);
+        assert(sd_rtnl_message_link_new(RTM_GETLINK, if_loopback, &m) >= 0);
         assert(m);
 
         assert(sd_rtnl_message_get_type(m, &type) >= 0);
@@ -294,7 +294,7 @@ int main(void) {
         assert((m = sd_rtnl_message_unref(m)) == NULL);
         assert((r = sd_rtnl_message_unref(r)) == NULL);
 
-        assert(sd_rtnl_message_link_new(RTM_GETLINK, if_loopback, 0, 0, &m) >= 0);
+        assert(sd_rtnl_message_link_new(RTM_GETLINK, if_loopback, &m) >= 0);
         assert(m);
 
         assert(sd_rtnl_message_append(m, IFLA_MTU, &mtu) >= 0);