summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_te.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-10-16 18:00:38 +0200
committerGitHub <noreply@github.com>2017-10-16 18:00:38 +0200
commit5b8d8894f8ecb401acc9b3986bbb6ce95b3263e9 (patch)
tree077628692cdbae750e26d1b8f237c422bae6519d /ospfd/ospf_te.c
parentMerge pull request #1305 from donaldsharp/workqueue (diff)
parent*: use the FOR_ALL_INTERFACES abstraction from babeld (diff)
downloadfrr-5b8d8894f8ecb401acc9b3986bbb6ce95b3263e9.tar.xz
frr-5b8d8894f8ecb401acc9b3986bbb6ce95b3263e9.zip
Merge pull request #1298 from opensourcerouting/iface-rb-tree
Use rb-trees to store interfaces instead of linked-lists
Diffstat (limited to 'ospfd/ospf_te.c')
-rw-r--r--ospfd/ospf_te.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index 392df5fb4..b13e833af 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -2535,9 +2535,10 @@ DEFUN (show_ip_ospf_mpls_te_link,
"Interface information\n"
"Interface name\n")
{
+ struct vrf *vrf;
int idx_interface = 5;
struct interface *ifp;
- struct listnode *node, *nnode, *n1;
+ struct listnode *node;
char *vrf_name = NULL;
bool all_vrf;
int inst = 0;
@@ -2552,11 +2553,11 @@ DEFUN (show_ip_ospf_mpls_te_link,
/* vrf input is provided could be all or specific vrf*/
if (vrf_name) {
if (all_vrf) {
- for (ALL_LIST_ELEMENTS_RO(om->ospf, n1, ospf)) {
+ for (ALL_LIST_ELEMENTS_RO(om->ospf, node, ospf)) {
if (!ospf->oi_running)
continue;
- for (ALL_LIST_ELEMENTS(vrf_iflist(ospf->vrf_id),
- node, nnode, ifp))
+ vrf = vrf_lookup_by_id(ospf->vrf_id);
+ FOR_ALL_INTERFACES (vrf, ifp)
show_mpls_te_link_sub(vty, ifp);
}
return CMD_SUCCESS;
@@ -2564,18 +2565,18 @@ DEFUN (show_ip_ospf_mpls_te_link,
ospf = ospf_lookup_by_inst_name (inst, vrf_name);
if (ospf == NULL || !ospf->oi_running)
return CMD_SUCCESS;
- for (ALL_LIST_ELEMENTS(vrf_iflist(ospf->vrf_id), node,
- nnode, ifp))
+ vrf = vrf_lookup_by_id(ospf->vrf_id);
+ FOR_ALL_INTERFACES (vrf, ifp)
show_mpls_te_link_sub(vty, ifp);
return CMD_SUCCESS;
}
/* Show All Interfaces. */
if (argc == 5) {
- for (ALL_LIST_ELEMENTS_RO(om->ospf, n1, ospf)) {
+ for (ALL_LIST_ELEMENTS_RO(om->ospf, node, ospf)) {
if (!ospf->oi_running)
continue;
- for (ALL_LIST_ELEMENTS(vrf_iflist(ospf->vrf_id), node,
- nnode, ifp))
+ vrf = vrf_lookup_by_id(ospf->vrf_id);
+ FOR_ALL_INTERFACES (vrf, ifp)
show_mpls_te_link_sub(vty, ifp);
}
}