diff options
author | Tom Gundersen <teg@jklm.no> | 2014-07-16 13:17:10 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-07-21 13:32:27 +0200 |
commit | aa9f11405829fd4755fef28602a7167dba3ddc89 (patch) | |
tree | f86bcda9b90b0e72b1f1e7ffe3f50e9c5d736612 /src/network/networkd-netdev-dummy.c | |
parent | 653912918f594ebbca46806b302ef6b477402575 (diff) |
networkd: netdev - split NetDev struct into per-kind structs
Similarly to how unit types work.
Diffstat (limited to 'src/network/networkd-netdev-dummy.c')
-rw-r--r-- | src/network/networkd-netdev-dummy.c | 56 |
1 files changed, 3 insertions, 53 deletions
diff --git a/src/network/networkd-netdev-dummy.c b/src/network/networkd-netdev-dummy.c index 2f861a73e9..01c10a2d73 100644 --- a/src/network/networkd-netdev-dummy.c +++ b/src/network/networkd-netdev-dummy.c @@ -28,58 +28,8 @@ #include "sd-rtnl.h" #include "networkd-netdev-dummy.h" -static int netdev_dummy_fill_message_create(NetDev *netdev, sd_rtnl_message *m) { - int r; - - assert(netdev); - assert(netdev->ifname); - assert(m); - - r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname); - if (r < 0) { - log_error_netdev(netdev, - "Could not append IFLA_IFNAME, attribute: %s", - strerror(-r)); - return r; - } - - if (netdev->mac) { - r = sd_rtnl_message_append_ether_addr(m, IFLA_ADDRESS, netdev->mac); - if (r < 0) { - log_error_netdev(netdev, - "Could not append IFLA_ADDRESS attribute: %s", - strerror(-r)); - return r; - } - } - - r = sd_rtnl_message_open_container(m, IFLA_LINKINFO); - if (r < 0) { - log_error_netdev(netdev, - "Could not append IFLA_LINKINFO attribute: %s", - strerror(-r)); - return r; - } - - r = sd_rtnl_message_open_container_union(m, IFLA_INFO_DATA, "dummy"); - if (r < 0) { - log_error_netdev(netdev, - "Could not append IFLA_INFO_DATA attribute: %s", - strerror(-r)); - return r; - } - - r = sd_rtnl_message_close_container(m); - if (r < 0) { - log_error_netdev(netdev, - "Could not append IFLA_LINKINFO attribute: %s", - strerror(-r)); - return r; - } - - return r; -} - const NetDevVTable dummy_vtable = { - .fill_message_create = netdev_dummy_fill_message_create, + .object_size = sizeof(Dummy), + .sections = "Match\0NetDev\0", + .create_type = NETDEV_CREATE_INDEPENDENT, }; |