Commit 0673b965 authored by Matthieu Boutier's avatar Matthieu Boutier Committed by Juliusz Chroboczek

Add local interface source-specific printing.

It also update the route's id.
parent 56755718
...@@ -185,12 +185,14 @@ local_notify_xroute_1(int s, struct xroute *xroute, int kind) ...@@ -185,12 +185,14 @@ local_notify_xroute_1(int s, struct xroute *xroute, int kind)
{ {
char buf[512]; char buf[512];
int rc; int rc;
const char *dst_prefix = format_prefix(xroute->prefix,
xroute->plen);
const char *src_prefix = format_prefix(xroute->src_prefix,
xroute->src_plen);
rc = snprintf(buf, 512, "%s xroute %s prefix %s metric %d\n", rc = snprintf(buf, 512, "%s xroute %s-%s prefix %s from %s metric %d\n",
local_kind(kind), local_kind(kind), dst_prefix, src_prefix,
format_prefix(xroute->prefix, xroute->plen), dst_prefix, src_prefix, xroute->metric);
format_prefix(xroute->prefix, xroute->plen),
xroute->metric);
if(rc < 0 || rc >= 512) if(rc < 0 || rc >= 512)
goto fail; goto fail;
...@@ -218,14 +220,17 @@ local_notify_route_1(int s, struct babel_route *route, int kind) ...@@ -218,14 +220,17 @@ local_notify_route_1(int s, struct babel_route *route, int kind)
{ {
char buf[512]; char buf[512];
int rc; int rc;
const char *dst_prefix = format_prefix(route->src->prefix,
route->src->plen);
const char *src_prefix = format_prefix(route->src->src_prefix,
route->src->src_plen);
rc = snprintf(buf, 512, rc = snprintf(buf, 512,
"%s route %s-%lx prefix %s installed %s " "%s route %s-%lx-%s prefix %s from %s installed %s "
"id %s metric %d refmetric %d via %s if %s\n", "id %s metric %d refmetric %d via %s if %s\n",
local_kind(kind), local_kind(kind),
format_prefix(route->src->prefix, route->src->plen), dst_prefix, (unsigned long)route->neigh, src_prefix,
(unsigned long)route->neigh, dst_prefix, src_prefix,
format_prefix(route->src->prefix, route->src->plen),
route->installed ? "yes" : "no", route->installed ? "yes" : "no",
format_eui64(route->src->id), format_eui64(route->src->id),
route_metric(route), route->refmetric, route_metric(route), route->refmetric,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment