diff options
author | G. Paul Ziemba <paulz@labn.net> | 2018-04-07 20:13:07 +0200 |
---|---|---|
committer | G. Paul Ziemba <paulz@labn.net> | 2018-04-12 08:18:28 +0200 |
commit | 955bfd984ffdf25de5748c404ee9796de7fd30be (patch) | |
tree | 2cbf34a64c17bd530af22eb4f8162cd8bb67a66d /lib/zclient.h | |
parent | Merge pull request #2027 from qlyoung/fix-vrf-static-holdem-display (diff) | |
download | frr-955bfd984ffdf25de5748c404ee9796de7fd30be.tar.xz frr-955bfd984ffdf25de5748c404ee9796de7fd30be.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | lib/zclient.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/zclient.h b/lib/zclient.h index 9d3e5c370..e85eac73f 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -223,6 +223,8 @@ struct zclient { uint16_t length, vrf_id_t vrf_id); int (*rule_notify_owner)(int command, struct zclient *zclient, uint16_t length, vrf_id_t vrf_id); + void (*label_chunk)(int command, struct zclient *zclient, + uint16_t length, vrf_id_t vrf_id); }; /* Zebra API message flag. */ @@ -535,6 +537,11 @@ extern int zapi_ipv4_route(uint8_t, struct zclient *, struct prefix_ipv4 *, extern struct interface *zebra_interface_link_params_read(struct stream *); extern size_t zebra_interface_link_params_write(struct stream *, struct interface *); +extern int zclient_send_get_label_chunk( + struct zclient *zclient, + uint8_t keep, + uint32_t chunk_size); + extern int lm_label_manager_connect(struct zclient *zclient); extern int lm_get_label_chunk(struct zclient *zclient, uint8_t keep, uint32_t chunk_size, uint32_t *start, |