summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_rd.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #12248 from pguibert6WIND/bgpasdotRuss White2023-02-211-1/+16
|\ | | | | lib, bgp: add initial support for asdot format
| * bgpd: support for route-distinguisher format with 3 fieldsPhilippe Guibert2023-02-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The ietf proposes to define a RD with a 3 field separated by the ':' character. The last 2 fields stands for the usual fields, namely AS4B:NN, AS2B,NNNN, IP:NN. The first field stands for the kind of route distinguisher used. Today, except with the route-map, no other RD configuration supports this mode. Handle the support for this in FRR. Link: https://github.com/FRRouting/frr/blob/master/yang/ietf/ietf-routing-types.yang#L258 Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| * bgpd: support for as notation format for route distinguisherPhilippe Guibert2023-02-101-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RD may be built based on an AS number. Like for the AS, the RD may use the AS notation. The two below examples can illustrate: RD 1.1:20 stands for an AS4B:NN RD with AS4B=65536 in dot format. RD 0.1:20 stands for an AS2B:NNNN RD with AS2B=0.1 in dot+ format. This commit adds the asnotation mode to prefix_rd2str() API so as to pick up the relevant display. Two new printfrr extensions are available to display the RD with the two above display methods. - The pRDD extension stands for dot asnotation format - The pRDE extension stands for dot+ asnotation format. - The pRD extension has been renamed to pRDP extension The code is changed each time '%pRD' printf extension is called. Possibly, the asnotation may change the output, then a macro defines the asnotation mode to use. A side effect of forging the mode to use is that the string could not be concatenated with other strings in vty_out and snprintfrr. Those functions have been called multiple times. When zlog_debug needs to display the RD with some other string, the prefix_rd2str() old API is used instead of the printf extension. Some code has been kept untouched: - code related to running-config. Actually, wherever an RD is displayed, its configured name should be dumped. - bgp rfapi code - bgp evpn multihoming code (partially done), since the logic is missing to get the asnotation of 'struct bgp_evpn_es'. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-17/+1
|/ | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: support for Ethernet Segments and Type-1/EAD routesAnuradha Karuppiah2020-08-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the base patch that brings in support for Type-1 routes. It includes support for - - Ethernet Segment (ES) management - EAD route handling - MAC-IP (Type-2) routes with a non-zero ESI i.e. Aliasing for active-active multihoming - Initial infra for consistency checking. Consistency checking is a fundamental feature for active-active solutions like MLAG. We will try to levarage the info in the EAD-ES/EAD-EVI routes to detect inconsitencies in access config across VTEPs attached to the same Ethernet Segment. Functionality Overview - ======================== 1. Ethernet segments are created in zebra and associated with access VLANs. zebra sends that info as ES and ES-EVI objects to BGP. 2. BGP advertises EAD-ES and EAD-EVI routes for the locally attached ethernet segments. 3. Similarly BGP processes EAD-ES and EAD-EVI routes from peers and translates them into ES-VTEP objects which are then sent to zebra as remote ESs. 4. Each ES in zebra is associated with a list of active VTEPs which is then translated into a L2-NHG (nexthop group). This is the ES "Alias" entry 5. MAC-IP routes with a non-zero ESI use the alias entry created in (4.) to forward traffic i.e. a MAC-ECMP is done to these remote-ES destinations. EAD route management (route table and key) - ============================================ 1. Local EAD-ES routes a. route-table: per-ES route-table key: {RD=ES-RD, ESI, ET=0xffffffff, VTEP-IP) b. route-table: per-VNI route-table Not added c. route-table: global route-table key: {RD=ES-RD, ESI, ET=0xffffffff) 2. Remote EAD-ES routes a. route-table: per-ES route-table Not added b. route-table: per-VNI route-table key: {RD=ES-RD, ESI, ET=0xffffffff, VTEP-IP) c. route-table: global route-table key: {RD=ES-RD, ESI, ET=0xffffffff) 3. Local EAD-EVI routes a. route-table: per-ES route-table Not added b. route-table: per-VNI route-table key: {RD=0, ESI, ET=0, VTEP-IP) c. route-table: global route-table key: {RD=L2-VNI-RD, ESI, ET=0) 4. Remote EAD-EVI routes a. route-table: per-ES route-table Not added b. route-table: per-VNI route-table key: {RD=0, ESI, ET=0, VTEP-IP) c. route-table: global route-table key: {RD=L2-VNI-RD, ESI, ET=0) Please refer to bgp_evpn_mh.h for info on how the data-structures are organized. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
* bgpd: #if ENABLE_BGP_VNC -> #ifdef ENABLE_BGP_VNCQuentin Young2020-04-011-3/+3
| | | | | | | This macro is undefined if vnc is disabled, and while it defaults to 0, this is still wrong and causes issues with -Werror Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib, bgpd: Another round of `struct const prefix` cleanupDonald Sharp2020-03-261-2/+3
| | | | | | | Cleanup another set of functions that need to respect the const'ness of a prefix. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* bgpd: Rework code to use `const struct prefix`Donald Sharp2020-03-241-1/+1
| | | | | | | | Future work needs the ability to specify a const struct prefix value. Iterate into bgp a bit to get this started. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* bgpd, lib: More `const`ification of various codeDonald Sharp2020-03-231-3/+3
| | | | | | | More second order effects of cleaning up rn usage in bgp. Sprinkle the fairy const's all over the place. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* bgpd: Auto RD definitions and encodingvivek2018-04-251-0/+2
| | | | | | | | | Setup a per-VRF identifier to use along with the Router Id to build the RD. Define a function to encode the RD. Code is brought over from EVPN and EVPN code has been modified to use the generic function. Ticket: CM-20256 Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-11/+11
| | | | | | | | | | | | | | | | | | | | | | 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-24/+20
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: Separate out RD handling functionsvivek2017-07-121-0/+74
BGP Route Distinguisher (RD) handling is common for different flavors of BGP VPNs such as BGP/MPLS IP VPNs (RFC 4364) and BGP EVPNs (RFC 7432). Separate out the RD handling functions into its own files. Note: No functional change introduced with this commit. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>