summaryrefslogtreecommitdiff
path: root/lib/if.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-02-14 08:14:31 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2020-02-14 08:15:33 -0500
commitac2914d3261a78cf78eec7a6e20ebbe42bb57150 (patch)
tree860c25bd3befc650ec3e7ceb6cdb43604d90cbce /lib/if.c
parent547b989938068d9be646a79c60f87296fdba3558 (diff)
lib: Format according to our standard
A couple of functions needed to be reformated. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c72
1 files changed, 34 insertions, 38 deletions
diff --git a/lib/if.c b/lib/if.c
index 0e9471923f..c101794486 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -811,27 +811,25 @@ DEFUN (show_address,
"address\n"
VRF_CMD_HELP_STR)
{
- int idx_vrf = 3;
- struct listnode *node;
- struct interface *ifp;
- struct connected *ifc;
- struct prefix *p;
- vrf_id_t vrf_id = VRF_DEFAULT;
+ int idx_vrf = 3;
+ struct listnode *node;
+ struct interface *ifp;
+ struct connected *ifc;
+ struct prefix *p;
+ vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 2)
- VRF_GET_ID (vrf_id, argv[idx_vrf]->arg);
+ if (argc > 2)
+ VRF_GET_ID (vrf_id, argv[idx_vrf]->arg);
- FOR_ALL_INTERFACES (vrf, ifp)
- {
- for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc))
- {
- p = ifc->address;
+ FOR_ALL_INTERFACES (vrf, ifp) {
+ for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc)) {
+ p = ifc->address;
- if (p->family == AF_INET)
- vty_out (vty, "%s/%d\n", inet_ntoa (p->u.prefix4), p->prefixlen);
+ if (p->family == AF_INET)
+ vty_out (vty, "%s/%d\n", inet_ntoa (p->u.prefix4), p->prefixlen);
+ }
}
- }
- return CMD_SUCCESS;
+ return CMD_SUCCESS;
}
DEFUN (show_address_vrf_all,
@@ -841,31 +839,29 @@ DEFUN (show_address_vrf_all,
"address\n"
VRF_ALL_CMD_HELP_STR)
{
- struct vrf *vrf;
- struct listnode *node;
- struct interface *ifp;
- struct connected *ifc;
- struct prefix *p;
+ struct vrf *vrf;
+ struct listnode *node;
+ struct interface *ifp;
+ struct connected *ifc;
+ struct prefix *p;
- RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
- {
- if (RB_EMPTY (if_name_head, &vrf->ifaces_by_name))
- continue;
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ {
+ if (RB_EMPTY (if_name_head, &vrf->ifaces_by_name))
+ continue;
- vty_out (vty, "\nVRF %u\n\n", vrf->vrf_id);
+ vty_out (vty, "\nVRF %u\n\n", vrf->vrf_id);
- FOR_ALL_INTERFACES (vrf, ifp)
- {
- for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc))
- {
- p = ifc->address;
+ FOR_ALL_INTERFACES (vrf, ifp) {
+ for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc)) {
+ p = ifc->address;
- if (p->family == AF_INET)
- vty_out (vty, "%s/%d\n", inet_ntoa (p->u.prefix4), p->prefixlen);
- }
- }
- }
- return CMD_SUCCESS;
+ if (p->family == AF_INET)
+ vty_out (vty, "%s/%d\n", inet_ntoa (p->u.prefix4), p->prefixlen);
+ }
+ }
+ }
+ return CMD_SUCCESS;
}
#endif