summaryrefslogtreecommitdiff
path: root/ospfd/ospf_interface.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-05-15 21:32:50 +0200
committerDavid Lamparter <equinox@diac24.net>2019-05-15 21:32:50 +0200
commitcd4f050587c444509ec286247f95606fe6f7f756 (patch)
treedb21369925a50a674b5fa2426737c45209a031d5 /ospfd/ospf_interface.c
parent0189e6d73cdbabf2b320b40248d75db1791d7424 (diff)
parent33e56da60666cd26ca18787104e721b9df9ed4a2 (diff)
Merge tag 'frr-6.0.3' into debian/master
FRRouting Release 6.0.3
Diffstat (limited to 'ospfd/ospf_interface.c')
-rw-r--r--ospfd/ospf_interface.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 24584f6713..7d77c38660 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -920,6 +920,23 @@ static void ospf_vl_if_delete(struct ospf_vl_data *vl_data)
vlink_count--;
}
+/* for a defined area, count the number of configured vl
+ */
+int ospf_vl_count(struct ospf *ospf, struct ospf_area *area)
+{
+ int count = 0;
+ struct ospf_vl_data *vl_data;
+ struct listnode *node;
+
+ for (ALL_LIST_ELEMENTS_RO(ospf->vlinks, node, vl_data)) {
+ if (area
+ && !IPV4_ADDR_SAME(&vl_data->vl_area_id, &area->area_id))
+ continue;
+ count++;
+ }
+ return count;
+}
+
/* Look up vl_data for given peer, optionally qualified to be in the
* specified area. NULL area returns first found..
*/