summaryrefslogtreecommitdiffstats
path: root/lib/srv6.c
diff options
context:
space:
mode:
authorCarmine Scarpitta <cscarpit@cisco.com>2024-05-08 16:41:05 +0200
committerCarmine Scarpitta <cscarpit@cisco.com>2024-06-13 14:54:16 +0200
commitf00554ed563b8a4ce0cc7fff7ea107d3ae8aa6b1 (patch)
tree5b90707e05fe97f4f55ee206dff91c75dfe1d16c /lib/srv6.c
parentzebra: Add support for SRv6 SID blocks (diff)
downloadfrr-f00554ed563b8a4ce0cc7fff7ea107d3ae8aa6b1.tar.xz
frr-f00554ed563b8a4ce0cc7fff7ea107d3ae8aa6b1.zip
lib: Add function to copy an SRv6 locator
Add a new function to copy an SRv6 locator. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Diffstat (limited to 'lib/srv6.c')
-rw-r--r--lib/srv6.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/srv6.c b/lib/srv6.c
index abaff7eab..1f485fb8a 100644
--- a/lib/srv6.c
+++ b/lib/srv6.c
@@ -141,6 +141,21 @@ struct srv6_locator_chunk *srv6_locator_chunk_alloc(void)
return chunk;
}
+void srv6_locator_copy(struct srv6_locator *copy,
+ const struct srv6_locator *locator)
+{
+ strlcpy(copy->name, locator->name, sizeof(locator->name));
+ copy->prefix = locator->prefix;
+ copy->block_bits_length = locator->block_bits_length;
+ copy->node_bits_length = locator->node_bits_length;
+ copy->function_bits_length = locator->function_bits_length;
+ copy->argument_bits_length = locator->argument_bits_length;
+ copy->algonum = locator->algonum;
+ copy->current = locator->current;
+ copy->status_up = locator->status_up;
+ copy->flags = locator->flags;
+}
+
void srv6_locator_free(struct srv6_locator *locator)
{
if (locator) {