mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 13:33:15 +00:00
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>
This commit is contained in:
parent
bf10e4437e
commit
f00554ed56
15
lib/srv6.c
15
lib/srv6.c
@ -141,6 +141,21 @@ struct srv6_locator_chunk *srv6_locator_chunk_alloc(void)
|
|||||||
return chunk;
|
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)
|
void srv6_locator_free(struct srv6_locator *locator)
|
||||||
{
|
{
|
||||||
if (locator) {
|
if (locator) {
|
||||||
|
@ -311,6 +311,8 @@ extern struct srv6_locator_chunk *srv6_locator_chunk_alloc(void);
|
|||||||
extern void srv6_locator_free(struct srv6_locator *locator);
|
extern void srv6_locator_free(struct srv6_locator *locator);
|
||||||
extern void srv6_locator_chunk_list_free(void *data);
|
extern void srv6_locator_chunk_list_free(void *data);
|
||||||
extern void srv6_locator_chunk_free(struct srv6_locator_chunk **chunk);
|
extern void srv6_locator_chunk_free(struct srv6_locator_chunk **chunk);
|
||||||
|
extern void srv6_locator_copy(struct srv6_locator *copy,
|
||||||
|
const struct srv6_locator *locator);
|
||||||
json_object *srv6_locator_chunk_json(const struct srv6_locator_chunk *chunk);
|
json_object *srv6_locator_chunk_json(const struct srv6_locator_chunk *chunk);
|
||||||
json_object *srv6_locator_json(const struct srv6_locator *loc);
|
json_object *srv6_locator_json(const struct srv6_locator *loc);
|
||||||
json_object *srv6_locator_detailed_json(const struct srv6_locator *loc);
|
json_object *srv6_locator_detailed_json(const struct srv6_locator *loc);
|
||||||
|
Loading…
Reference in New Issue
Block a user