]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/table_manager.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* zebra table Manager for routing table identifier management
3 * Copyright (C) 2018 6WIND
6 #ifndef _TABLE_MANAGER_H
7 #define _TABLE_MANAGER_H
11 #include "lib/linklist.h"
12 #include "lib/thread.h"
15 #include "zebra/zserv.h"
23 * Client daemon which the chunk belongs to can be identified by either
24 * proto (daemon protocol) + instance + VRF.
25 * If the client then passes a non-empty value to keep field when it requests
26 * for chunks, the chunks won't be garbage collected and the client will be
27 * responsible of its release.
28 * Otherwise, if the keep field is not set (value 0) for the chunk, it will be
29 * automatically released when the client disconnects or when it reconnects
30 * (in case it died unexpectedly, we can know it's the same because it will have
31 * the same proto and instance values)
33 struct table_manager_chunk
{
37 uint32_t start
; /* First table RT ID of the chunk */
38 uint32_t end
; /* Last table RT ID of the chunk */
42 * Main table manager struct
43 * Holds a linked list of table chunks.
45 struct table_manager
{
51 void table_manager_enable(struct zebra_vrf
*zvrf
);
52 struct table_manager_chunk
*assign_table_chunk(uint8_t proto
, uint16_t instance
,
54 struct zebra_vrf
*zvrf
);
55 int release_table_chunk(uint8_t proto
, uint16_t instance
, uint32_t start
,
56 uint32_t end
, struct zebra_vrf
*zvrf
);
57 int release_daemon_table_chunks(struct zserv
*client
);
58 void table_manager_disable(struct zebra_vrf
*zvrf
);
59 int table_manager_range(struct vty
*vty
, bool add
, struct zebra_vrf
*zvrf
,
60 const char *min
, const char *max
);
66 #endif /* _TABLE_MANAGER_H */