Skip to content

Commit

Permalink
zebra: Add functions to alloc/release SRv6 SIDs
Browse files Browse the repository at this point in the history
Add functions to allocate/release SRv6 SIDs. SIDs can be allocated
either explicitly (allocate a specific SID) or dynamically (allocate any
available SID).

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
  • Loading branch information
cscarpitta committed Jun 7, 2024
1 parent 9e6c010 commit b771bf8
Show file tree
Hide file tree
Showing 5 changed files with 1,290 additions and 1 deletion.
2 changes: 1 addition & 1 deletion zebra/zapi_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ int zsend_zebra_srv6_locator_add(struct zserv *client, struct srv6_locator *loc)
locator.node_bits_length = format->node_len;
locator.function_bits_length = format->function_len;
locator.argument_bits_length = format->argument_len;
if (format->type == ZEBRA_SRV6_SID_FORMAT_TYPE_USID)
if (format->type == SRV6_SID_FORMAT_TYPE_USID)
SET_FLAG(locator.flags, SRV6_LOCATOR_USID);
}

Expand Down
12 changes: 12 additions & 0 deletions zebra/zebra_errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,18 @@ static struct log_ref ferr_zebra_err[] = {
.suggestion =
"Wait for Zebra to reattempt update.",
},
{
.code = EC_ZEBRA_SM_CANNOT_ASSIGN_SID,
.title = "SRv6 manager unable to assign SID",
.description = "Zebra's SRv6 manager was unable to assign a SID to client.",
.suggestion = "Ensure that Zebra has a sufficient SID range available.",
},
{
.code = EC_ZEBRA_SM_DAEMON_MISMATCH,
.title = "Daemon mismatch when releasing SRV6 SIDs",
.description = "Zebra noticed a mismatch between a SRv6 SID and a protocol daemon number or instance when releasing unused SRv6 SIDs.",
.suggestion = "Ignore this error.",
},
{
.code = END_FERR,
}
Expand Down
2 changes: 2 additions & 0 deletions zebra/zebra_errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ enum zebra_log_refs {
EC_ZEBRA_GRE_SET_UPDATE,
EC_ZEBRA_SRV6M_UNRELEASED_LOCATOR_CHUNK,
EC_ZEBRA_INTF_UPDATE_FAILURE,
EC_ZEBRA_SM_CANNOT_ASSIGN_SID,
EC_ZEBRA_SM_DAEMON_MISMATCH,
};

void zebra_error_init(void);
Expand Down
Loading

0 comments on commit b771bf8

Please sign in to comment.