diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2015-06-14 13:07:20 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2015-06-14 13:07:20 +0200 |
commit | 6113cec066cd673a60e3bb32b9bd1280e86b2490 (patch) | |
tree | b1ee85e99920a1c8c99924497bdac8e1b662eb50 /src/network/networkd-route.c | |
parent | d11a6028e399ffb57a75bb3c45cab06d49167a55 (diff) | |
parent | b95cc756de7a27f7546e42dd9acf6da0669da402 (diff) |
Merge pull request #189 from teg/rtnl-rename
Rename sd_rtnl to sd_netlink to prepare for further netlink-protocol support. Anything rtnl specific still uses the sd_rtnl prefix, but the generic parts (including the bus and message objects) are now called sd_netlink.
Diffstat (limited to 'src/network/networkd-route.c')
-rw-r--r-- | src/network/networkd-route.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 7f110a5217..31b10c458d 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -97,8 +97,8 @@ void route_free(Route *route) { } int route_drop(Route *route, Link *link, - sd_rtnl_message_handler_t callback) { - _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL; + sd_netlink_message_handler_t callback) { + _cleanup_netlink_message_unref_ sd_netlink_message *req = NULL; int r; assert(link); @@ -115,18 +115,18 @@ int route_drop(Route *route, Link *link, if (!in_addr_is_null(route->family, &route->in_addr)) { if (route->family == AF_INET) - r = sd_rtnl_message_append_in_addr(req, RTA_GATEWAY, &route->in_addr.in); + r = sd_netlink_message_append_in_addr(req, RTA_GATEWAY, &route->in_addr.in); else if (route->family == AF_INET6) - r = sd_rtnl_message_append_in6_addr(req, RTA_GATEWAY, &route->in_addr.in6); + r = sd_netlink_message_append_in6_addr(req, RTA_GATEWAY, &route->in_addr.in6); if (r < 0) return log_error_errno(r, "Could not append RTA_GATEWAY attribute: %m"); } if (route->dst_prefixlen) { if (route->family == AF_INET) - r = sd_rtnl_message_append_in_addr(req, RTA_DST, &route->dst_addr.in); + r = sd_netlink_message_append_in_addr(req, RTA_DST, &route->dst_addr.in); else if (route->family == AF_INET6) - r = sd_rtnl_message_append_in6_addr(req, RTA_DST, &route->dst_addr.in6); + r = sd_netlink_message_append_in6_addr(req, RTA_DST, &route->dst_addr.in6); if (r < 0) return log_error_errno(r, "Could not append RTA_DST attribute: %m"); @@ -137,9 +137,9 @@ int route_drop(Route *route, Link *link, if (route->src_prefixlen) { if (route->family == AF_INET) - r = sd_rtnl_message_append_in_addr(req, RTA_SRC, &route->src_addr.in); + r = sd_netlink_message_append_in_addr(req, RTA_SRC, &route->src_addr.in); else if (route->family == AF_INET6) - r = sd_rtnl_message_append_in6_addr(req, RTA_SRC, &route->src_addr.in6); + r = sd_netlink_message_append_in6_addr(req, RTA_SRC, &route->src_addr.in6); if (r < 0) return log_error_errno(r, "Could not append RTA_DST attribute: %m"); @@ -150,9 +150,9 @@ int route_drop(Route *route, Link *link, if (!in_addr_is_null(route->family, &route->prefsrc_addr)) { if (route->family == AF_INET) - r = sd_rtnl_message_append_in_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in); + r = sd_netlink_message_append_in_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in); else if (route->family == AF_INET6) - r = sd_rtnl_message_append_in6_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in6); + r = sd_netlink_message_append_in6_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in6); if (r < 0) return log_error_errno(r, "Could not append RTA_PREFSRC attribute: %m"); } @@ -161,15 +161,15 @@ int route_drop(Route *route, Link *link, if (r < 0) return log_error_errno(r, "Could not set scope: %m"); - r = sd_rtnl_message_append_u32(req, RTA_PRIORITY, route->metrics); + r = sd_netlink_message_append_u32(req, RTA_PRIORITY, route->metrics); if (r < 0) return log_error_errno(r, "Could not append RTA_PRIORITY attribute: %m"); - r = sd_rtnl_message_append_u32(req, RTA_OIF, link->ifindex); + r = sd_netlink_message_append_u32(req, RTA_OIF, link->ifindex); if (r < 0) return log_error_errno(r, "Could not append RTA_OIF attribute: %m"); - r = sd_rtnl_call_async(link->manager->rtnl, req, callback, link, 0, NULL); + r = sd_netlink_call_async(link->manager->rtnl, req, callback, link, 0, NULL); if (r < 0) return log_error_errno(r, "Could not send rtnetlink message: %m"); @@ -179,8 +179,8 @@ int route_drop(Route *route, Link *link, } int route_configure(Route *route, Link *link, - sd_rtnl_message_handler_t callback) { - _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL; + sd_netlink_message_handler_t callback) { + _cleanup_netlink_message_unref_ sd_netlink_message *req = NULL; int r; assert(link); @@ -197,18 +197,18 @@ int route_configure(Route *route, Link *link, if (!in_addr_is_null(route->family, &route->in_addr)) { if (route->family == AF_INET) - r = sd_rtnl_message_append_in_addr(req, RTA_GATEWAY, &route->in_addr.in); + r = sd_netlink_message_append_in_addr(req, RTA_GATEWAY, &route->in_addr.in); else if (route->family == AF_INET6) - r = sd_rtnl_message_append_in6_addr(req, RTA_GATEWAY, &route->in_addr.in6); + r = sd_netlink_message_append_in6_addr(req, RTA_GATEWAY, &route->in_addr.in6); if (r < 0) return log_error_errno(r, "Could not append RTA_GATEWAY attribute: %m"); } if (route->dst_prefixlen) { if (route->family == AF_INET) - r = sd_rtnl_message_append_in_addr(req, RTA_DST, &route->dst_addr.in); + r = sd_netlink_message_append_in_addr(req, RTA_DST, &route->dst_addr.in); else if (route->family == AF_INET6) - r = sd_rtnl_message_append_in6_addr(req, RTA_DST, &route->dst_addr.in6); + r = sd_netlink_message_append_in6_addr(req, RTA_DST, &route->dst_addr.in6); if (r < 0) return log_error_errno(r, "Could not append RTA_DST attribute: %m"); @@ -219,9 +219,9 @@ int route_configure(Route *route, Link *link, if (route->src_prefixlen) { if (route->family == AF_INET) - r = sd_rtnl_message_append_in_addr(req, RTA_SRC, &route->src_addr.in); + r = sd_netlink_message_append_in_addr(req, RTA_SRC, &route->src_addr.in); else if (route->family == AF_INET6) - r = sd_rtnl_message_append_in6_addr(req, RTA_SRC, &route->src_addr.in6); + r = sd_netlink_message_append_in6_addr(req, RTA_SRC, &route->src_addr.in6); if (r < 0) return log_error_errno(r, "Could not append RTA_SRC attribute: %m"); @@ -232,9 +232,9 @@ int route_configure(Route *route, Link *link, if (!in_addr_is_null(route->family, &route->prefsrc_addr)) { if (route->family == AF_INET) - r = sd_rtnl_message_append_in_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in); + r = sd_netlink_message_append_in_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in); else if (route->family == AF_INET6) - r = sd_rtnl_message_append_in6_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in6); + r = sd_netlink_message_append_in6_addr(req, RTA_PREFSRC, &route->prefsrc_addr.in6); if (r < 0) return log_error_errno(r, "Could not append RTA_PREFSRC attribute: %m"); } @@ -243,15 +243,15 @@ int route_configure(Route *route, Link *link, if (r < 0) return log_error_errno(r, "Could not set scope: %m"); - r = sd_rtnl_message_append_u32(req, RTA_PRIORITY, route->metrics); + r = sd_netlink_message_append_u32(req, RTA_PRIORITY, route->metrics); if (r < 0) return log_error_errno(r, "Could not append RTA_PRIORITY attribute: %m"); - r = sd_rtnl_message_append_u32(req, RTA_OIF, link->ifindex); + r = sd_netlink_message_append_u32(req, RTA_OIF, link->ifindex); if (r < 0) return log_error_errno(r, "Could not append RTA_OIF attribute: %m"); - r = sd_rtnl_call_async(link->manager->rtnl, req, callback, link, 0, NULL); + r = sd_netlink_call_async(link->manager->rtnl, req, callback, link, 0, NULL); if (r < 0) return log_error_errno(r, "Could not send rtnetlink message: %m"); |