diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 13:16:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 13:16:35 +0000 |
commit | e2bbf175a2184bd76f6c54ccf8456babeb1a46fc (patch) | |
tree | f0b76550d6e6f500ada964a3a4ee933a45e5a6f1 /lib/agg_table.c | |
parent | Initial commit. (diff) | |
download | frr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.tar.xz frr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.zip |
Adding upstream version 9.1.upstream/9.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/agg_table.c')
-rw-r--r-- | lib/agg_table.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/agg_table.c b/lib/agg_table.c new file mode 100644 index 0000000..9cf277f --- /dev/null +++ b/lib/agg_table.c @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Aggregate Route + * Copyright (C) 2018 Cumulus Networks, Inc. + * Donald Sharp + */ +#include "zebra.h" + +#include "agg_table.h" + + +static struct route_node *agg_node_create(route_table_delegate_t *delegate, + struct route_table *table) +{ + struct agg_node *node; + + node = XCALLOC(MTYPE_TMP, sizeof(struct agg_node)); + + return agg_node_to_rnode(node); +} + +static void agg_node_destroy(route_table_delegate_t *delegate, + struct route_table *table, struct route_node *node) + +{ + struct agg_node *anode = agg_node_from_rnode(node); + + XFREE(MTYPE_TMP, anode); +} + +static route_table_delegate_t agg_table_delegate = { + .create_node = agg_node_create, + .destroy_node = agg_node_destroy, +}; + +struct agg_table *agg_table_init(void) +{ + struct agg_table *at; + + at = XCALLOC(MTYPE_TMP, sizeof(struct agg_table)); + + at->route_table = route_table_init_with_delegate(&agg_table_delegate); + route_table_set_info(at->route_table, at); + + return at; +} |