]> git.proxmox.com Git - mirror_frr.git/commit - lib/zclient.c
bgpd: dynamic mpls label pool
authorG. Paul Ziemba <paulz@labn.net>
Sat, 7 Apr 2018 18:13:07 +0000 (11:13 -0700)
committerG. Paul Ziemba <paulz@labn.net>
Thu, 12 Apr 2018 06:18:28 +0000 (23:18 -0700)
commit955bfd984ffdf25de5748c404ee9796de7fd30be
tree2cbf34a64c17bd530af22eb4f8162cd8bb67a66d
parentbb04824d89541151f8636e846cf3ddafee5fc603
bgpd: dynamic mpls label pool

MPLS label pool backed by allocations from the zebra label manager.

A caller requests a label (e.g., in support of an "auto" label
specification in the CLI) via lp_get(), supplying a unique ID and
a callback function. The callback function is invoked at a later
time with the unique ID and a label value to inform the requestor
of the assigned label.

Requestors may release their labels back to the pool via lp_release().

The label pool is stocked with labels allocated by the zebra label
manager. The interaction with zebra is asynchronous so that bgpd
is not blocked while awaiting a label allocation from zebra.

The label pool implementation allows for bgpd operation before (or
without) zebra, and gracefully handles loss and reconnection of
zebra. Of course, before initial connection with zebra, no labels
are assigned to requestors. If the zebra connection is lost and
regained, callbacks to requestors will invalidate old assignments
and then assign new labels.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
bgpd/Makefile.am
bgpd/bgp_debug.c
bgpd/bgp_debug.h
bgpd/bgp_labelpool.c [new file with mode: 0644]
bgpd/bgp_labelpool.h [new file with mode: 0644]
bgpd/bgp_zebra.c
bgpd/bgpd.c
bgpd/bgpd.h
lib/zclient.c
lib/zclient.h