summaryrefslogtreecommitdiff
path: root/ripd/rip_interface.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-10-06 15:25:58 -0300
committerRenato Westphal <renato@opensourcerouting.org>2017-10-10 09:05:46 -0300
commit451fda4f9a2fadc24328e640077780a00ffcdac2 (patch)
treee5cb1b11502a6c525698d188ccc94adfea4515a1 /ripd/rip_interface.c
parenta6ba931e0bd4adddbde35dae585d2ffa5e9c78db (diff)
*: use the FOR_ALL_INTERFACES abstraction from babeld
This improves code readability and also future-proofs our codebase against new changes in the data structure used to store interfaces. The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but for now only babeld is using it. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd/rip_interface.c')
-rw-r--r--ripd/rip_interface.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index 21950c9f2b..9282896c28 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -339,7 +339,7 @@ int if_check_address(struct in_addr addr)
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name) {
+ FOR_ALL_INTERFACES (vrf, ifp) {
struct listnode *cnode;
struct connected *connected;
@@ -493,7 +493,7 @@ void rip_interfaces_clean(void)
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, ifp)
rip_interface_clean(ifp->info);
}
@@ -545,7 +545,7 @@ void rip_interfaces_reset(void)
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, ifp)
rip_interface_reset(ifp->info);
}
@@ -586,7 +586,7 @@ void rip_if_down_all()
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, ifp)
rip_if_down(ifp);
}
@@ -981,7 +981,7 @@ void rip_enable_apply_all()
struct interface *ifp;
/* Check each interface. */
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, ifp)
rip_enable_apply(ifp);
}
@@ -1094,7 +1094,7 @@ static void rip_passive_interface_apply_all(void)
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, ifp)
rip_passive_interface_apply(ifp);
}
@@ -1731,7 +1731,7 @@ static int rip_interface_config_write(struct vty *vty)
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name) {
+ FOR_ALL_INTERFACES (vrf, ifp) {
struct rip_interface *ri;
ri = ifp->info;