summaryrefslogtreecommitdiff
path: root/lib/nexthop.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nexthop.c')
-rw-r--r--lib/nexthop.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/nexthop.c b/lib/nexthop.c
index 9b5a3ee102..e9ffea0a0e 100644
--- a/lib/nexthop.c
+++ b/lib/nexthop.c
@@ -274,3 +274,14 @@ nexthop_next(struct nexthop *nexthop)
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;
+}