diff options
author | Vivek Venkatraman <vivek@cumulusnetworks.com> | 2017-03-09 18:55:54 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-04-06 16:32:07 +0200 |
commit | 28d58fd7b166836029656c29ad8ed9a9e8a744ac (patch) | |
tree | 549a60873cfe73d04c055447fc599e667cb1d71c /zebra/zebra_mpls.h | |
parent | bgpd: This patch implements the exchange of the BGP-Prefix-SID label index attr (diff) | |
download | frr-28d58fd7b166836029656c29ad8ed9a9e8a744ac.tar.xz frr-28d58fd7b166836029656c29ad8ed9a9e8a744ac.zip |
bgpd, lib, zebra: Implement handling of BGP-Prefix-SID label Index
Implement BGP Prefix-SID IETF draft to be able to signal a labeled-unicast
prefix with a label index (segment ID). This makes it easier to deploy
global MPLS labels with BGP, even without other aspects of Segment Routing
implemented.
This patch implements the handling of the BGP-Prefix-SID Label Index
attribute. When received from a peer and the index is acceptable, the local
label is picked up from the SRGB and is programmed as the incoming label as
well as advertised to peers. If the index is not acceptable, no local label
is assigned. The outgoing label will always be the one advertised by the
downstream neighbor.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_mpls.h')
-rw-r--r-- | zebra/zebra_mpls.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index f8e95fa10..e271edd2e 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -159,6 +159,9 @@ struct zebra_fec_t_ /* In-label - either statically bound or derived from label block. */ mpls_label_t label; + /* Label index (into global label block), if valid */ + u_int32_t label_index; + /* Flags. */ u_int32_t flags; #define FEC_FLAG_CONFIGURED (1 << 0) @@ -217,10 +220,14 @@ zebra_mpls_lsp_uninstall (struct zebra_vrf *zvrf, struct route_node *rn, struct /* * Registration from a client for the label binding for a FEC. If a binding * already exists, it is informed to the client. + * NOTE: If there is a manually configured label binding, that is used. + * Otherwise, if aa label index is specified, it means we have to allocate the + * label from a locally configured label block (SRGB), if one exists and index + * is acceptable. */ int zebra_mpls_fec_register (struct zebra_vrf *zvrf, struct prefix *p, - struct zserv *client); + u_int32_t label_index, struct zserv *client); /* * Deregistration from a client for the label binding for a FEC. The FEC @@ -265,6 +272,8 @@ zebra_mpls_static_fec_add (struct zebra_vrf *zvrf, struct prefix *p, /* * Remove static FEC to label binding. If there are no clients registered * for this FEC, delete the FEC; else notify clients. + * Note: Upon delete of static binding, if label index exists for this FEC, + * client may need to be updated with derived label. */ int zebra_mpls_static_fec_del (struct zebra_vrf *zvrf, struct prefix *p); |