]>
git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_labelpool.h
2 * BGP Label Pool - Manage label chunk allocations from zebra asynchronously
4 * Copyright (C) 2018 LabN Consulting, L.L.C.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef _FRR_BGP_LABELPOOL_H
22 #define _FRR_BGP_LABELPOOL_H
29 * Types used in bgp_lp_get for debug tracking; add more as needed
31 #define LP_TYPE_VRF 0x00000001
32 #define LP_TYPE_BGP_LU 0x00000002
34 PREDECL_LIST(lp_fifo
);
37 struct skiplist
*ledger
; /* all requests */
38 struct skiplist
*inuse
; /* individual labels */
39 struct list
*chunks
; /* granted by zebra */
40 struct lp_fifo_head requests
; /* blocked on zebra */
41 struct work_queue
*callback_q
;
42 uint32_t pending_count
; /* requested from zebra */
43 uint32_t reconnect_count
; /* zebra reconnections */
46 extern void bgp_lp_init(struct thread_master
*master
, struct labelpool
*pool
);
47 extern void bgp_lp_finish(void);
48 extern void bgp_lp_get(int type
, void *labelid
,
49 int (*cbfunc
)(mpls_label_t label
, void *labelid
, bool allocated
));
50 extern void bgp_lp_release(int type
, void *labelid
, mpls_label_t label
);
51 extern void bgp_lp_event_chunk(uint8_t keep
, uint32_t first
, uint32_t last
);
52 extern void bgp_lp_event_zebra_down(void);
53 extern void bgp_lp_event_zebra_up(void);
54 extern void bgp_lp_vty_init(void);
56 #endif /* _FRR_BGP_LABELPOOL_H */