diff options
Diffstat (limited to 'zebra/rib.h')
| -rw-r--r-- | zebra/rib.h | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/zebra/rib.h b/zebra/rib.h index 88f2bf39ab..999266241a 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -178,52 +178,6 @@ typedef struct rib_dest_t_ #define RNODE_FOREACH_RE_SAFE(rn, re, next) \ RE_DEST_FOREACH_ROUTE_SAFE (rib_dest_from_rnode (rn), re, next) -/* The following for loop allows to iterate over the nexthop - * structure of routes. - * - * We have to maintain quite a bit of state: - * - * nexthop: The pointer to the current nexthop, either in the - * top-level chain or in the resolved chain of ni. - * tnexthop: The pointer to the current nexthop in the top-level - * nexthop chain. - * recursing: Information if nh currently is in the top-level chain - * (0) or in a resolved chain (1). - * - * Initialization: Set `nexthop' and `tnexthop' to the head of the - * top-level chain. As nexthop is in the top level chain, set recursing - * to 0. - * - * Iteration check: Check that the `nexthop' pointer is not NULL. - * - * Iteration step: This is the tricky part. Check if `nexthop' has - * NEXTHOP_FLAG_RECURSIVE set. If yes, this implies that `nexthop' is in - * the top level chain and has at least one nexthop attached to - * `nexthop->resolved'. As we want to descend into `nexthop->resolved', - * set `recursing' to 1 and set `nexthop' to `nexthop->resolved'. - * `tnexthop' is left alone in that case so we can remember which nexthop - * in the top level chain we are currently handling. - * - * If NEXTHOP_FLAG_RECURSIVE is not set, `nexthop' will progress in its - * current chain. If we are recursing, `nexthop' will be set to - * `nexthop->next' and `tnexthop' will be left alone. If we are not - * recursing, both `tnexthop' and `nexthop' will be set to `nexthop->next' - * as we are progressing in the top level chain. - * If we encounter `nexthop->next == NULL', we will clear the `recursing' - * flag as we arived either at the end of the resolved chain or at the end - * of the top level chain. In both cases, we set `tnexthop' and `nexthop' - * to `tnexthop->next', progressing to the next position in the top-level - * chain and possibly to its end marked by NULL. - */ -#define ALL_NEXTHOPS_RO(head, nexthop, tnexthop, recursing) \ - (tnexthop) = (nexthop) = (head), (recursing) = 0; \ - (nexthop); \ - (nexthop) = CHECK_FLAG((nexthop)->flags, NEXTHOP_FLAG_RECURSIVE) \ - ? (((recursing) = 1), (nexthop)->resolved) \ - : ((nexthop)->next ? ((recursing) ? (nexthop)->next \ - : ((tnexthop) = (nexthop)->next)) \ - : (((recursing) = 0),((tnexthop) = (tnexthop)->next))) - #if defined (HAVE_RTADV) /* Structure which hold status of router advertisement. */ struct rtadv |
