Signed-off-by: Christian Franke <chris@opensourcerouting.org>
return NULL;
}
+
+unsigned int
+nexthop_level(struct nexthop *nexthop)
+{
+ unsigned int rv = 0;
+
+ for (struct nexthop *par = nexthop->rparent; par; par = par->rparent)
+ rv++;
+
+ return rv;
+}
extern const char * nexthop2str (struct nexthop *nexthop, char *str, int size);
extern struct nexthop *nexthop_next(struct nexthop *nexthop);
+extern unsigned int nexthop_level(struct nexthop *nexthop);
#endif /*_LIB_NEXTHOP_H */
vty_out (vty, " %c%*c",
CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
? '*' : ' ',
- len - 3 + (2 * (nexthop->rparent ? 1 : 0)), ' ');
+ len - 3 + (2 * nexthop_level(nexthop)), ' ');
switch (nexthop->type)
{