.trace_routes = c->debug | c->proto->debug,
.dump_req = channel_dump_export_req,
.log_state_change = channel_export_log_state_change,
+ .mark_seen = channel_rpe_mark_seen,
};
bmap_init(&c->export_map, c->proto->pool, 16);
do_rt_notify(c, net, new, old);
}
-static void
+void
channel_rpe_mark_seen(struct rt_export_request *req, struct rt_pending_export *rpe)
{
struct channel *c = SKIP_BACK(struct channel, out_req, req);
static int
rt_prepare_feed(struct rt_table_export_hook *c, net *n, rt_feed_block *b)
{
- uint bs = c->h.req->feed_block_size ?: 16384;
+ struct rt_export_request *req = c->h.req;
+ uint bs = req->feed_block_size ?: 16384;
if (n->routes)
{
- if (c->h.req->export_bulk)
+ if (req->export_bulk)
{
uint cnt = rte_feed_count(n);
if (b->cnt && (b->cnt + cnt > bs))
b->rpe[b->pos++] = (struct rt_pending_export) { .new = n->routes, .new_best = n->routes };
}
}
+ else
+ if (req->mark_seen)
+ RPE_WALK(n->first, rpe, NULL)
+ req->mark_seen(req, rpe);
+ else
+ RPE_WALK(n->first, rpe, NULL)
+ rpe_mark_seen(&c->h, rpe);
return 1;
}
struct rt_pending_export *rpe, struct rt_pending_export *last,
const rte **feed, uint count);
+ void (*mark_seen)(struct rt_export_request *req, struct rt_pending_export *rpe);
+
void (*dump_req)(struct rt_export_request *req);
void (*log_state_change)(struct rt_export_request *req, u8);
};
void rt_notify_accepted(struct rt_export_request *req, const net_addr *net, struct rt_pending_export *first, struct rt_pending_export *last, const rte **feed, uint count);
void rt_notify_merged(struct rt_export_request *req, const net_addr *net, struct rt_pending_export *first, struct rt_pending_export *last, const rte **feed, uint count);
-
+void channel_rpe_mark_seen(struct rt_export_request *req, struct rt_pending_export *rpe);
/* Types of route announcement, also used as flags */
#define RA_UNDEF 0 /* Undefined RA type */