Commit Graph

589 Commits

Author SHA1 Message Date
Russ White
4d0f3e819d
Merge pull request #13160 from chiragshah6/fdev2
ospfd:display correct DR-BDR router-id in nbr cmd
2023-04-04 10:02:48 -04:00
Sindhu Parvathi Gopinathan
d3aef77fa9 ospfd:display correct DR-BDR router-id in nbr cmd
ospf neighbor DR and BDR router-id wrongly displays with interface
ip-address instead of router-id.

It is fixed to display the correct DR & BDR router-id  for
JSON and CLI commands.

Commands:
```
show ip ospf vrf <vrf-name> neighbor detail json
show ip ospf vrf <vrf-name> neighbor detail
```

Before Fix:-
```
r1# show ip ospf vrf default neighbor  swp1 detail
 Neighbor 0.0.0.17, interface address 11.0.0.1
    In the area 0.0.0.0 via interface swp1 local interface IP 11.0.0.2
    Neighbor priority is 1, State is Full, Role is DR, 6 state changes
    Most recent state change statistics:
      Progressive change 1d15h05m ago
    DR is 11.0.0.1, BDR is 11.0.0.2 ======> DR and BDR shows the intef &
local intf ipaddress
    Options 2 *|-|-|-|-|-|E|-
    Dead timer due in 35.178s
    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

r1#

r1# show ip ospf vrf default neighbor  swp1 detail json
{
  "0.0.0.17":[
    {
      "ifaceAddress":"11.0.0.1",
      "areaId":"0.0.0.0",
      "ifaceName":"swp1",
      "localIfaceAddress":"11.0.0.2",
      "nbrPriority":1,
      "nbrState":"Full",
      "role":"DR",
      "stateChangeCounter":6,
      "lastPrgrsvChangeMsec":141141533,
      "routerDesignatedId":"11.0.0.1", =============> interface ip
instead of DR rotuer-id
      "routerDesignatedBackupId":"11.0.0.2", =======> lo-interface ip
instead of BDR rotuer-id
      "optionsCounter":2,
      "optionsList":"*|-|-|-|-|-|E|-",
      "routerDeadIntervalTimerDueMsec":32272,
      "databaseSummaryListCounter":0,
      "linkStateRequestListCounter":0,
      "linkStateRetransmissionListCounter":0,
      "threadInactivityTimer":"on",
      "threadLinkStateRequestRetransmission":"on",
      "threadLinkStateUpdateRetransmission":"on"
    }
  ]
}
r1#
```

After Fix:-
```
r1# show ip ospf vrf default neighbor detail json
{
  "default":{
    "vrfName":"default",
    "vrfId":0,
    "neighbors":{
      "0.0.0.17":[
        {
          "ifaceAddress":"11.0.0.1",
          "areaId":"0.0.0.0",
          "ifaceName":"swp1",
          "localIfaceAddress":"11.0.0.2",
          "nbrPriority":1,
          "nbrState":"Full",
          "role":"DR",
          "stateChangeCounter":6,
          "lastPrgrsvChangeMsec":4531505,
          "routerDesignatedId":"0.0.0.17", =====> DR Router-Id
          "routerDesignatedBackupId":"0.0.0.12", =====> BDR Router-Id
          "optionsCounter":2,
          "optionsList":"*|-|-|-|-|-|E|-",
          "routerDeadIntervalTimerDueMsec":38495,
          "databaseSummaryListCounter":0,
          "linkStateRequestListCounter":0,
          "linkStateRetransmissionListCounter":0,
          "threadInactivityTimer":"on",
          "threadLinkStateRequestRetransmission":"on",
          "threadLinkStateUpdateRetransmission":"on"
        }
      ],
      "0.0.0.13":[
        {
          "ifaceAddress":"11.0.2.2",
          "areaId":"0.0.0.0",
          "ifaceName":"swp2",
          "localIfaceAddress":"11.0.2.1",
          "nbrPriority":1,
          "nbrState":"Full",
          "role":"DR",
          "stateChangeCounter":6,
          "lastPrgrsvChangeMsec":4522182,
          "routerDesignatedId":"0.0.0.13", =====> DR Router-Id
          "routerDesignatedBackupId":"0.0.0.12", =====> BDR Router-Id
          "optionsCounter":2,
          "optionsList":"*|-|-|-|-|-|E|-",
          "routerDeadIntervalTimerDueMsec":37840,
          "databaseSummaryListCounter":0,
          "linkStateRequestListCounter":0,
          "linkStateRetransmissionListCounter":0,
          "threadInactivityTimer":"on",
          "threadLinkStateRequestRetransmission":"on",
          "threadLinkStateUpdateRetransmission":"on"
        }
      ],
      "0.0.0.14":[
        {
          "ifaceAddress":"11.0.3.2",
          "areaId":"0.0.0.0",
          "ifaceName":"swp3",
          "localIfaceAddress":"11.0.3.1",
          "nbrPriority":1,
          "nbrState":"Full",
          "role":"DR",
          "stateChangeCounter":6,
          "lastPrgrsvChangeMsec":4522182,
          "routerDesignatedId":"0.0.0.14",  =====> DR Router-Id
          "routerDesignatedBackupId":"0.0.0.12", =====> BDR Router-Id
          "optionsCounter":2,
          "optionsList":"*|-|-|-|-|-|E|-",
          "routerDeadIntervalTimerDueMsec":37840,
          "databaseSummaryListCounter":0,
          "linkStateRequestListCounter":0,
          "linkStateRetransmissionListCounter":0,
          "threadInactivityTimer":"on",
          "threadLinkStateRequestRetransmission":"on",
          "threadLinkStateUpdateRetransmission":"on"
        }
      ]
    }
  }
}
r1#

r1# show ip ospf vrf default neighbor swp1 detail
 Neighbor 0.0.0.17, interface address 11.0.0.1
    In the area 0.0.0.0 via interface swp1 local interface IP 11.0.0.2
    Neighbor priority is 1, State is Full, Role is DR, 6 state changes
    Most recent state change statistics:
      Progressive change 1h18m11s ago
    DR is  0.0.0.17, BDR is 0.0.0.12  =======> correct DR and BDR
router-id
    Options 2 *|-|-|-|-|-|E|-
    Dead timer due in 38.339s
    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

r1#

r1# show ip ospf vrf default neighbor swp
swp1  swp2  swp3  swp4
r1# show ip ospf vrf default neighbor swp2 detail
 Neighbor 0.0.0.13, interface address 11.0.2.2
    In the area 0.0.0.0 via interface swp2 local interface IP 11.0.2.1
    Neighbor priority is 1, State is Full, Role is DR, 6 state changes
    Most recent state change statistics:
      Progressive change 12m02s ago
    DR is 0.0.0.13, BDR is 0.0.0.12 =======> correct DR and BDR
router-id
    Options 2 *|-|-|-|-|-|E|-
    Dead timer due in 37.136s
    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

r1#
```

Ticket:#3395270

Issue:3395270

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
2023-04-02 18:42:57 -07:00
Renato Westphal
f07ff222f8 ospfd: add support for NSSA Type-7 address ranges
Implement NSSA address ranges as specified by RFC 3101:

   NSSA border routers may be configured with Type-7 address ranges.
   Each Type-7 address range is defined as an [address,mask] pair.  Many
   separate Type-7 networks may fall into a single Type-7 address range,
   just as a subnetted network is composed of many separate subnets.
   NSSA border routers may aggregate Type-7 routes by advertising a
   single Type-5 LSA for each Type-7 address range.  The Type-5 LSA
   resulting from a Type-7 address range match will be distributed to
   all Type-5 capable areas.

Syntax:
  area A.B.C.D nssa range A.B.C.D/M [<not-advertise|cost (0-16777215)>]

Example:
  router ospf
   router-id 1.1.1.1
   area 1 nssa
   area 1 nssa range 172.16.0.0/16
   area 1 nssa range 10.1.0.0/16
  !

Since regular area ranges and NSSA ranges have a lot in common,
this commit reuses the existing infrastructure for area ranges as
much as possible to avoid code duplication.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-31 19:28:15 -03:00
Renato Westphal
4312d66f9f ospfd: refactor range commands
* Update the "range" helpers to accept an area pointer instead of
  an area ID;
* Always call ospf_area_display_format_set() after every "range"
  command to ensure consistency.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-31 19:28:15 -03:00
Renato Westphal
017714e3ad ospfd: implement Type-7 default routes for NSSA areas
Add the "default-information-originate" option to the "area X nssa"
command. That option allows the origination of Type-7 default routes
on NSSA ABRs and ASBRs.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-31 19:28:15 -03:00
Renato Westphal
e85194f572 ospfd: refactor the "area nssa" command using DEFPY
Combine all variation of the "area nssa" command into a single
DEFPY to improve code maintainability.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-31 19:28:15 -03:00
Donald Sharp
24a58196dd *: Convert event.h to frrevent.h
We should probably prevent any type of namespace collision
with something else.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
e16d030c65 *: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
4f830a0799 *: Convert thread_timer_remain_XXX to event_timer_remain_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
cb37cb336a *: Rename thread.[ch] to event.[ch]
This is a first in a series of commits, whose goal is to rename
the thread system in FRR to an event system.  There is a continual
problem where people are confusing `struct thread` with a true
pthread.  In reality, our entire thread.c is an event system.

In this commit rename the thread.[ch] files to event.[ch].

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:16 -04:00
Renato Westphal
f54232d0b2 ospfd: Fix inconsistency in LSDB JSON output
As it can be seen below, the LSDB JSON output varies depending
whether a filter option is specified or not (e.g. "adv-router",
"self-originate"):

> show ip ospf database router json
{
  "routerId":"3.3.3.3",
  "routerLinkStates":{
    "areas":{
      "0.0.0.0":[
        {
          "lsaAge":175,
          "options":"*|-|-|-|-|-|E|-",
          [snip]

> show ip ospf database router adv-router 2.2.2.2 json
{
  "routerId":"3.3.3.3",
  "Router Link States":{
    "0.0.0.0":{
      "2.2.2.2":{
        "lsaAge":193,
        "options":"*|-|-|-|-|-|E|-",
        [snip]

This inconsistency is undesirable since it makes this data harder to
consume programmatically. Also, in the second output, "Router Link
States" is used as a JSON key, which doesn't conform to our JSON
guidelines (JSON keys need to be camelCased).

Make the required changes to ensure the first output structure is used,
regardless if any output filter is used or not.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-17 23:00:31 -03:00
Renato Westphal
a08f41b95b ospfd: Add "detail" option to "show ip ospf database"
This option is useful to dump detailed information about the LSDB using
a single command (instead of one command per LSA type).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-17 23:00:31 -03:00
Renato Westphal
b131b1ed9c ospfd: Refactor the "show ip ospf database" command
Combine all variations of this command into a single DEFPY to
improve maintainability. No behavioral changes intended.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-17 23:00:17 -03:00
Donatas Abraitis
ba995a720b
Merge pull request #12751 from Pdoijode/pdoijode/ospf-vrf-neighbor-detail-1
ospfd: Added missing fields and option to query specific neighbor in VRF
2023-02-24 11:56:28 +02:00
Russ White
62bd2580e3
Merge pull request #12366 from manojvn/ospfv2-flood-reduction
ospfd: Support OSPF Refresh and Flooding Reduction RFC4136.
2023-02-21 08:03:06 -05:00
David Lamparter
acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Pooja Jagadeesh Doijode
2e86198322 ospfd: Fix "show ip ospf neighbor swp1 detail json" output
1. When OSPF unnumbered neighbor doesn't exist in any VRF,
   OSPFD prints a bunch of empty JSON objects. Fixed it
   by adding an outer JSON object with VRF information in it
2. Added "vrf" option to this command so that per VRF
   unnumbered OSPF neighbor information can be retrieved

JSON output:
    nl1# show ip ospf neighbor swp1 detail json
        {
          "default":{
          },
          "vrf1012":{
          },
          "vrf1013":{
          },
          "vrf1014":{
          }
        }

    nl1# show ip ospf vrf vrf1012 neighbor swp4.2 detail json
        {
          "9.9.12.10":[
            {
              "ifaceAddress":"200.254.2.46",
              "areaId":"0.0.0.0",
              "ifaceName":"swp4.2",
              "localIfaceAddress":"200.254.2.45",
              "nbrPriority":1,
              "nbrState":"Full",
              "role":"DR",
              "stateChangeCounter":6,
              "lastPrgrsvChangeMsec":1462758,
              "routerDesignatedId":"200.254.2.46",
              "routerDesignatedBackupId":"200.254.2.45",
              "optionsCounter":2,
              "optionsList":"*|-|-|-|-|-|E|-",
              "routerDeadIntervalTimerDueMsec":37140,
              "databaseSummaryListCounter":0,
              "linkStateRequestListCounter":0,
              "linkStateRetransmissionListCounter":0,
              "threadInactivityTimer":"on",
              "threadLinkStateRequestRetransmission":"on",
              "threadLinkStateUpdateRetransmission":"on"
            }
          ]
        }
        nl1#

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-02-08 14:34:06 -08:00
Pooja Jagadeesh Doijode
a8e6c2c6d0 ospfd: Option to query specific neighbor in VRF
Added VRF option to
"show ip ospf [vrf NAME] neighbor X.X.X.X [detail] [json]"
command so that the user can query information regarding a
specific neighbor within a VRF.

r1# show ip ospf vrf default neighbor 10.0.255.2
10.0.255.2        1 Full/-          33m10s             9.891s 10.0.3.2        r1-eth1:10.0.3.4                     0     0     0

r1# show ip ospf vrf default neighbor 10.0.255.2 json
    {
      "10.0.255.2":[
        {
          "priority":1,
          "state":"Full/-",
          "nbrPriority":1,
          "nbrState":"Full/-",
          "converged":"Full",
          "role":"DROther",
          "upTimeInMsec":13877947,
          "deadTimeMsecs":9498,
          "routerDeadIntervalTimerDueMsec":9498,
          "upTime":"3h51m17s",
          "deadTime":"9.498s",
          "address":"10.0.3.2",
          "ifaceAddress":"10.0.3.2",
          "ifaceName":"r1-eth1:10.0.3.4",
          "retransmitCounter":0,
          "linkStateRetransmissionListCounter":0,
          "requestCounter":0,
          "linkStateRequestListCounter":0,
          "dbSummaryCounter":0,
          "databaseSummaryListCounter":0
        }
      ]
    }
r1# show ip ospf vrf default neighbor 10.0.255.2 detail
     Neighbor 10.0.255.2, interface address 10.0.3.2
        In the area 0.0.0.0 via interface r1-eth1 local interface IP 10.0.3.4
        Neighbor priority is 1, State is Full/-, Role is DROther, 5 state changes
        Most recent state change statistics:
          Progressive change 3h51m27s ago
        DR is 0.0.0.0, BDR is 0.0.0.0
        Options 2 *|-|-|-|-|-|E|-
        Dead timer due in 8.458s
        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

r1# show ip ospf vrf default neighbor 10.0.255.2 detail json
    {
      "10.0.255.2":[
        {
          "ifaceAddress":"10.0.3.2",
          "areaId":"0.0.0.0",
          "ifaceName":"r1-eth1",
          "localIfaceAddress":"10.0.3.4",
          "nbrPriority":1,
          "nbrState":"Full/-",
          "role":"DROther",
          "stateChangeCounter":5,
          "lastPrgrsvChangeMsec":13889856,
          "routerDesignatedId":"0.0.0.0",
          "routerDesignatedBackupId":"0.0.0.0",
          "optionsCounter":2,
          "optionsList":"*|-|-|-|-|-|E|-",
          "routerDeadIntervalTimerDueMsec":9715,
          "databaseSummaryListCounter":0,
          "linkStateRequestListCounter":0,
          "linkStateRetransmissionListCounter":0,
          "threadInactivityTimer":"on",
          "threadLinkStateRequestRetransmission":"on",
          "threadLinkStateUpdateRetransmission":"on",
          "grHelperStatus":"None"
        }
      ]
    }
r1#

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-02-07 15:29:31 -08:00
Pooja Jagadeesh Doijode
5bec85d971 ospfd: Added missing fields to "show ip ospf neighbor detail"
"role" and "local interface address" fields were missing in
"show ip ospf neighbor detail" command.

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-02-06 15:41:44 -08:00
Donatas Abraitis
1ce23106eb *: Drop deprecated incorrect JSON fields with wrong naming
Deprecation cycle already passed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-31 10:18:28 +02:00
mobash-rasool
c6188284fb
Merge pull request #12677 from opensourcerouting/fix/ospf_potential_memory_leak
ospfd: Free memory for JSON allocated object before return
2023-01-24 09:54:44 +05:30
Donatas Abraitis
88c5852b72 ospfd: Free memory for JSON allocated object before return
For show_ip_ospf_database_type_adv_router_common().

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-23 13:46:42 +02:00
Donatas Abraitis
cb2689d3e5 ospfd: Free memory for JSON allocated object before return
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-22 21:15:44 +02:00
Chirag Shah
1ffbb2e487 ospfd: fix crash show ip ospf border-routers json
When show ip ospf border-routers json (without vrf)
specificed, it leads to crash if there no border-routers
information.

Fix:
Do not free json object if use_vrf flag (means vrf option
is not passed) is not set.

Ticket:#3229017
Issue:3229017
Testing Done:

with fix:
l1# show ip ospf border-routers json
{
}
l1# show ip ospf vrf default border-routers json
{
}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2023-01-20 23:24:44 -08:00
Manoj Naragund
75b837a3d5 ospfd: CLI changes to enable/disable OSPFv2 Flood reduction.
Description:
	The CLIs for enabling/disabling FR, at instance level and
	at the area.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2023-01-19 21:03:03 -08:00
Donatas Abraitis
405e1c848f Revert "ospfd: rSPF calc and messaging for optimal route reflection"
This reverts commit a3d3a14c09.
2023-01-17 18:11:56 +02:00
Donatas Abraitis
1ea57af264 Revert "bgpd, ospfd: BGP ORR CI warning fixes"
This reverts commit d6b2761134.
2023-01-17 18:10:04 +02:00
Donatas Abraitis
3228977f58 Revert "ospfd: few fixes in rSPF calc when LSA received from non root node"
This reverts commit 9f2984d97c.
2023-01-17 18:09:55 +02:00
Rei Shimizu
ff68181eda ospfd: show ospf database info using formatted json
Signed-off-by: Rei Shimizu <rshimizu@apache.org>
2023-01-03 02:06:35 +00:00
Donald Sharp
f9f19fef9d ospfd: Fix some json mem leaks and some issues
a) if show_function happened to be NULL we would leak json memory
b) json_lsa_type was being allocated but only used in the default case, leaking memory
c) json output would sometimes produce text output and that is incorrect

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-12-20 08:45:51 -05:00
Sindhu Parvathi Gopinathan
2c248c3ed2 ospfd: json support for show ip ospf border-routers
show ip ospf border-routers json support added.
commands:
  - show ip ospf vrf default border-routers json
  - show ip ospf vrf all border-routers json
  - show ip ospf border-routers json

Testing Done: Unit testing completed.

rut# show ip ospf vrf all border-routers json
{
  "default":{
    "vrfName":"default",
    "vrfId":0,
    "routers":{
      "0.0.0.8":{
        "routeType":"R ",
        "cost":10,
        "area":"0.0.0.1",
        "routerType":"abr",
        "nexthops":[
          {
            "ip":"12.0.0.2",
            "via":"swp1"
          }
        ]
      },
      "0.0.0.9":{
        "routeType":"R ",
        "cost":10,
        "area":"0.0.0.1",
        "routerType":"abr",
        "nexthops":[
          {
            "ip":"12.0.1.2",
            "via":"swp2"
          }
        ]
      }
    }
  }
}

rut#
rut# show ip ospf vrf all border-routers json
{
  "default":{
	"vrfName":"default",
	"vrfId":0,
        "routers":{
  	  "0.0.0.15":{
	    "routeType":"R ",
	    "cost":30,
	    "area":"0.0.0.0",
	    "routerType":"abr",
	    "nexthops":[
		{
		  "ip":"11.0.0.2",
		  "via":"br1"
		}
	     ]
	  }
      }
  }
}

rut# show ip ospf border-routers json
{
  "routers":{
    "0.0.0.15":{
      "routeType":"R ",
      "cost":30,
      "area":"0.0.0.0",
      "routerType":"abr",
      "nexthops":[
        {
	  "ip":"11.0.0.2",
          "via":"br1"
	}
      ]
   }
 }
}

Ticket:#3229017
Issue:3229017

Co-authored-by: Chirag Shah <chirag@nvidia.com>
Signed-off-by: Sindhu Parvathi Gopinathan <sgopinathan@nvidia.com>
2022-12-16 08:46:10 -08:00
Donatas Abraitis
bd162aae09 ospfd: Get route-map name for default-information originate
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>
2022-11-07 22:23:07 +02:00
Donald Sharp
d7cde18c63
Merge pull request #12196 from opensourcerouting/xref-vtysh
*: rewrite `extract.pl` using `xref` infra
2022-11-03 08:54:09 -04:00
David Lamparter
89cb86aeb0 build, vtysh: extract vtysh commands from .xref
Rather than running selected source files through the preprocessor and a
bunch of perl regex'ing to get the list of all DEFUNs, use the data
collected in frr.xref.

This not only eliminates issues we've been having with preprocessor
failures due to nonexistent header files, but is also much faster.
Where extract.pl would take 5s, this now finishes in 0.2s.  And since
this is a non-parallelizable build step towards the end of the build
(dependent on a lot of other things being done already), the speedup is
actually noticeable.

Also files containing CLI no longer need to be listed in `vtysh_scan`
since the .xref data covers everything.  `#ifndef VTYSH_EXTRACT_PL`
checks are equally obsolete.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26 17:12:34 +01:00
anlan_cs
6c3aae9c56 ospfd: fix missing max-metric in show running config
```
(ospf)  max-metric router-lsa administrative
```

Currently this running config depends at least one `area` with *active*
`network`, otherwise it will not occur.

The check on this dependency is redundant and wrong, just remove it.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-10-26 08:50:17 -04:00
Madhuri Kuruganti
9f2984d97c ospfd: few fixes in rSPF calc when LSA received from non root node
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12 13:43:55 +05:30
Madhuri Kuruganti
d6b2761134 bgpd, ospfd: BGP ORR CI warning fixes
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12 13:43:55 +05:30
Madhuri Kuruganti
a3d3a14c09 ospfd: rSPF calc and messaging for optimal route reflection
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12 13:43:55 +05:30
Donatas Abraitis
083e241235 ospfd: Remove deprecated command graceful-restart helper-only
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-23 22:10:44 +03:00
Manoj Naragund
b345a3d9b4 ospfd: Added clis to change default timers for LSA refresh and maxage remove 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-31 23:10:09 -07:00
rgirada
7b71c1e3f7 ospfd: Adding per neighbour json details to GR helper detail command
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-23 21:15:12 -07:00
Donald Sharp
f54b256b93 ospfd: Add how many packets the interface has queued to send
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-11 13:30:32 -04:00
Donald Sharp
fe61ceaee7 ospfd: Cleanup indentation surrounding oi->nbr
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-11 13:30:32 -04:00
Donald Sharp
cccd44f3b1 ospfd: Remove various macros that overlap THREAD_OFF
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-07-21 08:27:35 -04:00
rgirada
25804ce593 ospfd: fixing few coverity issue in 'show_ip_ospf_neighbour_brief'
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-23 06:43:22 -07:00
rgirada
e8a8b11610 ospfd: Fixing "show ip ospf neighbour <nbrid>" command
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-22 08:40:24 -07:00
Donatas Abraitis
70dd370f5a *: Use autocomplete for route-maps under commands that require it
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-13 21:00:51 +03:00
Christian Hopps
d86760acad ospfd: cli: add "show ip ospf reachable-routers" CLI
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Donatas Abraitis
8998807f69 *: Avoid casting to the same type as on the left
Just not necessary.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-08 16:07:42 +03:00
Donatas Abraitis
41710ed15e ospfd: Show neighbor state in full format (e.g. Full/DR instead of Full)
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-30 22:28:39 +03:00