]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/label_manager.h
3e3def5f98bbf47eaf7a18e11cc6da2a4786c65d
4 * Copyright (C) 2017 by Bingen Eguzkitza,
7 * This file is part of FreeRangeRouting (FRR)
9 * FRR is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2, or (at your option) any
14 * FRR is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; see the file COPYING; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #ifndef _LABEL_MANAGER_H
25 #define _LABEL_MANAGER_H
29 #include "lib/linklist.h"
30 #include "lib/thread.h"
32 #include "zebra/zserv.h"
38 * Client daemon which the chunk belongs to can be identified by either
39 * proto (daemon protocol) + instance.
40 * If the client then passes a non-empty value to keep field when it requests
41 * for chunks, the chunks won't be garbage collected and the client will be
42 * responsible of its release.
43 * Otherwise, if the keep field is not set (value 0) for the chunk, it will be
44 * automatically released when the client disconnects or when it reconnects
45 * (in case it died unexpectedly, we can know it's the same because it will have
46 * the same proto and instance values)
48 struct label_manager_chunk
{
50 unsigned short instance
;
52 uint32_t start
; /* First label of the chunk */
53 uint32_t end
; /* Last label of the chunk */
57 * Main label manager struct
58 * Holds a linked list of label chunks.
60 struct label_manager
{
66 int zread_relay_label_manager_request(int cmd
, struct zserv
*zserv
,
67 struct stream
*msg
, vrf_id_t vrf_id
);
68 void label_manager_init(char *lm_zserv_path
);
69 struct label_manager_chunk
*assign_label_chunk(uint8_t proto
,
70 unsigned short instance
,
71 uint8_t keep
, uint32_t size
);
72 int release_label_chunk(uint8_t proto
, unsigned short instance
, uint32_t start
,
74 int release_daemon_label_chunks(struct zserv
*client
);
75 void label_manager_close(void);
77 #endif /* _LABEL_MANAGER_H */