diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2020-02-21 02:35:50 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2020-02-21 02:35:50 +0100 |
commit | 22c3cf955dbbb65aa29e322efa70dabb749f0232 (patch) | |
tree | 85fa6ce3ab0334d5556eadb7358c176aa4a733c1 /nest/rt-fib.c | |
parent | 3343088a7164a54b1e6c6cf9648d8036a61e9827 (diff) |
RIP: Demand circuit support (RFC 2091)
Diffstat (limited to 'nest/rt-fib.c')
-rw-r--r-- | nest/rt-fib.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/nest/rt-fib.c b/nest/rt-fib.c index 76a86e6e..a7f70371 100644 --- a/nest/rt-fib.c +++ b/nest/rt-fib.c @@ -584,6 +584,40 @@ found: fit_put(i, n); } +void +fit_put_end(struct fib_iterator *i) +{ + i->prev = i->next = NULL; + i->node = NULL; + i->hash = ~0 - 1; +} + +void +fit_copy(struct fib *f, struct fib_iterator *dst, struct fib_iterator *src) +{ + struct fib_iterator *nxt = src->next; + + fit_get(f, dst); + + if (!src->prev) + { + /* We are at the end */ + fit_put_end(dst); + return; + } + + src->next = dst; + dst->prev = src; + + dst->next = nxt; + if (nxt) + nxt->prev = dst; + + dst->node = src->node; + dst->hash = src->hash; +} + + #ifdef DEBUGGING /** |