platform: prettify and line-wrap route_to_string() print statements

(cherry picked from commit 2170804213)
This commit is contained in:
Thomas Haller 2015-06-22 13:02:23 +02:00
parent e7504376dc
commit 14ef5f6b32

View file

@ -2672,10 +2672,20 @@ nm_platform_ip4_route_to_string (const NMPlatformIP4Route *route)
_to_string_dev (NULL, route->ifindex, str_dev, sizeof (str_dev));
g_snprintf (_nm_platform_to_string_buffer, sizeof (_nm_platform_to_string_buffer), "%s/%d via %s%s metric %"G_GUINT32_FORMAT" mss %"G_GUINT32_FORMAT" src %s%s%s",
s_network, route->plen, s_gateway,
g_snprintf (_nm_platform_to_string_buffer, sizeof (_nm_platform_to_string_buffer),
"%s/%d"
" via %s"
"%s"
" metric %"G_GUINT32_FORMAT
" mss %"G_GUINT32_FORMAT
" src %s" /* source */
"%s%s" /* scope */
"",
s_network, route->plen,
s_gateway,
str_dev,
route->metric, route->mss,
route->metric,
route->mss,
source_to_string (route->source),
route->scope_inv ? " scope " : "",
route->scope_inv ? (rtnl_scope2str (nm_platform_route_scope_inv (route->scope_inv), str_scope, sizeof (str_scope))) : "");
@ -2707,10 +2717,19 @@ nm_platform_ip6_route_to_string (const NMPlatformIP6Route *route)
_to_string_dev (NULL, route->ifindex, str_dev, sizeof (str_dev));
g_snprintf (_nm_platform_to_string_buffer, sizeof (_nm_platform_to_string_buffer), "%s/%d via %s%s metric %"G_GUINT32_FORMAT" mss %"G_GUINT32_FORMAT" src %s",
s_network, route->plen, s_gateway,
g_snprintf (_nm_platform_to_string_buffer, sizeof (_nm_platform_to_string_buffer),
"%s/%d"
" via %s"
"%s"
" metric %"G_GUINT32_FORMAT
" mss %"G_GUINT32_FORMAT
" src %s" /* source */
"",
s_network, route->plen,
s_gateway,
str_dev,
route->metric, route->mss,
route->metric,
route->mss,
source_to_string (route->source));
return _nm_platform_to_string_buffer;
}