summaryrefslogtreecommitdiff
path: root/ospfd/ospf_vty.c
AgeCommit message (Collapse)Author
2023-07-02ospfd: check for NULLs in vty codeMark Stapp
There were a couple of cli paths that NULL-checked in the vtysh output path, but not in the json path. Signed-off-by: Mark Stapp <mjs@labn.net> (cherry picked from commit 864a3bc1855ec8027fec8d6f400adb44e1ecbfcf)
2023-05-05ospfd: Fix memory leaks w/ `show ip ospf int X json` commandsDonald Sharp
FRR has a memory leak in the case when int X does not exist and a memory leak when int X does exist. Fix these Fixes: #13434 Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit 74e21732db129f7287d5ab227e45f305c5dbf34e)
2022-11-08ospfd: Get route-map name for default-information originateDonatas Abraitis
LR1.wue3(config)# route-map foo-bar-baz10 permit 10 LR1.wue3(config-route-map)# exit LR1.wue3(config)# router ospf LR1.wue3(config-router)# ospf router-id 172.18.254.201 LR1.wue3(config-router)# log-adjacency-changes LR1.wue3(config-router)# default-information originate metric 50 metric-type 1 route-map foo-bar-baz10 LR1.wue3(config-router)# end Results in: LR1.wue3# show run ... ! router ospf ospf router-id 172.18.254.201 log-adjacency-changes default-information originate metric 50 metric-type 1 route-map oute-map exit ! route-map foo-bar-baz10 permit 10 exit ! end Let's fix this. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit bd162aae094360605b7f4b9b8cd46f6e4ffebc04)
2022-09-23ospfd: Remove deprecated command `graceful-restart helper-only`Donatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-08-31ospfd: Added clis to change default timers for LSA refresh and maxage remove ↵Manoj Naragund
delay. Description: Added hidden clis that will allow you to reset the default timers for LSA refresh and LSA maxage remove delay, these will help in testing LSA refresh scenarios in upcoming OSPFv2 Flood reduction feature(rfc4136). IETF Link : https://datatracker.ietf.org/doc/html/rfc4136 Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2022-08-23ospfd: Adding per neighbour json details to GR helper detail commandrgirada
Description: Per neighbor GR enabled information is missing from json output in "show ip ospf gr helper details json" command. Example config: frr(config-router)# graceful-restart helper enable 2.2.2.2 frr(config-router)# frr(config-router)# do show ip ospf graceful-restart helper detail OSPF Router with ID (10.112.156.220) Graceful restart helper support disabled. Strict LSA check is enabled. Helper supported for Planned and Unplanned Restarts. Supported Graceful restart interval: 1800(in seconds). Enable Router list: 2.2.2.2, frr(config-router)# do show ip ospf graceful-restart helper detail json { "routerId":"10.112.156.220", "helperSupport":"Disabled", "strictLsaCheck":"Enabled", "restartSupoort":"Planned and Unplanned Restarts", "supportedGracePeriod":1800, } frr(config-router)# Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-08-11ospfd: Add how many packets the interface has queued to sendDonald Sharp
In `show ip ospf interface traffic` how many packets this interface has queued to send. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-11ospfd: Cleanup indentation surrounding oi->nbrDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21ospfd: Remove various macros that overlap THREAD_OFFDonald Sharp
Let's just use THREAD_OFF consistently in the code base instead of each daemon having a special macro that needs to be looked at and remembered what it does. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23ospfd: fixing few coverity issue in 'show_ip_ospf_neighbour_brief'rgirada
Description: timerval data structure is being used without initialization. Using these uninitialized parameters can lead unexpected results so initializing before using it. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-06-22ospfd: Fixing "show ip ospf neighbour <nbrid>" commandrgirada
Description: "show ip ospf neighbour [nbrid] [json]" is expected to give brief output of the specific neighbour. But it gives the detailed output without the detail keyword. "show ip ospf neighbour [nbrid] [deatil] [json]" command is failed to fetch the ecpected o/p. Corrected it. Ex o/p: frr(config-if)# do show ip ospf neighbor Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL 8.8.8.8 1 Full/DR 17m03s 31.192s 20.1.1.194 ens192:20.1.1.220 0 0 0 30.1.1.100 1 Full/DR 56.229s 32.000s 30.1.1.100 ens224:30.1.1.220 0 0 0 frr(config-if)# frr(config-if)# frr(config-if)# do show ip ospf neighbor 8.8.8.8 Neighbor 8.8.8.8, interface address 20.1.1.194 In the area 0.0.0.0 via interface ens192 Neighbor priority is 1, State is Full/DR, 6 state changes Most recent state change statistics: Progressive change 17m18s ago DR is 20.1.1.194, BDR is 20.1.1.220 Options 2 *|-|-|-|-|-|E|- Dead timer due in 35.833s Database Summary List 0 Link State Request List 0 Link State Retransmission List 0 Thread Inactivity Timer on Thread Database Description Retransmision off Thread Link State Request Retransmission on Thread Link State Update Retransmission on Graceful restart Helper info: Graceful Restart HELPER Status : None frr(config-if)# do show ip ospf neighbor 8.8.8.8 detail No such interface. frr(config-if)# do show ip ospf neighbor 8.8.8.8 detail json {} frr(config-if)# Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-06-13*: Use autocomplete for route-maps under commands that require itDonatas Abraitis
For example: ``` donatas-laptop# show bgp ipv4 unicast neighbors 127.0.0.2 advertised-routes route-map ? RMAP_NAME Name of the route map testas2 testas donatas-laptop(config)# router bgp donatas-laptop(config-router)# address-family ipv4 donatas-laptop(config-router-af)# redistribute connected route-map ? RMAP_NAME Pointer to route-map entries testas2 testas donatas-laptop(config-router-af)# network 192.168.0.0/23 route-map ? RMAP_NAME Name of the route map testas2 testas ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-02ospfd: cli: add "show ip ospf reachable-routers" CLIChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-05-08*: Avoid casting to the same type as on the leftDonatas Abraitis
Just not necessary. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-30ospfd: Show neighbor state in full format (e.g. Full/DR instead of Full)Donatas Abraitis
Before: ``` $ vtysh -c 'show ip ospf neighbor json' | jq '.neighbors."100.100.200.100"[0].nbrState' "Full/DR" $ vtysh -c 'show ip ospf neighbor detail json' | jq '.neighbors."100.100.200.100"[0].nbrState' "Full" ``` After: ``` $ vtysh -c 'show ip ospf neighbor json' | jq '.neighbors."100.100.200.100"[0].nbrState' "Full/DR" $ vtysh -c 'show ip ospf neighbor detail json' | jq '.neighbors."100.100.200.100"[0].nbrState' "Full/DR" ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-21ospfd: Use consistent JSON keys for `show ip ospf neighbor` and detail versionDonatas Abraitis
At the moment it's inconsistent, and very annoying. Let's just fix this, and add a deprecation period to remove them after that. ``` vr_ib# show ip ospf neighbor json { "neighbors":{ "192.10.120.2":[ { "priority":1, "state":"Full\/DROther", "deadTimeMsecs":36543, "address":"192.10.120.2", "ifaceName":"VLINK0", "retransmitCounter":0, "requestCounter":0, "dbSummaryCounter":0 }, ``` ``` vr_ib# show ip ospf neighbor detail json { "neighbors":{ "192.10.120.2":[ { "ifaceAddress":"192.10.120.2", "areaId":"0.0.0.0", "ifaceName":"VLINK0", "nbrPriority":1, "nbrState":"Full", "stateChangeCounter":5, "lastPrgrsvChangeMsec":53367612, "routerDesignatedId":"0.0.0.0", "routerDesignatedBackupId":"0.0.0.0", "optionsCounter":66, "optionsList":"*|O|-|-|-|-|E|-", "routerDeadIntervalTimerDueMsec":33126, "databaseSummaryListCounter":0, "linkStateRequestListCounter":0, "linkStateRetransmissionListCounter":0, "threadInactivityTimer":"on", "threadLinkStateRequestRetransmission":"on", "threadLinkStateUpdateRetransmission":"on", "grHelperStatus":"None" }, ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-16ospfd: better error messages when not enabled in a vrfJafar Al-Gharaibeh
before: ``` r1# show ip ospf vrf blue % OSPF instance not found r1# show ip ospf vrf default % OSPF instance not found r1# show ip ospf % OSPF instance not found ``` after: ``` r1# show ip ospf vrf blue % OSPF is not enabled in vrf blue r1# show ip ospf vrf default % OSPF is not enabled in vrf default r1# show ip ospf % OSPF is not enabled in vrf default ``` Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-03-13Merge pull request #10447 from ton31337/fix/json_with_whitespacesDonald Sharp
*: Fix JSON keys with whitespaces and PascalCase
2022-02-27*: Add necessary new line for output of vty_out()anlan_cs
Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-02-14ospfd: Fix spelling mistakesDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-08Merge pull request #10511 from anlancs/ospf-substituteIgor Ryzhov
ospfd: fix loss of mixed form in "range" command
2022-02-07ospfd: Use AF_UNSPEC instead of setting to 0Donald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-03*: Add camelCase JSON keys in addition to PascalCaseDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-02-03ospfd,ospf6d: Add JSON additional keys with no whitespaces insideDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-02-01Merge pull request #10373 from anlancs/ospf-add-asbrIgor Ryzhov
ospfd: fix missing "aggregation timer" in running configuration
2022-02-01ospfd: remove extra spaceckishimo
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-02-01ospfd: print maximum paths in show ip ospf jsonckishimo
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-02-01ospfd: print administrative distance in show ip ospfckishimo
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-02-01ospfd: restart spf when distance is updatedckishimo
if r1 has a route received from a neighbor with the default administrative distance configured r1# sh ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure O>* 1.1.1.1/32 [110/20] via 10.0.12.2, r1-r2-eth0, weight 1, 00:00:41 if we change the administrative distance r1(config)# router ospf r1(config-router)# distance 50 this is not applied as there are no changes in the routing table r1# sh ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure O>* 1.1.1.1/32 [110/20] via 10.0.12.2, r1-r2-eth0, weight 1, 00:00:13 This commit will force the update of the routing table with the new configured distance r1# sh ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure O>* 1.1.1.1/32 [50/20] via 10.0.12.2, r1-r2-eth0, weight 1, 00:00:14 Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-28ospfd: adjust type of "aggr_delay_interval"anlan_cs
Adjust type of "aggr_delay_interval": Just replace `unsigned int` with `uint16_t` for range is (50..1800). Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-28ospfd: fix missing "aggregation timer" in running configurationanlan_cs
Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-28ospfd: a few minor fixes on ospfd clianlan_cs
Two minor fixes: - remove redundant "(a.b.c.d/m)" in "prefix" description - remove some annoying space in "summary-address" and "tag" Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-28Merge pull request #10408 from idryzhov/no-opaque-by-defaultDonatas Abraitis
*: do not send opaque data to zebra by default
2022-01-26ospfd: fix loss of mixed form in "range" commandanlan_cs
Currently "range" command can only accept `cost` or `substitute` individually, and `show running` will mix them. So need make it accept mixed form with both of them, otherwise configuration file in mixed form will fail to start. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-25Merge pull request #10411 from idryzhov/if-config-vrf-nameRuss White
*: do not print vrf name for interface config when using vrf-lite
2022-01-24*: do not send opaque data to zebra by defaultIgor Ryzhov
Opaque data takes up a lot of memory when there are a lot of routes on the box. Given that this is just a cosmetic info, I propose to disable it by default to not shock people who start using FRR for the first time or upgrades from an old version. Fixes #10101. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24Merge pull request #10407 from idryzhov/ospf-opaque-crashRuss White
ospfd: fix crash on "ospf send-extra-data zebra"
2022-01-24*: do not print vrf name for interface config when using vrf-liteIgor Ryzhov
VRF name should not be printed in the config since 574445ec. The update was done for NB config output but I missed it for regular vty output. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-23Merge pull request #10318 from donaldsharp/redistributionRuss White
OSPF Redistribution
2022-01-23ospfd: fix crash on "ospf send-extra-data zebra"Igor Ryzhov
`ospf->new_table` is NULL if the OSPF instance has no routes. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-18Merge pull request #9644 from opensourcerouting/ospf-opaque-attrsRuss White
OSPF opaque route attributes
2022-01-18ospfd: Add counts of lsa types to summary commandDonald Sharp
Add the ability to know the number of lsa type's we hold in the database as part of the json output. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-17Merge pull request #10183 from idryzhov/rework-vrf-renameRafael Zalamena
*: rework renaming the default VRF
2022-01-15lib, ospfd, ospf6d, zebra: add OSPF opaque route attributesRenato Westphal
Update ospfd and ospf6d to send opaque route attributes to zebra. Those attributes are stored in the RIB and can be viewed using the "show ip[v6] route" commands (other than that, they are completely ignored by zebra). Example: ``` debian# show ip route 192.168.1.0/24 Routing entry for 192.168.1.0/24 Known via "ospf", distance 110, metric 20, best Last update 01:57:08 ago * 10.0.1.2, via eth-rt2, weight 1 OSPF path type : External-2 OSPF tag : 0 debian# debian# show ip route 192.168.1.0/24 json { "192.168.1.0\/24":[ { "prefix":"192.168.1.0\/24", "prefixLen":24, "protocol":"ospf", "vrfId":0, "vrfName":"default", "selected":true, [snip] "ospfPathType":"External-2", "ospfTag":"0" } ] } ``` Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2022-01-12ospfd: Use vty_json() for show_ip_ospf_gr_helper_cmdDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-11ospfd: correct one word of the output messageanlan_cs
Signed-off-by: anlan_cs <anlan_cs@tom.com>
2022-01-10ospfd,ospf6d: make clear the comparison of routemap nameanlan_cs
Comparison of the two pointer is confusing, they have no relevance except the time both of them are empty. Additionly modify one variable name and correct some comment words, they are same in both ospfd and ospf6d. Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-12-21*: rework renaming the default VRFIgor Ryzhov
Currently, it is possible to rename the default VRF either by passing `-o` option to zebra or by creating a file in `/var/run/netns` and binding it to `/proc/self/ns/net`. In both cases, only zebra knows about the rename and other daemons learn about it only after they connect to zebra. This is a problem, because daemons may read their config before they connect to zebra. To handle this rename after the config is read, we have some special code in every single daemon, which is not very bad but not desirable in my opinion. But things are getting worse when we need to handle this in northbound layer as we have to manually rewrite the config nodes. This approach is already hacky, but still works as every daemon handles its own NB structures. But it is completely incompatible with the central management daemon architecture we are aiming for, as mgmtd doesn't even have a connection with zebra to learn from it. And it shouldn't have it, because operational state changes should never affect configuration. To solve the problem and simplify the code, I propose to expand the `-o` option to all daemons. By using the startup option, we let daemons know about the rename before they read their configs so we don't need any special code to deal with it. There's an easy way to pass the option to all daemons by using `frr_global_options` variable. Unfortunately, the second way of renaming by creating a file in `/var/run/netns` is incompatible with the new mgmtd architecture. Theoretically, we could force daemons to read their configs only after they connect to zebra, but it means adding even more code to handle a very specific use-case. And anyway this won't work for mgmtd as it doesn't have a connection with zebra. So I had to remove this option. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-12-21Merge pull request #10098 from opensourcerouting/ospf-gr-topotest-fixDonald Sharp
ospfd: fix incorrect detection of topology changes in helper mode
2021-11-29Merge pull request #10124 from ton31337/feature/vty_jsonIgor Ryzhov