summaryrefslogtreecommitdiff
path: root/nest/rt.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-08-31 11:58:27 +0200
committerMaria Matejka <mq@ucw.cz>2022-09-01 18:46:40 +0200
commit7450eea071941c683da158d6dfe8365288eed5b8 (patch)
tree2c3c7a8251870b0623e89ec0b9ce7deb9000d042 /nest/rt.h
parent83ceb91b50ae75ee5509faa74e2f6d4bdcf78505 (diff)
Miscellaneous refactoring
Diffstat (limited to 'nest/rt.h')
-rw-r--r--nest/rt.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/nest/rt.h b/nest/rt.h
index 66edf227..e7ba55f6 100644
--- a/nest/rt.h
+++ b/nest/rt.h
@@ -386,9 +386,16 @@ void rte_import(struct rt_import_request *req, const net_addr *net, rte *new, st
/* Get next rpe. If src is given, it must match. */
struct rt_pending_export *rpe_next(struct rt_pending_export *rpe, struct rte_src *src);
+/* Walk all rpe's */
+#define RPE_WALK(first, it, src) \
+ for (struct rt_pending_export *it = (first); it; it = rpe_next(it, (src)))
+
/* Mark the pending export processed */
void rpe_mark_seen(struct rt_export_hook *hook, struct rt_pending_export *rpe);
+#define rpe_mark_seen_all(hook, first, src) \
+ RPE_WALK(first, rpe, src) rpe_mark_seen((hook), rpe)
+
/* Get pending export seen status */
int rpe_get_seen(struct rt_export_hook *hook, struct rt_pending_export *rpe);