summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_vty.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #12805 from karlquan/kquan_self_origRuss White2023-02-211-0/+3
|\ | | | | bgpd: BGP troubleshooting - Add a keyword self-originate to display o…
| * bgpd: BGP troubleshooting - Add a keyword self-originate to display only ↵Karl Quan2023-02-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | self-originated prefixes when looking at the BGP table for a given address-family Add a keyword self-originate" to extend current CLI commands to filter out self-originated routes only a\) CLI to show ipv4/ipv6 self-originated routes "show [ip] bgp [afi] [safi] [all] self-originate [wide|json]" b\) CLI to show evpn self-originated routes "show bgp l2vpn evpn route [detail] [type <ead|macip|multicast|es|prefix|1|2|3|4|5>] self-originate [json]" Signed-off-by: Karl Quan <kquan@nvidia.com>
* | Merge pull request #12248 from pguibert6WIND/bgpasdotRuss White2023-02-211-1/+2
|\ \ | | | | | | lib, bgp: add initial support for asdot format
| * | bgpd: add as-notation keyword to 'router bgp' vty commandPhilippe Guibert2023-02-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new keyword permits changing the BGP as-notation output: - [no] router bgp <> [vrf BLABLA] [as-notation [<dot|plain|dot+>]] At the BGP instance creation, the output will inherit the way the BGP instance is declared. For instance, the 'router bgp 1.1' command will configure the output in the dot format. However, if the client wants to choose an alternate output, he will have to add the extra command: 'router bgp 1.1 as-notation dot+'. Also, if the user wants to have plain format, even if the BGP instance is declared in dot format, the keyword can also be used for that. The as-notation output is only taken into account at the BGP instance creation. In the case where VPN instances are used, a separate instance may be dynamically created. In that case, the real as-notation format will be taken into acccount at the first configuration. Linking the as-notation format with the BGP instance makes sense, as the operators want to keep consistency of what they configure. One technical reason why to link the as-notation output with the BGP instance creation is that the as-path segment lists stored in the BGP updates use a string representation to handle aspath operations (by using regexp for instance). Changing on the fly the output needs to regenerate this string representation to the correct format. Linking the configuration to the BGP instance creation avoids refreshing the BGP updates. A similar mechanism is put in place in junos too. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| * | bgpd: store the bgp as identifier in the configured as-notationPhilippe Guibert2023-02-101-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preliminary work to handle various ways to configure a BGP Autonomous System. When creating a BGP instance, the user may want to define the AS number as a dotted value, instead of using an integer value. To handle both cases, an as_pretty char attribute will store the as number as it has been given to the vtysh command: router bgp <as number> Whenever the as integer of the BGP instance was dumped, the as_pretty original format is used. The json output reuses the integer value to keep backward compatibility with old displays. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp2023-02-171-16/+1
|\ \ | | | | | | *: convert to SPDX License identifiers
| * | *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-16/+1
| |/ | | | | | | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* / bgpd: Add BGP Software Version CapabilityDonatas Abraitis2023-02-151-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement: https://datatracker.ietf.org/doc/html/draft-abraitis-bgp-version-capability Tested with GoBGP: ``` % ./gobgp neighbor 192.168.10.124 BGP neighbor is 192.168.10.124, remote AS 65001 BGP version 4, remote router ID 200.200.200.202 BGP state = ESTABLISHED, up for 00:01:49 BGP OutQ = 0, Flops = 0 Hold time is 3, keepalive interval is 1 seconds Configured hold time is 90, keepalive interval is 30 seconds Neighbor capabilities: multiprotocol: ipv4-unicast: advertised and received ipv6-unicast: advertised route-refresh: advertised and received extended-nexthop: advertised Local: nlri: ipv4-unicast, nexthop: ipv6 UnknownCapability(6): received UnknownCapability(9): received graceful-restart: advertised and received Local: restart time 10 sec ipv6-unicast ipv4-unicast Remote: restart time 120 sec, notification flag set ipv4-unicast, forward flag set 4-octet-as: advertised and received add-path: received Remote: ipv4-unicast: receive enhanced-route-refresh: received long-lived-graceful-restart: advertised and received Local: ipv6-unicast, restart time 10 sec ipv4-unicast, restart time 20 sec Remote: ipv4-unicast, restart time 0 sec, forward flag set fqdn: advertised and received Local: name: donatas-pc, domain: Remote: name: spine1-debian-11, domain: software-version: advertised and received Local: GoBGP/3.10.0 Remote: FRRouting/8.5-dev-MyOwnFRRVersion-gdc92f44a45-dirt cisco-route-refresh: received Message statistics: ``` FRR side: ``` root@spine1-debian-11:~# vtysh -c 'show bgp neighbor 192.168.10.17 json' | \ > jq '."192.168.10.17".neighborCapabilities.softwareVersion.receivedSoftwareVersion' "GoBGP/3.10.0" root@spine1-debian-11:~# ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* bgpd: Fix graceful-restart JSON outputs and the crashDonatas Abraitis2022-12-111-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch: ``` donatas-pc# show bgp neighbors graceful-restart json vtysh: error reading from bgpd: Resource temporarily unavailable (11)Warning: closing connection to bgpd because of an I/O error! donatas-pc# ``` And, invalid JSON generated when multiple neighbors exist due to json_neighbor being freed in a loop. After the patch: ``` donatas-pc# show bgp ipv4 neighbors 192.168.10.124 graceful-restart json { "192.168.10.124":{ "neighborAddr":"192.168.10.124", "localGrMode":"Helper*", "remoteGrMode":"Restart", "rBit":false, "nBit":true, "timers":{ "configuredRestartTimer":120, "receivedRestartTimer":120 }, "ipv4Unicast":{ "fBit":true, "endOfRibStatus":{ "endOfRibSend":true, "endOfRibSentAfterUpdate":false, "endOfRibRecv":true }, "timers":{ "stalePathTimer":360 } } } } donatas-pc# show bgp neighbors graceful-restart json { "192.168.10.124":{ "neighborAddr":"192.168.10.124", "localGrMode":"Helper*", "remoteGrMode":"Restart", "rBit":false, "nBit":true, "timers":{ "configuredRestartTimer":120, "receivedRestartTimer":120 }, "ipv4Unicast":{ "fBit":true, "endOfRibStatus":{ "endOfRibSend":true, "endOfRibSentAfterUpdate":false, "endOfRibRecv":true }, "timers":{ "stalePathTimer":360 } } }, "2a02:4780:abc::2":{ "neighborAddr":"2a02:4780:abc::2", "localGrMode":"Helper*", "remoteGrMode":"Restart", "rBit":false, "nBit":true, "timers":{ "configuredRestartTimer":120, "receivedRestartTimer":120 }, "ipv4Unicast":{ "fBit":true, "endOfRibStatus":{ "endOfRibSend":true, "endOfRibSentAfterUpdate":false, "endOfRibRecv":true }, "timers":{ "stalePathTimer":360 } }, "ipv6Unicast":{ "fBit":true, "endOfRibStatus":{ "endOfRibSend":true, "endOfRibSentAfterUpdate":true, "endOfRibRecv":true }, "timers":{ "stalePathTimer":360 } } } } donatas-pc# ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* Merge pull request #11523 from pguibert6WIND/bgp_no_retainRuss White2022-07-261-0/+1
|\ | | | | Bgp no retain
| * bgpd: implement retain route-target all behaviourPhilippe Guibert2022-07-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A new command is available under SAFI_MPLS_VPN: With this command, the BGP vpnvx prefixes received are not kept, if there are no VRF interested in importing those vpn entries. A soft refresh is performed if there is a change of configuration: retain cmd, vrf import settings, or route-map change. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | bgpd: Add constants for some repetitive CLI stringsDonatas Abraitis2022-07-181-9/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Address Family\n" "Address Family modifier\n" Before: ``` donatas-laptop(config-router)# address-family ipv4 <cr> flowspec Address Family Modifier labeled-unicast Address Family modifier multicast Address Family modifier unicast Address Family Modifier vpn Address Family modifier ``` After: ``` donatas-laptop(config-router)# address-family ipv4 Address Family ipv6 Address Family l2vpn Address Family donatas-laptop(config-router)# address-family ipv4 <cr> flowspec Address Family modifier labeled-unicast Address Family modifier multicast Address Family modifier unicast Address Family modifier vpn Address Family modifier ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* bgpd: Implement CEASE/Hard Reset notificationDonatas Abraitis2022-05-021-13/+12
| | | | | | | | | | Also, add N-Bit (Notification) flag for Graceful Restart. This is a preparation for RFC8538. More information: https://datatracker.ietf.org/doc/html/rfc8538 Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* bgpd: Add BGP configuration start/end markersDonatas Abraitis2022-03-221-0/+1
| | | | | | | | Delay BGP configuration until we receive end-configuration hook to make sure we don't send partial updates to peer which leads to broken Graceful-Restart. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* Revert "bgpd: convert global config to transactional cli"Igor Ryzhov2021-08-031-7/+0
| | | | | | This reverts commit ff8a8a7ac10b3211d5586c29dfcc5a3b32841029. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* Revert "bgpd: convert addr-family clis to transactional clis"Igor Ryzhov2021-08-031-8/+1
| | | | | | This reverts commit 37a87b8f9865fe17a235b9a76a0dc47f03aae3df. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* Revert "bgpd: neighbor peergrp config to transactional cli"Igor Ryzhov2021-08-031-15/+0
| | | | | | This reverts commit f4b8ec07219cce13c8627efe311247ee06f3a8ab. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* bgpd: add terse display option on show bgp summaryLouis Scalbert2021-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a terse option to show bgp summary to shorten output. Do not show the following information about the BGP instances: the number of RIB entries, the table version and the used memory. The "terse" option can be used in combination with the "remote-as", "neighbor", "failed" and "established" filters, and with the "wide" option as well. Before patch: ubuntu# show bgp summary remote-as 123456 IPv4 Unicast Summary (VRF default): BGP router identifier X.X.X.X, local AS number XXX vrf-id 0 BGP table version 0 RIB entries 3, using 552 bytes of memory Peers 5, using 3635 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc 10.200.200.2 4 123456 81432 4 0 56092 0 00:00:13 572106 0 N/A Displayed neighbors 1 Total number of neighbors 4 IPv6 Unicast Summary (VRF default): BGP router identifier X.X.X.X, local AS number XXX vrf-id 0 BGP table version 0 RIB entries 3, using 552 bytes of memory Peers 5, using 3635 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc % No matching neighbor Total number of neighbors 5 After patch: ubuntu# show bgp summary remote-as 123456 terse IPv4 Unicast Summary (VRF default): BGP router identifier X.X.X.X, local AS number XXX vrf-id 0 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc 10.200.200.2 4 123456 81432 4 0 56092 0 00:00:13 572106 0 N/A Displayed neighbors 1 Total number of neighbors 4 IPv6 Unicast Summary (VRF default): BGP router identifier X.X.X.X, local AS number XXX vrf-id 1 % No matching neighbor Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* bgpd: add show bgp summary filter by neighbor or ASLouis Scalbert2021-05-261-1/+2
| | | | | | | | | | | | | | | | | | | | | Add ability to filter session on show bgp summary by neighbor or remote AS: ubuntu# show bgp summary ? neighbor Show only the specified neighbor session remote-as Show only the specified remote AS session ubuntu# show bgp summary neighbor ? A.B.C.D Neighbor to display information about WORD Neighbor on BGP configured interface X:X::X:X Neighbor to display information about ubuntu# show bgp summary remote-as ? (1-4294967295) AS number external External (eBGP) AS sessions internal Internal (iBGP) AS sessions This patch includes the documentation and the topotest. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* bgpd: Create BGP alias names for community/large-communityDonatas Abraitis2021-05-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Show alias name instead of numerical value in `show bgp <prefix>. E.g.: ``` root@exit1-debian-9:~/frr# vtysh -c 'sh run' | grep 'bgp community alias' bgp community alias 65001:123 community-1 bgp community alias 65001:123:1 lcommunity-1 root@exit1-debian-9:~/frr# ``` ``` exit1-debian-9# sh ip bgp 172.16.16.1/32 BGP routing table entry for 172.16.16.1/32, version 21 Paths: (2 available, best #2, table default) Advertised to non peer-group peers: 65030 192.168.0.2 from home-spine1.donatas.net(192.168.0.2) (172.16.16.1) Origin incomplete, metric 0, valid, external, best (Neighbor IP) Community: 65001:12 65001:13 community-1 65001:65534 Large Community: lcommunity-1 65001:123:2 Last update: Fri Apr 16 12:51:27 2021 exit1-debian-9# ``` Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* bgpd: Activate ipv6-unicast for peer automatically if globally definedDonatas Abraitis2021-02-281-3/+3
| | | | | | | | | When you use a single BGP session for both IPv4 and IPv6 it's a bit annoying going into ipv6 address-family and explicitly activating it. Let's get this automatically if enabled with `bgp default ipv6-unicast`. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* bgpd: Add `show bgp summary wide` commandDonatas Abraitis2021-01-281-2/+7
| | | | | | Add LocalAS into wide output and extend Desc to 64 chars instead of 20. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* bgpd: neighbor peergrp config to transactional cliChirag Shah2020-10-271-0/+15
| | | | Signed-off-by: Chirag Shah <chirag@nvidia.com>
* bgpd: convert addr-family clis to transactional clisChirag Shah2020-10-261-1/+8
| | | | | | | | Convert IPv4 and IPv6 unicast address family clis to transactional clis and implementation of northbound callbacks. Signed-off-by: Chirag Shah <chirag@nvidia.com>
* bgpd: convert global config to transactional cliChirag Shah2020-10-031-0/+7
| | | | | | | Convert global congigurations clis to transactional clis using northbound plugin callbacks. Signed-off-by: Chirag Shah <chirag@nvidia.com>
* bgpd: Add command to show only established sessionsDonatas Abraitis2020-07-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` exit1-debian-9# show bgp summary IPv4 Unicast Summary: BGP router identifier 192.168.0.1, local AS number 100 vrf-id 0 BGP table version 8 RIB entries 15, using 2880 bytes of memory Peers 2, using 43 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt 192.168.0.2 4 200 10 6 0 0 0 00:00:35 8 8 2a02:4780::2 4 0 0 1 0 0 0 never Active 0 Total number of neighbors 2 exit1-debian-9# show bgp summary established IPv4 Unicast Summary: BGP router identifier 192.168.0.1, local AS number 100 vrf-id 0 BGP table version 8 RIB entries 15, using 2880 bytes of memory Peers 2, using 43 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt 192.168.0.2 4 200 10 6 0 0 0 00:00:39 8 8 Total number of neighbors 2 exit1-debian-9# show bgp summary failed IPv4 Unicast Summary: BGP router identifier 192.168.0.1, local AS number 100 vrf-id 0 BGP table version 8 RIB entries 15, using 2880 bytes of memory Peers 2, using 43 KiB of memory Neighbor EstdCnt DropCnt ResetTime Reason 2a02:4780::2 0 0 never Waiting for peer OPEN Total number of neighbors 2 exit1-debian-9# ``` Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* bgpd: take into account code style recommendations.Philippe Guibert2020-04-081-3/+2
| | | | | | | | take into account polychaeta tips ono code style. also, take into account miscellaneous code style recommandations like braces usage. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bgpd: new vty command to dump all bgp per vrf statisticsPhilippe Guibert2020-03-311-0/+3
| | | | | | | | this command is a shortcut to facilitate the extraction of statistics for all afi/safi related to one bgp instance. the command is: show bgp [vrf XX] statistics-all [json] Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* bgpd, lib: fix style from BGP GR codeQuentin Young2020-02-041-70/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the noncompliant style for the following commit range: 4a6e80fbf 2ba1fe695 efcb2ebbb 8c48b3b69 dc95985fe 0f0444fbd 85ef4179a eb451ee58 2d3dd828d 9e3b51a7f d6e3c15b6 34aa74486 6102cb7fe d7b3cda6f 2bb5d39b1 5f9c1aa29 5cce3f054 3a75afa4b f009ff269 cfd47646b 2986cac29 055679e91 034e185dc 794b37d52 b0965c44e 949b0f24f 63696f1d8 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: Adding header files for BGPD-ZEBRA integration for GR.bisdhdh2020-01-231-0/+61
| | | | | | | | Data Structures, function declaration and Macros forSignalling from BGPD to ZEBRA to enable or disable GR feature in ZEBRA depending on bgp per peer gr configuration. Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
* bgpd: Restarting node does not send EOR after the convergence.bisdhdh2020-01-231-0/+21
| | | | | | | | | | | | *After a restarting router comes up and the bgp session is successfully established with the peer. If the restarting router doesn’t have any route to send, it send EOR to the peer immediately before receiving updates from its peers. *Instead the restarting router should send EOR, if the selection deferral timer is not running OR count of eor received and eor required are matches then send EOR. Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
* bgpd: Adding BGP GR Global & Per Neighbour FSM changesbisdhdh2020-01-231-4/+0
| | | | | | | | * Added FSM for peer and global configuration for graceful restart * Added debug option BGP_GRACEFUL_RESTART for logs specific to graceful restart processing Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
* bgpd: BGP Graceful Restart Per Neighbor(BGPN), DS & header files.bisdhdh2020-01-231-1/+27
| | | | | | | This pr contains all the header files changes for BGP GR per Neighbour(BGPN) feature. Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
* bgpd: use new defaults system (v2)David Lamparter2019-12-061-0/+4
| | | | | | | | | | | This moves all the DFLT_BGP_* stuff over to the new defaults mechanism. bgp_timers_nondefault() added to get better file-scoping. v2: moved everything into bgp_vty.c so that the core BGP code is independent of the CLI-specific defaults. This should make the future northbound conversion easier. Signed-off-by: David Lamparter <equinox@diac24.net>
* bgpd: move config-write to bgp_vty.cDavid Lamparter2019-12-061-2/+1
| | | | | | | There's no good reason to have this in bgpd.c; it's just there historically. Move it to bgp_vty.c where it makes more sense. Signed-off-by: David Lamparter <equinox@diac24.net>
* bgpd: Add a new command to only show failed peeringsDinesh G Dutt2019-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a data center, having 32-128 peers is not uncommon. In such a situation, to find a peer that has failed and why is several commands. This hinders both the automatability of failure detection and the ease/speed with which the reason can be found. To simplify this process of catching a failure and its cause quicker, this patch does the following: 1. Created a new function, bgp_show_failed_summary to display the failed summary output for JSON and vty 2. Created a new function to display the reset code/subcode. This is now used in the failed summary code and in the show neighbors code 3. Added a new variable failedPeers in all the JSON outputs, including the vanilla "show bgp summary" family. This lists the failed session count. 4. Display peer, dropped count, estd count, uptime and the reason for failure as the output of "show bgp summary failed" family of commands 5. Added three resset codes for the case where we're waiting for NHT, waiting for peer IPv6 addr, waiting for VRF to init. This also counts the case where only one peer has advertised an AFI/SAFI. The new command has the optional keyword "failed" added to the classical summary command. The changes affect only one existing output, that of "show [ip] bgp neighbors <nbr>". As we track the lack of NHT resolution for a peer or the lack of knowing a peer IPv6 addr, the output of that command will show a "waiting for NHT" etc. as the last reset reason. This patch includes update to the documentation too. Signed-off-by: Dinesh G Dutt <5016467+ddutt@users.noreply.github.com>
* bgpd: Eliminate all incorrect formulations of afi/safi in JSONDinesh G Dutt2019-08-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | In a number of places, the JSON output had invalid key names for AFI/SAFI. For example, the key name in JSON was "IPv4 Unicast" which is invalid as a JSON Key name. Many JSON tools such as those used in Ansible, jq etc. all fail to parse the output in these scenarios. The valid name is ipv4Unicast. There's already a routine afi_safi_json() defined to handle this change, but it was not consistently called. The non-JSON version was called afi_safi_print() and it merely returned the CLI version of the string, didn't print anything. This patch deals with this issue by: - Renaming afi_safi_print to get_afi_safi_str() - get_afi_safi_str takes an additional param, for_json which if true will return the JSON-valid string - Renaming afi_safi_json to get_afi_safi_json_str() - Creating a new routine get_afi_safi_vty_str() for printing to vty - Consistently using get_afi_safi_str() with the appropriate for_json value Signed-off-by: Dinesh G Dutt <5016467+ddutt@users.noreply.github.com>
* bgpd/ospfd: make bgp and ospf json response a bit more consistentDon Slice2018-08-301-2/+3
| | | | | | | | | | | | | | Problem reported that some bgp and ospf json commands did not return any json output at all if the bgp/ospf instance did not exist. Additionally, some bgp and ospf json commands did not return any json output if the instance existed but no neighbors were defined. This fix makes these commands more consistent in returning empty braces for json output and issue a message if not using json output. Additionally, made the flag "use_json" a bool to make it consistent since previously, it had been defined as an int, char, u_char, and bool at various places. Ticket: CM-21040 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
* bgpd: add flowspec featurejaydom2018-03-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | This work is derived from a work done by China-Telecom. That initial work can be found in [0]. As the gap between frr and quagga is important, a reworks has been done in the meantime. The initial work consists of bringing the following: - Bringing the client side of flowspec. - the enhancement of address-family ipv4/ipv6 flowspec - partial data path handling at reception has been prepared - the support for ipv4 flowspec or ipv6 flowspec in BGP open messages, and the internals of BGP has been done. - the memory contexts necessary for flowspec has been provisioned In addition to this work, the following has been done: - the complement of adaptation for FS safi in bgp code - the code checkstyle has been reworked so as to match frr checkstyle - the processing of IPv6 FS NLRI is prevented - the processing of FS NLRI is stopped ( temporary) [0] https://github.com/chinatelecom-sdn-group/quagga_flowspec/ Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: jaydom <chinatelecom-sdn-group@github.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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: new vpn-policy CLIG. Paul Ziemba2018-03-201-1/+2
| | | | | | | | | | | | | | | | | | | | | PR #1739 added code to leak routes between (default VRF) VPN safi and unicast RIBs in any VRF. That set of changes included temporary CLI including vpn-policy blocks to specify RD/RT/label/&c. After considerable discussion, we arrived at a consensus CLI shown below. The code of this PR implements the vpn-specific parts of this syntax: router bgp <as> [vrf <FOO>] address-family <afi> unicast rd (vpn|evpn) export (AS:NN | IP:nn) label (vpn|evpn) export (0..1048575) rt (vpn|evpn) (import|export|both) RTLIST... nexthop vpn (import|export) (A.B.C.D | X:X::X:X) route-map (vpn|evpn|vrf NAME) (import|export) MAP [no] import|export [vpn|evpn|evpn8] [no] import|export vrf NAME User documentation of the vpn-specific parts of the above syntax is in PR #1937 Signed-off-by: G. Paul Ziemba <paulz@labn.net>
* bgpd: vpn-vrf route leakingG. Paul Ziemba2018-03-091-0/+1
| | | | | | | | - 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>
* bgpd: Fix bgp_vty.h to conform to coding standardDonald Sharp2018-02-031-3/+3
| | | | | | | The function declarations were missing some parameter names as is our standard. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* bgpd: atomize write-quanta, add read-quantaQuentin Young2017-11-301-0/+1
| | | | | | | | | | | | | | bgpd supports setting a write-quanta that serves as a hint on how many packets to write per I/O cycle. Now that input is buffered, it makes sense to add the equivalent parameter for how many packets are processed per cycle. This is *not* how many packets are read off the wire per I/O cycle; rather it is how many packets are processed from the input buffer in a given cycle after having been read off the wire and sanitized. Since these values must be used from multiple threads, they have also been made atomic. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: get rid of afi_header_vty_out() & co.David Lamparter2017-08-291-4/+4
| | | | | | | | | | 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>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-30/+28
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: Display (show) commands for EVPNvivek2017-07-121-0/+3
| | | | | | | | | | | | | | | | | | 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>
* Merge branch 'master' of https://github.com/dwalton76/frr into ↵Daniel Walton2017-06-301-5/+2
|\ | | | | | | | | | | | | bgpd-ipv4-plus-label-misc3 Conflicts: bgpd/bgp_route.c
| * bgpd: argv->arg grab bagQuentin Young2017-06-271-5/+2
| | | | | | | | | | | | | | * Pass ->text to functions that now do full string matching * Remove cases for l2vpn and evpn where they cannot occur Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST tableDaniel Walton2017-06-161-2/+8
|/ | | | | | | | | | | | | | | | | | | | | 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.