summaryrefslogtreecommitdiff
path: root/bgpd/bgp_mplsvpn.h
AgeCommit message (Collapse)Author
2017-05-20bgpd: remove unused str2tag() functionRenato Westphal
This function is not used anymore since commit fb1d2a2d9. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-02-14bgpd: enhance EPVN vty show commandsPhilippe Guibert
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>
2017-01-27Merge remote-tracking branch 'origin/pr/113' into pr/111Donald Sharp
2017-01-27Merge remote-tracking branch 'origin/master' into pr/111Donald Sharp
2017-01-26Merge branch 'master' into working/master/patch-set/4-misc-fixesLou Berger
Merged pull request with master Conflicts: bgpd/bgp_mplsvpn.c bgpd/bgp_route.c bgpd/rfapi/rfapi_vty.c
2017-01-24bgpd: more VPN&ENCAP show afi safi related cleanupLou Berger
Issued ID'ed by regression Signed-off-by: Lou Berger <lberger@labn.net>
2017-01-24bgpd: fix ambiguity between show ip bgp ipv4|ipv6 encap|vpn commandsPhilippe Guibert
The commit is removed duplicated command show ip bgp ipv4|ipv6 enca|vpn command that is conflicting between bgp_route.c and bgp_mplsvpn.c/bgp_encap.c files. The fix is integrating the call to specific mpls or encap settings from inside bgp_show_route() function. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2017-01-22bgpd: add vrf-policy config using existing vnc codeLou Berger
add add/clear vrf prefix + Modified for FRR master parser Signed-off-by: Lou Berger <lberger@labn.net>
2017-01-18bgpd: add define of compilation for vpn commandsPhilippe Guibert
Use KEEP_OLD_VPN_COMMANDS define to brace some vty commands used by bgp to configure or show vpnvx contexts using old method, that is to say using vty keyword vpnv4 or vpnv6 command. In addition to this, the commit adds two new commands under route-map with new format: [no] set ipv4|ipv6 vpn nexthop <IPv4 Address> | <IPv6 Address> It also add following command in old format: [no] set vpnv6 nexthop <IPv6 Address> Note that the commit does not take into account the availability of old commands that are not available in new format. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com
2016-10-26bgpd: Remove the double-pass parsing of NLRIsPaul Jakma
* bgpd parses NLRIs twice, a first pass "sanity check" and then a second pass that changes actual state. For most AFI/SAFIs this is done by bgp_nlri_sanity_check and bgp_nlri_parse, which are almost identical. As the required action on a syntactic error in an NLRI is to NOTIFY and shut down the session, it should be acceptable to just do a one pass parse. There is no need to atomically handle the NLRIs. * bgp_route.h: (bgp_nlri_sanity_check) Delete * bgp_route.c: (bgp_nlri_parse) Make the prefixlen size check more general and don't hard-code AFI/SAFI details, e.g. use prefix_blen library function. Add error logs consistent with bgp_nlri_sanity_check as much as possible. Add a "defense in depth" type check of the prefixlen against the sizeof the (struct prefix) storage - ala bgp_nlri_parse_vpn. Update standards text from draft RFC4271 to the actual RFC4271 text. Extend the semantic consistency test of IPv6. E.g. it should skip mcast NLRIs for unicast safi as v4 does. * bgp_mplsvpn.{c,h}: Delete bgp_nlri_sanity_check_vpn and make bgp_nlri_parse_vpn_body the bgp_nlri_parse_vpn function again. (bgp_nlri_parse_vpn) Remove the notifies. The sanity checks were responsible for this, but bgp_update_receive handles sending NOTIFY generically for bgp_nlri_parse. * bgp_attr.c: (bgp_mp_reach_parse,bgp_mp_unreach_parse) Delete sanity check. NLRI parsing done after attr parsing by bgp_update_receive. Arising out of discussions on the need for two-pass NLRI parse with: Lou Berger <lberger@labn.net> Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-26bgpd: Regularise BGP NLRI sanity checks a bitPaul Jakma
* bgp_route.h: (bgp_nlri_sanity_check) The bulk of the args are equivalent to a (struct bgp_nlri), consolidate. * bgp_route.c: (bgp_nlri_sanity_check) Make this a frontend for all afi/safis. Including SAFI_MPLS_LABELED_VPN. (bgp_nlri_sanity_check_ip) Regular IP NLRI sanity check based on the existing code, and adjusted for (struct bgp_nlri *) arg. * bgp_attr.c: (bgp_mp_reach_parse) Adjust for passing (struct bgp_nlri *) to bgp_nlri_sanity_check. Get rid of special-casing to not sanity check VPN. (bgp_mp_unreach_parse) Ditto. * bgp_mplsvpn.c: Use the same VPN parsing code for both the sanity check and the actual parse. (bgp_nlri_parse_vpn) renamed to bgp_nlri_parse_vpn_body and made internal. (bgp_nlri_parse_vpn_body) Added (bool) argument to control whether it is sanity checking or whether it should update routing state for each NLRI. Send a NOTIFY and reset the session, if there's a parsing error, as bgp_nlri_sanity_check_ip does, and as is required by the RFC. (bgp_nlri_parse_vpn) now a wrapper to call _body with update. (bgp_nlri_sanity_check_vpn) wrapper to call parser without updating. * bgp_mplsvpn.h: (bgp_nlri_sanity_check_vpn) export for bgp_nlri_sanity_check. * bgp_packet.c: (bgp_update_receive) Adjust for bgp_nlri_sanity_check argument changes. * test/bgp_mp_attr_test.c: Extend to also test the NLRI parsing functions, if the initial MP-attr parsing has succeeded. Fix the NLRI in the VPN cases. Add further VPN tests. * tests/bgpd.tests/testbgpmpattr.exp: Add the new test cases. This commit a joint effort of: Lou Berger <lberger@labn.net> Donald Sharp <sharpd@cumulusnetworks.com> Paul Jakma <paul.jakma@hpe.com> / <paul@jakma.org>
2016-10-03bgpd: add L3/L2VPN Virtual Network Control featureLou Berger
This feature adds an L3 & L2 VPN application that makes use of the VPN and Encap SAFIs. This code is currently used to support IETF NVO3 style operation. In NVO3 terminology it provides the Network Virtualization Authority (NVA) and the ability to import/export IP prefixes and MAC addresses from Network Virtualization Edges (NVEs). The code supports per-NVE tables. The NVE-NVA protocol used to communicate routing and Ethernet / Layer 2 (L2) forwarding information between NVAs and NVEs is referred to as the Remote Forwarder Protocol (RFP). OpenFlow is an example RFP. For general background on NVO3 and RFP concepts see [1]. For information on Openflow see [2]. RFPs are integrated with BGP via the RF API contained in the new "rfapi" BGP sub-directory. Currently, only a simple example RFP is included in Quagga. Developers may use this example as a starting point to integrate Quagga with an RFP of their choosing, e.g., OpenFlow. The RFAPI code also supports the ability import/export of routing information between VNC and customer edge routers (CEs) operating within a virtual network. Import/export may take place between BGP views or to the default zebera VRF. BGP, with IP VPNs and Tunnel Encapsulation, is used to distribute VPN information between NVAs. BGP based IP VPN support is defined in RFC4364, BGP/MPLS IP Virtual Private Networks (VPNs), and RFC4659, BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN . Use of both the Encapsulation Subsequent Address Family Identifier (SAFI) and the Tunnel Encapsulation Attribute, RFC5512, The BGP Encapsulation Subsequent Address Family Identifier (SAFI) and the BGP Tunnel Encapsulation Attribute, are supported. MAC address distribution does not follow any standard BGB encoding, although it was inspired by the early IETF EVPN concepts. The feature is conditionally compiled and disabled by default. Use the --enable-bgp-vnc configure option to enable. The majority of this code was authored by G. Paul Ziemba <paulz@labn.net>. [1] http://tools.ietf.org/html/draft-ietf-nvo3-nve-nva-cp-req [2] https://www.opennetworking.org/sdn-resources/technical-library Now includes changes needed to merge with cmaster-next.
2016-09-30bgpd: eliminate RD related duplicate code in bgp_encap.cLou Berger
decode_rd_... apis are declared global in bgp_mplsvpn.c
2016-06-09bgpd: general MP/SAFI improvementsLou Berger
This fixes some minor mixups particularly in MPLS-related SAFIs, as well as doing some stylistic changes & adding comments. Signed-off-by: Lou Berger <lberger@labn.net> Reviewed-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 050defe816e4bd4cac7b028f69e45cb1974ca96d) Conflicts: bgpd/bgp_attr.c bgpd/bgp_attr.h bgpd/bgp_packet.c bgpd/bgp_route.c bgpd/bgp_route.h
2016-06-06bgpd: wire up VPNv6 protocol processingLou Berger
There wasn't much missing for VPNv6 to begin with; just a few bits of de- & encoding and a few lists to be updated. Signed-off-by: Lou Berger <lberger@labn.net> Signed-off-by: David Lamparter <equinox@opensourcerouting.org> [Editorial note: Signed-off-by may imply an authorship claim, but need not] Edited-by: Paul Jakma <paul.jakma@hpe.com> / <paul@jakma.org> (cherry picked from commit 9da04bca0e994ec92b9242159bf27d89c6743354) Conflicts: bgpd/bgp_attr.c bgpd/bgp_mplsvpn.c bgpd/bgpd.c
2016-06-06bgpd: handle AS4 and EOI route distinguishersLou Berger
Signed-off-by: Lou Berger <lberger@labn.net> Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit a03bd16eedc5077e98716509b8918ed365227e02) Conflicts: bgpd/bgp_mplsvpn.c
2005-06-282005-06-28 Paul Jakma <paul.jakma@sun.com>paul
* (global) The great bgpd extern and static'ification. * bgp_routemap.c: remove unused ROUTE_MATCH_ASPATH_OLD code (route_set_metric_compile) fix u_int32_t to ULONG_MAX comparison warnings. * bgp_route.h: (bgp_process, bgp_withdraw, bgp_update) export these used by various files which had their own private declarations, in the case of mplsvpn - incorrect.
2005-05-232005-05-23 Paul Jakma <paul@dishone.st>paul
* bgp_fsm.h: Add extern qualifier to exported functions * bgp_nexthop.c: add static to nexthop specific globals * *.h: Add guard defines
2004-10-132004-10-13 Paul Jakma <paul@dishone.st>paul
* (global) more const'ification and fixups of types to clean up code. * bgp_mplsvpn.{c,h}: (str2tag) fix abuse. Still not perfect, should use something like the VTY_GET_INTEGER macro, but without the vty_out bits.. * bgp_routemap.c: (set_aggregator_as) use VTY_GET_INTEGER_RANGE (no_set_aggregator_as) ditto. * bgpd.c: (peer_uptime) fix unlikely bug, where no buffer is returned, add comments about troublesome return value.
2004-06-042004-06-04 Paul Jakma <paul@dishone.st>paul
* type mismatch fixes
2002-12-13Initial revisionpaul