summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_label.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* bgpd, zebra: auto assign labels from label pool to regular prefixes in BGP ↵Anton Degtyarev2018-12-201-3/+5
| | | | | | | | | | | | labeled unicast This commit is the last missing piece to complete BGP LU support in bgpd. To this moment, bgpd (and zebra) supported auto label assignment only for prefixes leaked from VRFs to vpn and for MPLS SR prefixes. This adds auto label assignment to other routes types in bgpd. The following enhancements have been made: * bgp_route.c:bgp_process_main_one() now sets implicit-null local_label to all local, aggregate and redistributed routes. * bgp_route.c:bgp_process_main_one() now will request a label from the label pool for any prefix that loses the label for some reason (for example, when the static label assignment config is removed) * bgp_label.c:bgp_reg_dereg_for_label() now requests labels from label pool for routes which have no associated label index * zebra_mpls.c:zebra_mpls_fec_register() now expects both label and label_index from the calling function, one of which must be set to MPLS_INVALID_LABEL or MPLS_INVALID_LABEL_INDEX, based on this it will decide how to register the provided FEC. Signed-off-by: Anton Degtyarev <anton@cumulusnetworks.com>
* bgpd: Rename various variable names to something more appropriateDonald Sharp2018-10-091-4/+4
| | | | | | | | | ri -> pi bi -> bpi info -> path info -> rmap_path ( for routemap applications ) Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* bgpd: Convert `struct bgp_info` to `struct bgp_path_info`Donald Sharp2018-10-091-5/+5
| | | | | | | | | | | | Do a straight conversion of `struct bgp_info` to `struct bgp_path_info`. This commit will setup the rename of variables as well. This is being done because `struct bgp_info` is not descriptive of what this data actually is. It is path information for routes that we keep to build the actual routes nexthops plus some extra information. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* bgpd: Prevent vrf 2 vrf route leaking from going offbox.Donald Sharp2018-04-251-0/+1
| | | | | | | | | | | | | | The vrf 2 vrf route leaking auto-derives RD and RT and installs the routes into the appropriate vpn table. These routes when a operator configured ipv[4|6] vpn neighbors were showing up off box. The RD and RT values choosen are localy significant but globaly useless and may cause confusion. Put a special bit of code in to notice that we should not be advertising these routes off box. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-10/+10
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-62/+54
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: Additional check on presence of tag/labelvivek2017-07-121-0/+3
| | | | | | | In the case of EVPN, not all EVPN routes will necessarily have a tag/label. Do an additional check on presence of tag, where needed. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST tableDaniel Walton2017-06-201-1/+4
| | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST tableDaniel Walton2017-06-161-16/+16
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> - All ipv4 labeled-unicast routes are now installed in the ipv4 unicast table. This allows us to do things like take routes from an ipv4 unicast peer, allocate a label for them and TX them to a ipv4 labeled-unicast peer. We can do the opposite where we take routes from a labeled-unicast peer, remove the label and advertise them to an ipv4 unicast peer. - Multipath over a labeled route and non-labeled route is not allowed. - You cannot activate a peer for both 'ipv4 unicast' and 'ipv4 labeled-unicast' - The 'tag' variable was overloaded for zebra's route tag feature as well as the mpls label. I added a 'mpls_label_t mpls' variable to avoid this. This is much cleaner but resulted in touching a lot of code.
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: add epvn as labeled safi type (ISSUE #471)Lou Berger2017-05-131-1/+2
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd, lib, zebra: Implement handling of BGP-Prefix-SID label IndexVivek Venkatraman2017-04-061-4/+5
| | | | | | | | | | | | | | | | 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>
* bgpd: labeled unicast processingDon Slice2017-04-061-0/+124
Implement support for negotiating IPv4 or IPv6 labeled-unicast address family, exchanging prefixes and installing them in the routing table, as well as interactions with Zebra for FEC registration. This is the implementation of RFC 3107. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>