]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/table_manager.h
1 /* zebra table Manager for routing table identifier management
2 * Copyright (C) 2018 6WIND
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along
15 * with this program; see the file COPYING; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef _TABLE_MANAGER_H
20 #define _TABLE_MANAGER_H
24 #include "lib/linklist.h"
25 #include "lib/thread.h"
29 * Client daemon which the chunk belongs to can be identified by either
30 * proto (daemon protocol) + instance + VRF.
31 * If the client then passes a non-empty value to keep field when it requests
32 * for chunks, the chunks won't be garbage collected and the client will be
33 * responsible of its release.
34 * Otherwise, if the keep field is not set (value 0) for the chunk, it will be
35 * automatically released when the client disconnects or when it reconnects
36 * (in case it died unexpectedly, we can know it's the same because it will have
37 * the same proto and instance values)
39 struct table_manager_chunk
{
43 uint32_t start
; /* First table RT ID of the chunk */
44 uint32_t end
; /* Last table RT ID of the chunk */
48 * Main table manager struct
49 * Holds a linked list of table chunks.
51 struct table_manager
{
55 void table_manager_enable(ns_id_t ns_id
);
56 struct table_manager_chunk
*assign_table_chunk(uint8_t proto
, uint16_t instance
,
58 int release_table_chunk(uint8_t proto
, uint16_t instance
, uint32_t start
,
60 int release_daemon_table_chunks(uint8_t proto
, uint16_t instance
);
61 void table_manager_disable(ns_id_t ns_id
);
63 #endif /* _TABLE_MANAGER_H */