Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for SRv6 SID Manager #15604

Merged
merged 25 commits into from
Jun 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
021386a
lib: Add support for SRv6 SID formats
cscarpitta Mar 22, 2024
1298867
zebra: Add support for SRv6 SID formats
cscarpitta Jun 6, 2024
35f4bed
lib: Add CLI nodes to support SRv6 SID format
cscarpitta Mar 22, 2024
b3ca230
vtysh: CLI to override default SID format config
cscarpitta Mar 26, 2024
51d3cd8
zebra: CLI to override default SID format config
cscarpitta Mar 26, 2024
bf10e44
zebra: Add support for SRv6 SID blocks
cscarpitta Mar 22, 2024
f00554e
lib: Add function to copy an SRv6 locator
cscarpitta May 8, 2024
779d4c2
zebra: CLI to specify format of an SRv6 locator
cscarpitta Mar 22, 2024
3cb88e6
lib: Add support for SRv6 SIDs
cscarpitta May 6, 2024
8b3f378
zebra: Add support for SRv6 SIDs
cscarpitta Mar 23, 2024
ded79d7
lib: Add ZAPI operation get SRv6 locator
cscarpitta Mar 23, 2024
ee1d208
lib: Add ZAPI operations to get/release SRv6 SIDs
cscarpitta Mar 23, 2024
164117f
lib: Add missing info to locator encode/decode
cscarpitta May 6, 2024
f8da4a2
zebra: Repond to `GET_LOCATOR` ZAPI request
cscarpitta Mar 23, 2024
c570d2b
zebra: Add functions to alloc/release SRv6 SIDs
cscarpitta Mar 23, 2024
84dd482
zebra: Alloc/Release SIDs to daemons upon request
cscarpitta Mar 23, 2024
b90cb00
lib: Add ZAPI command `ZEBRA_SRV6_SID_NOTIFY`
cscarpitta May 6, 2024
efa830e
zebra: Notify daemons about SIDs
cscarpitta May 2, 2024
5365c56
zebra: Notify all daemons about locator delete
cscarpitta May 2, 2024
33bd67a
doc: Add documentation for SRv6 SID formats CLI
cscarpitta May 2, 2024
4dcb69e
zebra: Fix checkpatch warning
cscarpitta May 3, 2024
708f20e
zebra: fix display srv6 address only for explicit-sid
pguibert6WIND Jun 7, 2024
35a87b6
zebra: fix display explicit sid refused
pguibert6WIND Jun 7, 2024
209223d
zebra: fix sid allocation should be different with 2 isis instances
pguibert6WIND Jun 11, 2024
36a310c
zebra, lib: add locator name in sid notify messages
pguibert6WIND Jun 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lib: Add ZAPI command ZEBRA_SRV6_SID_NOTIFY
Add a new ZAPI command `ZEBRA_SRV6_SID_NOTIFY` used by zebra to send
asynchronous SRv6 SIDs notifications to zclients.

Signed-off-by: Carmine Scarpitta <[email protected]>
cscarpitta committed Jun 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit b90cb00974ef84beff603fb0e91a7a38b3a1b6a4
3 changes: 2 additions & 1 deletion lib/log.c
Original file line number Diff line number Diff line change
@@ -464,7 +464,8 @@ static const struct zebra_desc_table command_types[] = {
DESC_ENTRY(ZEBRA_TC_CLASS_DELETE),
DESC_ENTRY(ZEBRA_TC_FILTER_ADD),
DESC_ENTRY(ZEBRA_TC_FILTER_DELETE),
DESC_ENTRY(ZEBRA_OPAQUE_NOTIFY)
DESC_ENTRY(ZEBRA_OPAQUE_NOTIFY),
DESC_ENTRY(ZEBRA_SRV6_SID_NOTIFY)
};
#undef DESC_ENTRY

24 changes: 24 additions & 0 deletions lib/zclient.c
Original file line number Diff line number Diff line change
@@ -2133,6 +2133,30 @@ bool zapi_iptable_notify_decode(struct stream *s,
return false;
}

bool zapi_srv6_sid_notify_decode(struct stream *s, struct srv6_sid_ctx *ctx,
struct in6_addr *sid_value, uint32_t *func,
uint32_t *wide_func,
enum zapi_srv6_sid_notify *note)
{
uint32_t f, wf;

STREAM_GET(note, s, sizeof(*note));
STREAM_GET(ctx, s, sizeof(struct srv6_sid_ctx));
STREAM_GET(sid_value, s, sizeof(struct in6_addr));
STREAM_GETL(s, f);
STREAM_GETL(s, wf);

if (func)
*func = f;
if (wide_func)
*wide_func = wf;

return true;

stream_failure:
return false;
}

struct nexthop *nexthop_from_zapi_nexthop(const struct zapi_nexthop *znh)
{
struct nexthop *n = nexthop_new();
34 changes: 34 additions & 0 deletions lib/zclient.h
Original file line number Diff line number Diff line change
@@ -238,6 +238,7 @@ typedef enum {
ZEBRA_TC_FILTER_ADD,
ZEBRA_TC_FILTER_DELETE,
ZEBRA_OPAQUE_NOTIFY,
ZEBRA_SRV6_SID_NOTIFY,
} zebra_message_types_t;
/* Zebra message types. Please update the corresponding
* command_types array with any changes!
@@ -764,6 +765,13 @@ enum zapi_iptable_notify_owner {
ZAPI_IPTABLE_FAIL_REMOVE,
};

enum zapi_srv6_sid_notify {
ZAPI_SRV6_SID_FAIL_ALLOC = 0,
ZAPI_SRV6_SID_ALLOCATED,
ZAPI_SRV6_SID_RELEASED,
ZAPI_SRV6_SID_FAIL_RELEASE,
};

enum zclient_send_status {
ZCLIENT_SEND_FAILURE = -1,
ZCLIENT_SEND_SUCCESS = 0,
@@ -816,6 +824,28 @@ zapi_rule_notify_owner2str(enum zapi_rule_notify_owner note)
return ret;
}

static inline const char *zapi_srv6_sid_notify2str(enum zapi_srv6_sid_notify note)
{
const char *ret = "UNKNOWN";

switch (note) {
case ZAPI_SRV6_SID_FAIL_ALLOC:
ret = "ZAPI_SRV6_SID_FAIL_ALLOC";
break;
case ZAPI_SRV6_SID_ALLOCATED:
ret = "ZAPI_SRV6_SID_ALLOCATED";
break;
case ZAPI_SRV6_SID_FAIL_RELEASE:
ret = "ZAPI_SRV6_SID_FAIL_RELEASE";
break;
case ZAPI_SRV6_SID_RELEASED:
ret = "ZAPI_SRV6_SID_RELEASED";
break;
}

return ret;
}

/* Zebra MAC types */
#define ZEBRA_MACIP_TYPE_STICKY 0x01 /* Sticky MAC*/
#define ZEBRA_MACIP_TYPE_GW 0x02 /* gateway (SVI) mac*/
@@ -1144,6 +1174,10 @@ bool zapi_rule_notify_decode(struct stream *s, uint32_t *seqno,
bool zapi_ipset_notify_decode(struct stream *s,
uint32_t *unique,
enum zapi_ipset_notify_owner *note);
bool zapi_srv6_sid_notify_decode(struct stream *s, struct srv6_sid_ctx *ctx,
struct in6_addr *sid_value, uint32_t *func,
uint32_t *wide_func,
enum zapi_srv6_sid_notify *note);

/* Nexthop-group message apis */
extern enum zclient_send_status