summaryrefslogtreecommitdiff
path: root/zebra/zebra_router.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-01-24 09:16:12 -0500
committerGitHub <noreply@github.com>2019-01-24 09:16:12 -0500
commitc8d3e7955417ac882dd9b078011c52ee97c3577a (patch)
treed4c8353576fe7f7ece5f6c89cd0c2353075e4cc7 /zebra/zebra_router.c
parenta28436ca476f4a862ede8f36e7257741b404f876 (diff)
parent1485bbe75554e5d01bcd8203fe75662c04f460f2 (diff)
Merge pull request #3642 from donaldsharp/sequence
zebra: Add code to track sequence number from zebra_router
Diffstat (limited to 'zebra/zebra_router.c')
-rw-r--r--zebra/zebra_router.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c
index f0cc8d4fd7..3e94d6bca8 100644
--- a/zebra/zebra_router.c
+++ b/zebra/zebra_router.c
@@ -21,6 +21,9 @@
*/
#include "zebra.h"
+#include <pthread.h>
+#include "lib/frratomic.h"
+
#include "zebra_router.h"
#include "zebra_memory.h"
#include "zebra_pbr.h"
@@ -169,6 +172,13 @@ static void zebra_router_free_table(struct zebra_router_table *zrt)
XFREE(MTYPE_ZEBRA_NS, zrt);
}
+uint32_t zebra_router_get_next_sequence(void)
+{
+ return 1
+ + atomic_fetch_add_explicit(&zrouter.sequence_num, 1,
+ memory_order_relaxed);
+}
+
void zebra_router_terminate(void)
{
struct zebra_router_table *zrt, *tmp;
@@ -194,6 +204,8 @@ void zebra_router_terminate(void)
void zebra_router_init(void)
{
+ zrouter.sequence_num = 0;
+
zebra_vxlan_init();
zebra_mlag_init();