diff options
author | Mark Stapp <mjs@voltanet.io> | 2020-10-30 15:51:54 +0100 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2020-10-30 15:51:54 +0100 |
commit | 5917df094a324ce6cb1cc2d71dcaee2d5cc28377 (patch) | |
tree | 51b38e416131e4f0466502e4b9d070f324e9ae86 /zebra/zebra_dplane.h | |
parent | Merge pull request #7418 from donaldsharp/manuall (diff) | |
download | frr-5917df094a324ce6cb1cc2d71dcaee2d5cc28377.tar.xz frr-5917df094a324ce6cb1cc2d71dcaee2d5cc28377.zip |
zebra: add optional extra data about routes' interfaces
Add extra data about the interfaces used in route updates'
nexthops - some consumers of route updates may want additional
data, but dataplane plugins running in the dplane pthread
cannot safely access the normal zebra data structures. Capturing
this info is optional - a plugin must request it (via an api).
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zebra_dplane.h')
-rw-r--r-- | zebra/zebra_dplane.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index b37bf665a..1b2ea9d96 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -204,6 +204,9 @@ void dplane_enable_sys_route_notifs(void); */ TAILQ_HEAD(dplane_ctx_q, zebra_dplane_ctx); +/* Declare a type for (optional) extended interface info objects. */ +TAILQ_HEAD(dplane_intf_extra_q, dplane_intf_extra); + /* Allocate a context object */ struct zebra_dplane_ctx *dplane_ctx_alloc(void); @@ -313,6 +316,21 @@ const struct nexthop_group *dplane_ctx_get_ng( const struct nexthop_group *dplane_ctx_get_old_ng( const struct zebra_dplane_ctx *ctx); +/* Optional extra info about interfaces in nexthops - a plugin must enable + * this extra info. + */ +const struct dplane_intf_extra * +dplane_ctx_get_intf_extra(const struct zebra_dplane_ctx *ctx); + +const struct dplane_intf_extra * +dplane_ctx_intf_extra_next(const struct zebra_dplane_ctx *ctx, + const struct dplane_intf_extra *ptr); + +vrf_id_t dplane_intf_extra_get_vrfid(const struct dplane_intf_extra *ptr); +uint32_t dplane_intf_extra_get_ifindex(const struct dplane_intf_extra *ptr); +uint32_t dplane_intf_extra_get_flags(const struct dplane_intf_extra *ptr); +uint32_t dplane_intf_extra_get_status(const struct dplane_intf_extra *ptr); + /* Backup nexthop information (list of nexthops) if present. */ const struct nexthop_group * dplane_ctx_get_backup_ng(const struct zebra_dplane_ctx *ctx); @@ -743,6 +761,12 @@ void dplane_provider_enqueue_out_ctx(struct zebra_dplane_provider *prov, /* Enqueue a context directly to zebra main. */ void dplane_provider_enqueue_to_zebra(struct zebra_dplane_ctx *ctx); +/* Enable collection of extra info about interfaces in route updates; + * this allows a provider/plugin to see some extra info in route update + * context objects. + */ +void dplane_enable_intf_extra_info(void); + /* * Initialize the dataplane modules at zebra startup. This is currently called * by the rib module. Zebra registers a results callback with the dataplane. |