Skip to content

Commit

Permalink
zebra: Add dplane_ctx_get|set_flags
Browse files Browse the repository at this point in the history
Zebra needs the ability to pass this data around.
Add it to the dplanes ability to pass.

Signed-off-by: Donald Sharp <[email protected]>

zebra: Add a dplane_ctx_set_flags

The dplane_ctx_set_flags call is missing, we will need it.  Add it.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Dec 12, 2022
1 parent c7f0429 commit 10388e9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions zebra/zebra_dplane.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ struct dplane_route_info {
uint32_t zd_mtu;
uint32_t zd_nexthop_mtu;

uint32_t zd_flags;

/* Nexthop hash entry info */
struct dplane_nexthop_info nhe;

Expand Down Expand Up @@ -1430,6 +1432,20 @@ uint16_t dplane_ctx_get_old_instance(const struct zebra_dplane_ctx *ctx)
return ctx->u.rinfo.zd_old_instance;
}

uint32_t dplane_ctx_get_flags(const struct zebra_dplane_ctx *ctx)
{
DPLANE_CTX_VALID(ctx);

return ctx->u.rinfo.zd_flags;
}

void dplane_ctx_set_flags(struct zebra_dplane_ctx *ctx, uint32_t flags)
{
DPLANE_CTX_VALID(ctx);

ctx->u.rinfo.zd_flags = flags;
}

uint32_t dplane_ctx_get_metric(const struct zebra_dplane_ctx *ctx)
{
DPLANE_CTX_VALID(ctx);
Expand Down Expand Up @@ -2806,6 +2822,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op,

ctx->zd_table_id = re->table;

ctx->u.rinfo.zd_flags = re->flags;
ctx->u.rinfo.zd_metric = re->metric;
ctx->u.rinfo.zd_old_metric = re->metric;
ctx->zd_vrf_id = re->vrf_id;
Expand Down
2 changes: 2 additions & 0 deletions zebra/zebra_dplane.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ route_tag_t dplane_ctx_get_old_tag(const struct zebra_dplane_ctx *ctx);
uint16_t dplane_ctx_get_instance(const struct zebra_dplane_ctx *ctx);
void dplane_ctx_set_instance(struct zebra_dplane_ctx *ctx, uint16_t instance);
uint16_t dplane_ctx_get_old_instance(const struct zebra_dplane_ctx *ctx);
uint32_t dplane_ctx_get_flags(const struct zebra_dplane_ctx *ctx);
void dplane_ctx_set_flags(struct zebra_dplane_ctx *ctx, uint32_t flags);
uint32_t dplane_ctx_get_metric(const struct zebra_dplane_ctx *ctx);
uint32_t dplane_ctx_get_old_metric(const struct zebra_dplane_ctx *ctx);
uint32_t dplane_ctx_get_mtu(const struct zebra_dplane_ctx *ctx);
Expand Down

0 comments on commit 10388e9

Please sign in to comment.