diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2023-04-21 04:47:55 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2023-04-21 04:47:55 +0200 |
commit | 52450bc96dcedbc30cbb2e282c6706ad9e5e5774 (patch) | |
tree | e12244a788d6a26c52b3e5785c677b8d82b6a1c9 /nest | |
parent | d61505b039bf0aa6697e28b2a4e07907c89ba1fb (diff) | |
parent | f3b599afe5bde0c7f232421743041b305bb8afa7 (diff) |
Merge branch 'bmp'
Diffstat (limited to 'nest')
-rw-r--r-- | nest/protocol.h | 4 | ||||
-rw-r--r-- | nest/rt-table.c | 11 |
2 files changed, 14 insertions, 1 deletions
diff --git a/nest/protocol.h b/nest/protocol.h index fcbf0539..da6d434e 100644 --- a/nest/protocol.h +++ b/nest/protocol.h @@ -42,6 +42,7 @@ enum protocol_class { PROTOCOL_BABEL, PROTOCOL_BFD, PROTOCOL_BGP, + PROTOCOL_BMP, PROTOCOL_DEVICE, PROTOCOL_DIRECT, PROTOCOL_KERNEL, @@ -103,7 +104,7 @@ void protos_dump_all(void); extern struct protocol proto_device, proto_radv, proto_rip, proto_static, proto_mrt, proto_ospf, proto_perf, - proto_pipe, proto_bgp, proto_bfd, proto_babel, proto_rpki; + proto_pipe, proto_bgp, proto_bmp, proto_bfd, proto_babel, proto_rpki; /* * Routing Protocol Instance @@ -213,6 +214,7 @@ struct proto { void (*if_notify)(struct proto *, unsigned flags, struct iface *i); void (*ifa_notify)(struct proto *, unsigned flags, struct ifa *a); void (*rt_notify)(struct proto *, struct channel *, struct network *net, struct rte *new, struct rte *old); + void (*rte_update_in_notify)(struct channel *, const net_addr *, const struct rte *, const struct rte_src *); void (*neigh_notify)(struct neighbor *neigh); int (*preexport)(struct channel *, struct rte *rt); void (*reload_routes)(struct channel *); diff --git a/nest/rt-table.c b/nest/rt-table.c index e4b27814..2b065032 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -3095,6 +3095,10 @@ rte_update_in(struct channel *c, const net_addr *n, rte *new, struct rte_src *sr if (old->flags & (REF_STALE | REF_DISCARD | REF_MODIFY)) { old->flags &= ~(REF_STALE | REF_DISCARD | REF_MODIFY); + + if (c->proto->rte_update_in_notify) + c->proto->rte_update_in_notify(c, n, old, src); + return 1; } @@ -3121,6 +3125,9 @@ rte_update_in(struct channel *c, const net_addr *n, rte *new, struct rte_src *sr if (!net->routes) fib_delete(&tab->fib, net); + if (c->proto->rte_update_in_notify) + c->proto->rte_update_in_notify(c, n, NULL, src); + return 1; } @@ -3149,6 +3156,10 @@ rte_update_in(struct channel *c, const net_addr *n, rte *new, struct rte_src *sr e->next = *pos; *pos = e; tab->rt_count++; + + if (c->proto->rte_update_in_notify) + c->proto->rte_update_in_notify(c, n, e, src); + return 1; drop_update: |