summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_route.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2073 from pguibert6WIND/bgp_fs_pbrRuss White2018-05-031-1/+2
|\ | | | | Bgp Flowspec Policy Based Routing
| * bgpd: allow flowspec entries to be announced to zebraPhilippe Guibert2018-04-301-1/+2
| | | | | | | | | | | | Flowspec entries are allowed to be announced. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | bgpd: when showing routes, add nexthop vrf and announce-self flagG. Paul Ziemba2018-04-281-3/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | As part of recent vpn-vrf leaking changes, it is now possible for a route to refer to a nexthop in a different vrf. There is also a new route flag that means "when announcing this route, indicate myself as the next-hop." route_vty_out(): nexthops are appended with: "@VRFID" (where VRFID is the numerical vrf id) when different from the route's vrf; "<" when the route's BGP_INFO_ANNC_NH_SELF is set This change also shows the route table's vrf id in the table header. route_vty_out_detail(): show nexthop's vrf and announce-nh-self flag if appropriate. Both functions are also augmented to add json elements nhVrfId, nhVrfName, and announceNexthopSelf as appropriate. The intent of these changes is to make it easier to understand/debug the relationship between a route and its nexthops. Signed-off-by: G. Paul Ziemba <paulz@labn.net>
* bgpd: nexthop tracking with labels for vrf-vpn leakingG. Paul Ziemba2018-04-041-0/+1
| | | | | | | | | | | | | | | Routes that have labels must be sent via a nexthop that also has labels. This change notes whether any path in a nexthop update from zebra contains labels. If so, then the nexthop is valid for routes that have labels. If a nexthop update has no labeled paths, then any labeled routes referencing the nexthop are marked not valid. Add a route flag BGP_INFO_ANNC_NH_SELF that means "advertise myself as nexthop when announcing" so that we can track our notion of the nexthop without revealing it to peers. Signed-off-by: G. Paul Ziemba <paulz@labn.net>
* bgpd: support for show bgp ipv4 flowspecPhilippe Guibert2018-03-301-1/+2
| | | | | | | | | | The show bgp ipv4 flowspec routine is made available, displays the flowspec rules contained in the BGP FIB database, as well as the actions to be done on those rules. Two routines are available: show bgp ipv4 flowspec show bgp ipv4 flowspec detail Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-34/+32
| | | | | | | | | | | | | | | | | | | | | | 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>
* bgpd: vpn-vrf route leakingG. Paul Ziemba2018-03-091-0/+25
| | | | | | | | - add "debug bgp vpn label" CLI - improved debug messages for "debug bgp bestpath" - send vrf label to zebra after zebra informs bgpd of vrf_id - withdraw vrf_label from zebra if zebra informs bgpd that vrf_id is disabled Signed-off-by: G. Paul Ziemba <paulz@labn.net>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-4/+2
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* Merge pull request #1654 from mkanjari/evpn-symm-routing-enhancementsPhilippe Guibert2018-02-081-7/+10
|\ | | | | Evpn symmetric routing enhancements
| * bgpd: carry two MPLS labels in EVPN NLRIsMitesh Kanjariya2018-01-241-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When doing symmetric routing, EVPN type-2 (MACIP) routes need to be advertised with two labels (VNIs) the first being the L2 VNI (identifying the VLAN) and the second being the L3 VNI (identifying the VRF). The receive processing needs to handle one or two labels too. Ticket: CM-18489 Review: CCR-6949 Testing: manual and bgp/evpn/mpls smoke Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* | bgpd: bgp_afi_node_get is listed 2 times in bgp_route.hDonald Sharp2018-02-031-2/+0
|/ | | | | | Remove the extra. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* bgpd: advertise/withdraw type-5 routes upon user configmitesh2017-12-141-1/+4
| | | | | | | | | | | | | CLI config for enabling/disabling type-5 routes router bgp <as> vrf <vrf> address-family l2vpn evpn [no] advertise <ipv4|ipv6|both> loop through all the routes in VRF instance and advertise/withdraw all ip routes as type-5 routes in default instance. Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
* bgpd: Allow bgp to understand the different nexthop typesDonald Sharp2017-11-161-3/+5
| | | | | | | | | | | | | | | | When BGP is being redistributed prefixes, allow it to understand the nexthop type. This fixes the issue where a blackhole route was being interpreted to having a nexthop of 1.0.0.0( ruh-roh!!! ). This broke downstream neighbors as that they would receive a 1.0.0.0 nexthop, which is bad, very very bad. This commit sets us up for the future where we can match a route-map against a nexthop type. In that bgp is now at least nominally paying attention to the type. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* bgpd: unify 'show bgp' with RD with normal unicast bgp showLou Berger2017-10-051-0/+4
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* Merge pull request #1047 from dwalton76/bgpd-draft-ietf-grow-bgp-gshut-10Renato Westphal2017-09-051-0/+1
|\ | | | | bgpd: implement draft-ietf-grow-bgp-gshut-10
| * Merge branch 'master' of https://github.com/dwalton76/frr into ↵Daniel Walton2017-08-281-2/+2
| |\ | | | | | | | | | | | | | | | | | | bgpd-draft-ietf-grow-bgp-gshut-10 Conflicts: bgpd/bgp_route.c
| * | bgpd: implement draft-ietf-grow-bgp-gshut-10Daniel Walton2017-08-251-0/+1
| | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | | *: fix styleQuentin Young2017-08-301-2/+4
| | | | | | | | | | | | | | | | | | Fixes style nits introduced by recent pull requests. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | | Merge pull request #1056 from opensourcerouting/oldbits-0Donald Sharp2017-08-291-6/+3
|\ \ \ | | | | | | | | "pathspace" options, vtysh-suid-cleanups, "vty_frame()"
| * | | bgpd: get rid of afi_header_vty_out() & co.David Lamparter2017-08-291-6/+3
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | afi_header_vty_out() is easily replaced with vty_frame(), which means we can drop a whole batch of "int *write" args as well as the entirety of bgp_config_write_family_header(). => AFI/SAFI config writing is now a lot simpler. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | | Merge branch 'master' into dev-masterMitesh Kanjariya2017-08-291-2/+2
|\| |
| * | *: use zapi_route to send/receive redistributed routes as wellRenato Westphal2017-08-241-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some differences compared to the old API: * Now the redistributed routes are sent using address-family independent messages (ZEBRA_REDISTRIBUTE_ROUTE_ADD and ZEBRA_REDISTRIBUTE_ROUTE_DEL). This allows us to unify the ipv4/ipv6 zclient callbacks in the client daemons and thus remove a lot of duplicate code; * Now zebra sends all nexthops of the redistributed routes to the client daemons, not only the first one. This shouldn't have any noticeable performance implications and will allow us to remove an ugly exception we had for ldpd (which needs to know all nexthops of the redistributed routes). The other client daemons can simply ignore the nexthops if they want or consult just the first one (e.g. ospfd/ospf6d/ripd/ripngd). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* / bgpd: Ignore EVPN routes from CLAG peer when VNI comes upMitesh Kanjariya2017-08-171-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two parts to this commit: 1. create a database of self tunnel-ip for used in martian nexthop check In a CLAG setup, the tunnel-ip (VNI UP) notification comes before the clag-anycast-ip comes up in the system. This was causing our self next hop check to fail and we were instaling routes with martian nexthop in zebra. We need to keep this info in a seperate database for all local tunnel-ip. This database will be used in parallel with the self next hop database to martian nexthop checks. 2. When a local VNI comes up, update the tunnel-ip database and filter routes in the RD table if necessary In case of EVPN we might receive routes from clag peer before the clag-anycast ip and VNI is up on the system. We will store the routes in the RD table for later processing. When VNI comes UP, we loop thorugh all the routes and install them in zebra if required. However, we were missing the martian nexthop check in this code path. From now onwards, when a VNI comes UP, we will first update the tunnel-ip database We then loop through all the routes in RD table and apply martian next hop filter if required. Things not covered in this commit but are required: This processing is needed in general when an address becomes a connected address. We need to loop through all the routes in BGP and apply martian nexthop filter if necessary. This will be taken care in a seperate bug Ticket:CM-17271/CM-16911 Reviewed By: ccr-6542 Testing Done: Manual Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
* Revert "*: reindent pt. 2"David Lamparter2017-07-221-2/+4
| | | | | | | | | This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. clang 5 is not widely available enough for people to indent with. This is particularly problematic when rebasing/adjusting branches. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: reindent pt. 2whitespace / reindent2017-07-171-4/+2
| | | | | | | | w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-285/+286
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attrDonald Sharp2017-07-141-4/+4
|\
| * *: ditch vty_outln(), part 2 of 2David Lamparter2017-07-141-4/+4
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | bgpd: Refactor 'struct attr_extra' into 'struct attr'Donald Sharp2017-07-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the attributes in 'struct attr_extra' allow for the more interesting cases of using bgp. The extra overhead of managing it will induce errors as we add more attributes and the extra memory overhead is negligible on anything but full bgp feeds. Additionally this greatly simplifies the code for the handling of data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> bgpd: Fix missing label set Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | bgpd: Display (show) commands for EVPNvivek2017-07-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement various operational/display commands for EVPN: - show bgp evpn summary - show bgp evpn vni [<vni>] - show bgp evpn route [type <macip|multicast>] - show bgp evpn route [rd <rd> [type <macip|multicast>]] - show bgp evpn route [rd <rd> [mac <mac> [ip <ip>]]] - show bgp evpn route vni <vni> [type <macip|multicast> | vtep <ip>] - show bgp evpn route vni <vni> [mac <mac> [ip <ip>]]] - show bgp evpn route vni <vni> [multicast <ip>] - show bgp evpn route vni all [vtep <ip>] - show bgp evpn import-rt Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
* | bgpd: EVPN route handlingvivek2017-07-121-2/+30
|/ | | | | | | | | | | | | | | | | Core EVPN route handling functionality. This includes support for the following: - interface with zebra to learn about local VNIs and MACIPs as well as to install remote VTEPs (per VNI) and remote MACIPs - create/update/delete EVPN type-2 and type-3 routes - attribute creation, route selection and install - route handling per VNI and for the global routing table - parsing of received EVPN routes and handling by route type - encoding attributes for EVPN routes and EVPN prefix creation (for Updates) Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
* Merge branch 'master' of https://github.com/dwalton76/frr into ↵Daniel Walton2017-06-301-3/+3
|\ | | | | | | | | | | | | bgpd-ipv4-plus-label-misc3 Conflicts: bgpd/bgp_route.c
| * *: use vty_outlnQuentin Young2017-06-291-3/+3
| | | | | | | | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST tableDaniel Walton2017-06-161-4/+4
|/ | | | | | | | | | | | | | | | | | | | | 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.
* Merge branch 'frr/pull/569'David Lamparter2017-05-181-2/+2
|\ | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: fix config of v6 vpn networks tagsLou Berger2017-05-171-2/+2
| | | | | | | | Signed-off-by: Lou Berger <lberger@labn.net>
* | *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-18/+18
| | | | | | | | | | | | | | | | | | | | | | 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: use correct type for rfapi thread pointerQuentin Young2017-05-051-1/+1
| | | | | | | | | | | | | | Pointer to void always points at the same thing so make it the type of the thing that it points at Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | bgpd, zebra: Implement BGP Prefix-SID IETF draftVivek Venkatraman2017-04-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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 configuration of the global label block (SRGB) and configuration of a label-index for a network in BGP. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* | bgpd: labeled unicast processingDon Slice2017-04-061-1/+12
|/ | | | | | | | | 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>
* bgpd: change str2mac call apiPhilippe Guibert2017-02-141-1/+1
| | | | | | | | | With the changed API, some adaptations are done in rfapi code, and in bgpd evpn code. For evpn code, the internal storage of routermac addr is kept as struct ethaddr structure. Also the evpn add_routermac api has as incoming parameter a struct ethaddr param. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bgpd: replace AFI_ETHER reference with AFI_L2VPN refPhilippe Guibert2017-02-141-1/+1
| | | | | | | The introduction of AFI_L2VPN prefix makes usage of AFI_ETHER deprecated and is of no usage currently. The former replaces the latter one. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bgpd: enhance network command for evpn route type 5Philippe Guibert2017-02-141-2/+4
| | | | | | | | | | | | | | | | | | | | A new vty command available under evpn address family. This command takes following format: (af-evpn)# [no] network <A.B.C.D/M|X:X::X:X/M> rd ASN:nn_or_IP-address:nn ethtag WORD label WORD esi WORD gwip A.B.C.D routermac WORD [route-map WORD] Among new parameters, ethtag stands for the ethernet tag indentifier. ESI stands for the ethernet segment identifier, and must be entered in following format: 00:11:22:33:44:55:66:77:88:99. gwip stands for the gateway IP address contained in RT5 message. A check is done on that value since if gwip is ipv4, then ip prefix must be ipv4. The same for ipv6. RouterMAc is the gateway mac address sent as extended community attribute. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bgpd: enhance EPVN vty show commandsPhilippe Guibert2017-02-141-0/+3
| | | | | | | | | | | | | | This patch introduces show show bgp evpn commands to dump NLRI entries configured or received on BGP, related to EVPN New command introduced is the following: show [ip] bgp l2vpn evpn [all | rd <rd name> ] [overlay] Like for MPLS, similar set of commands is added for EVPN: show [ip] bgp l2vpn evpn [all|rd <RDNAME>] show [ip] bgp l2vpn evpn all neighbor <NEIGHBOR> routes show [ip] bgp l2vpn evpn all neighbor <NEIGHBOR> advertised-routes Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bgpd: add EVPN RT5 gatewayIp address to bgp_static contextPhilippe Guibert2017-02-141-0/+1
| | | | | | | This field can be either IPv4 or IPv6 address and is filled in in bgp_static configuration structure. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bgpd: introduction of vxlan tunnel attributePhilippe Guibert2017-02-141-0/+1
| | | | | | | | | As per draft-ietf-idr-tunnel-encaps-02, section 3.2.1, BGP Encap attribute supports vxlan tunnel type. A new tunnel attribute has been appended to subtlv list, describing the vxlan network identifier to be used for the routing information of the BGP update message. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bgpd: route type 5 internal structures plus processingPhilippe Guibert2017-02-141-0/+4
| | | | | | | | | The commit introduces the changes to be done to carry route type 5 EVPN information in bgp extra attribute information. The commit also handles the update processing for route type 5 information, including ESI, gatewayIP and label information. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bgpd: handling EVPN Route Type 5 NLRI messagePhilippe Guibert2017-02-141-3/+5
| | | | | | | | | | | | | | This patch introduces code to receive a NLRI message with route type 5, as defined in draft-ietf-bess-evpn-prefix-advertisement-02. It It increases the number of parameters to extract from the NLRI and to store into bgp extra information structure. Those parameters are the ESI (ethernet segment identifier), the gateway IP Address (which acts like nexthop attribute but is contained inside the NLRI itself) and the ethernet tag identifier ( that acts for the VXLan Identifier) This patch updates bgp_update() and bgp_withdraw() api, and then does the necessary adapations for rfapi. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* Merge remote-tracking branch 'origin/master' into pr/111Donald Sharp2017-01-271-0/+3
|\
* | bgpd: move bgp_show_type enumerate to bgp_route.hPhilippe Guibert2017-01-241-0/+22
|/ | | | | | | | This bgp_show_type enumerate was duplicated and modified in several places. The commit takes the enumerate with the biggest enumerate, so that it can be used by all the functions using this enumerate. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>