summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_spf.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: 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>
* Revert "ospfd: rSPF calc and messaging for optimal route reflection"Donatas Abraitis2023-01-171-2/+0
| | | | This reverts commit a3d3a14c09cf212c7d402670247c4d518b99d8b7.
* Revert "ospfd: few fixes in rSPF calc when LSA received from non root node"Donatas Abraitis2023-01-171-1/+0
| | | | This reverts commit 9f2984d97c2e23198db47d39a725f3c50d2ee0ed.
* ospfd: few fixes in rSPF calc when LSA received from non root nodeMadhuri Kuruganti2022-10-121-0/+1
| | | | Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
* ospfd: rSPF calc and messaging for optimal route reflectionMadhuri Kuruganti2022-10-121-0/+2
| | | | Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
* ospfd: add all_rtrs route table when opaque enabledChristian Hopps2022-06-021-0/+3
| | | | | | | | The reachable router table is used by OSPF opaque clients in order to determine if the router advertising the opaque LSA data is reachable (i.e., 2-way conectivity check). Signed-off-by: Christian Hopps <chopps@labn.net>
* ospfd: introduce support for Graceful Restart (restarting mode)Renato Westphal2021-07-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 3623 specifies the Graceful Restart enhancement to the OSPF routing protocol. This PR implements support for the restarting mode, whereas the helper mode was implemented by #6811. This work is based on #6782, which implemented the pre-restart part and settled the foundations for the post-restart part (behavioral changes, GR exit conditions, and on-exit actions). Here's a quick summary of how the GR restarting mode works: * GR can be enabled on a per-instance basis using the `graceful-restart [grace-period (1-1800)]` command; * To perform a graceful shutdown, the `graceful-restart prepare ospf` EXEC-level command needs to be issued before restarting the ospfd daemon (there's no specific requirement on how the daemon should be restarted); * `graceful-restart prepare ospf` will initiate the graceful restart for all GR-enabled instances by taking the following actions: o Flooding Grace-LSAs over all interfaces o Freezing the OSPF routes in the RIB o Saving the end of the grace period in non-volatile memory (a JSON file stored in `$frr_statedir`) * Once ospfd is started again, it will follow the procedures described in RFC 3623 until it detects it's time to exit the graceful restart (either successfully or unsuccessfully). Testing done: * New topotest featuring a multi-area OSPF topology (including stub and NSSA areas); * Successful interop tests against IOS-XR routers acting as helpers. Co-authored-by: GalaxyGorilla <sascha@netdef.org> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ospfd: Max multipath config supportrgirada2021-03-301-1/+1
| | | | | | | | | | | Description: OSPF does not have an option to control the maximum multiple equal cost paths to reach a destination/route(ECMP). Currently, it is using the system specific max multiple paths. But Somtimes, It requires to control the multiple paths from ospf. This cli helps to configure the max number multiple paths in ospf. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* *: require semicolon after DEFINE_<typesafe...>David Lamparter2021-03-171-1/+1
| | | | | | Again, see previous commits. Signed-off-by: David Lamparter <equinox@diac24.net>
* ospfd: Add support for TI-LFA node protectionGalaxyGorilla2021-01-191-2/+5
| | | | Signed-off-by: GalaxyGorilla <sascha@netdef.org>
* ospfd: Make use of adjacency SIDs in TI-LFAGalaxyGorilla2021-01-191-0/+2
| | | | | | | | When P and Q spaces are adjacent then it makes sense to use adjacency SIDs to from the P node to the Q node. There are some other corner cases where this makes also sense like when a P/Q node adjacent to root node. Signed-off-by: GalaxyGorilla <sascha@netdef.org>
* ospfd: TI-LFA basic infrastructure and algorithmsGalaxyGorilla2021-01-191-6/+14
| | | | Signed-off-by: GalaxyGorilla <sascha@netdef.org>
* ospfd: use a new vertex list for every SPF runGalaxyGorilla2020-08-271-0/+1
| | | | | | | | | In the context of TI-LFA it is necessary to have multiple representations of SPFs for so called P and Q spaces. Hence it makes sense to start with fresh vertex lists, and only delete them when the SPF calculation is not a 'dry run'. Signed-off-by: GalaxyGorilla <sascha@netdef.org>
* ospfd: bring back some P2P SPF interface codeGalaxyGorilla2020-08-181-2/+3
| | | | | | | | | | | | | | | | | In the case of P2P links it is possible to use IP unnumbered which yields a strong dependency to the interface data for nexthop resolution in the SPF calculations. While the SPF code strives to be as independent of non-LSA data as possible there is no way around here: one has to resolve the nexthop for such a special case using the interface data. For this purpose a new flag 'spf_root_node' is introduced to signal that interface data can be used for P2P links. For now this flag is always 'true' since the SPF currently always uses the calculating node as the root node. This will change with the introduction of TI-LFA where other nodes can be root nodes. Signed-off-by: GalaxyGorilla <sascha@netdef.org>
* ospfd: add print helper for SPF trees and route tablesGalaxyGorilla2020-08-181-0/+2
| | | | Signed-off-by: GalaxyGorilla <sascha@netdef.org>
* ospfd: introduce a 'dry run' into SPF codeGalaxyGorilla2020-08-181-5/+12
| | | | | | | | | | | | | | | | | | | in OSPF interface data is used for the nexthop resolution during the SPF algorithm, see RFC2328 16.1.1. However, for certain technologies like TI-LFA it is desirable to be able to calculate SPFs for arbitrary root nodes, not just the calculating node. Since interface data is not available for other nodes it is necessary to remove this dependency and make its usage optional, depending on the intent of changing the RIB with the generated tree (or not). To signal that a SPF run is used without the intent to change the RIB an additional flag `spf_dry_run` is introduced to the ospf_area struct. This flag is currently only used within the pure SPF code but will be extended to the SPF postprocessing later on. Signed-off-by: GalaxyGorilla <sascha@netdef.org>
* ospfd: replace pqueue_* with DECLARE_SKIPLISTDavid Lamparter2019-04-271-1/+5
| | | | | | This replaces the SPF pqueue_* with a DECLARE_SKIPLIST_* skiplist. Signed-off-by: David Lamparter <equinox@diac24.net>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-29/+27
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | 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>
* ospfd: Some small tweaks to the SPF execution reason patchPaul Jakma2016-05-261-15/+13
| | | | | | | | | | | | | | | * ospf_spf.h: use an enum for the reason, and have it as a new argument to ospf_spf_calculate_schedule, no need for additional call, and let compiler do the checking. * ospf_spf.c: format changes - Quagga coding style places function names at the start of a new line, for easy grepping for definition. (ospf_spf_calculate_timer) Change the log format of SPF execution time to avoid ginormous line, and make logging conditional, as is the norm. (cherry picked from commit b6eef003e1a79471addea0b01853b08aed812cc8) Conflicts: ospfd/ospf_spf.c
* ospfd-spf-stats.patchDonald Sharp2015-05-201-0/+13
| | | | | | | | | | | | | | | | | Compute and display SPF execution statistics Detailed SPF statistics, all around time spent executing various pieces of SPF such as the SPF algorithm itself, installing routes, pruning unreachable networks etc. Reason codes for firing up SPF are: R - Router LSA, N - Network LSA, S - Summary LSA, ABR - ABR status change, ASBR - ASBR Status Change, AS - ASBR Summary, M - MaxAge Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com> Reviewed-by: JR Rivers <jrrivers@cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com> Reviewed-by: Ayan Banerjee <ayan@cumulusnetworks.com>
* [ospfd] Fix SPF of virtual-linksPaul Jakma2006-05-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-04-24 Paul Jakma <paul.jakma@sun.com> * (general) More Virtual-link fixes, again with much help in testing / debug from Juergen Kammer. Primarily in SPF. * ospf_spf.h: Add guard. ospf_interface.h will include this header. * ospf_interface.h: Modify ospf_vl_lookup definition to take struct ospf as argument, so as to allow for NULL area argument. (struct ospf_vl_data) Remove out_oi, instead add a struct vertex_nexthop, to use as initial nexthop for backbone paths through a vlink. * ospf_interface.c: (ospf_vl_lookup) Modified to allow NULL area to be passed to indicate "any" (first) area. Add extra debug. (ospf_vl_set_params) vl_oi -> nexthop. Add extra debug. (ospf_vl_up_check) Fix debug, inet_ntoa returns a static buffer.. * ospf_route.c: (ospf_intra_add_router) Vlinks dont go through backbone, don't bother checking. * ospf_spf.c: (static struct list vertex_list) Record vertices that will need to be freed. (cmp) Order network before router vertices, as required, wasn't implemented. (vertex_nexthop_free) Mild additional robustness check. (vertex_parent_free) Take void argument, as this function is passed as list deconstructor for vertex parent list. (ospf_vertex_new) More debug. Set deconstructor for parent list. Track allocated vertices on the vertex_list. (ospf_vertex_free) Get rid of the tricky recursive cleanup of vertices. Now frees only the given vertex. (ospf_vertex_add_parent) Fix assert. (ospf_nexthop_calculation) Fix calculation of nexthop for VLink vertices, lookup the vl_data and use its previously recorded nexthop information. (ospf_spf_calculate) Vertices are freed simply by deleting vertex_list nodes and letting ospf_vertex_free as deconstructor work per-node. (ospf_spf_calculate_timer) Trivial optimisation, leave backbone SPF calculation till last to reduce SPF churn on VLink updates. * ospf_vty.c: (ospf_find_vl_data) update call to ospf_vl_lookup (no_ospf_area_vlink_cmd) ditto. (show_ip_ospf_interface_sub) For Vlinks, the peer address is more interesting than the output interface.
* 2005-10-18 Paul Jakma <paul.jakma@sun.com>paul2005-10-181-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (general) SPF memory management cleanup and fix for rare double-free bug. * ospf_spf.h: (struct vertex_parent) New struct to hold parent specific data, eg the backlink and the parent vertex pointer, and point to the appropriate general struct vertex_nexthop. (struct vertex_nexthop) remove parent vertex pointer, so this struct can be shared across vertices. (struct vertex) rename list child to list children. Remove list of nexthops, replace with list of vertex_parents. * ospf_spf.c: (update_stat) trivial, remove cast from void *. (vertex_nexthop_new) remove init of parent - field is gone from struct vertex_nexthop. (ospf_canonical_nexthops_free) Remove the canonical vertex_nexthop memory objects. These are the vertex_nexthops attached to the first level of router vertices from the root. (vertex_parent_new) new function, create a vertex_parent. (vertex_parent_free) ditto, but free it. (ospf_vertex_new) Update to match changes to struct vertex. (ospf_vertex_free) Recursively free a struct vertex and its children. The parent list is used as a reference count. vertex_nexthops must be free seperately, if required. (ospf_vertex_dump) update to match struct vertex changes. Print out backlink of parents too. (ospf_vertex_add_parent) ditto. (ospf_lsa_has_link) update comment. (ospf_nexthop_add_unique) removed, not needed anymore. (ospf_nexthop_merge) ditto. (ospf_spf_consider_nexthop) renamed to ospf_spf_add_parent. Simplified to just create vertex_parent and add it. (ospf_spf_flush_parents) new function, flush out the parent list. (ospf_nexthop_calculation) Take the relevant route_lsa_link as an argument, which simplifies things and removes the need for the hack in ospf_nexthop_add_unique - ospf_spf_next already knew exactly which link the cost calculated was for. Update to match struct vertex changes too. (ospf_spf_next) Don't create a vertex for W unnecessarily, if it's there's a vertex already created for W, use it, and hence there's no need to free it either. Update some manipulation/comparisons of distance to match. Flush the parent list if a lower cost path is found. (ospf_spf_route_free) unused, removed. (ospf_spf_dump) match the struct vertex changes, and dump the ifname if possible. (ospf_spf_calculate) At end of SPF, free the canonical nexthops and call ospf_vertex_free on the root vertex to free the entire tree. * ospf_interface.c: (ospf_vl_set_params) match struct vertex changes. * ospf_route.c: (ospf_intra_route_add) ditto (ospf_route_copy_nexthops_from_vertex) ditto * memtypes.c: (memory_list_ospf) Add MTYPE_OSPF_VERTEX_PARENT.
* 2005-05-06 Paul Jakma <paul.jakma@sun.com>paul2005-05-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | * (general) extern and static qualifiers added. unspecified arguments in definitions fixed, typically they should be 'void'. function casts added for callbacks. Guards added to headers which lacked them. Proper headers included rather than relying on incomplete definitions. gcc noreturn function attribute where appropriate. * ospf_opaque.c: remove the private definition of ospf_lsa's ospf_lsa_refresh_delay. * ospf_lsa.h: export ospf_lsa_refresh_delay * ospf_packet.c: (ospf_make_md5_digest) make *auth_key const, correct thing to do - removes need for the casts later. * ospf_vty.c: Use vty.h's VTY_GET_INTEGER rather than ospf_vty's home-brewed versions, shuts up several warnings. * ospf_vty.h: remove VTY_GET_UINT32. VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX moved to lib/vty.h. * ospf_zebra.c: (ospf_distribute_list_update_timer) hacky overloading of the THREAD_ARG pointer should at least use uintptr_t.
* * ospf_lsa.h: New flag to the LSA structure for the SPF calculation.hasso2005-02-231-0/+1
| | | | | | | | | | * ospf_lsdb.h: Export ospf_lsdb_clean_stat() function. * ospf_spf.h: Add link to the LSA stat structure into vertex. * ospf_spf.c: New functions cmp() and update_stat() to manage candidates. Remove ospf_spf_has_vertex(), ospf_vertex_lookup(), ospf_install_candidate() and ospf_spf_register() functions not needed any more. Update ospf_vertex_new(), ospf_spf_next() and ospf_spf_calculate() functions to use pqueue instead of linked list.
* Remove usage of evil list and listnode typedefs.hasso2004-09-231-2/+2
|
* Assorted changes from work at BBN. Most are minor, and several are ingdt2004-08-311-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support of more significant changes not in this commit. The last item in the ChangeLog below may be needed for p2mp to work correctly. 2004-08-31 David Wiggins <dwiggins@bbn.com> * hash.c (hash_iterate): Save next pointer before calling procedure, so that iteration works even if the called procedure deletes the hash backet. * linklist.h (listtail): new macro, not yet used. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_spf.c (ospf_spf_calculate): Many more comments and debug print statements. New function ospf_vertex_dump used in debugging. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_spf.h (struct vertex): Comments for flags and structure members. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_route.c: When finding an alternate route, log cost as well. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_interface.c (ospf_lookup_if_params): Initialize af in struct prefix allocated on stack. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_packet.c (ospf_ls_ack_send_delayed): In p2mp mode, send acks to AllSPFRouters, rather than All-DR.
* 2004-04-08 Paul Jakma <paul@dishone.st>paul2004-04-081-1/+2
| | | | | | | | | | | * ospf_spf.h: Add backlink field to struct vertex * ospf_spf.h: (ospf_vertex_new) initialise backlink (ospf_lsa_has_link) return index of link back to vertex V from candidate vertex W, or -1 if no link exists. (ospf_spf_next) save backlink index for candidate vertex * ospf_interface.c: (ospf_vl_set_params) Use the backlink index to determine correct address for virtual-link peers. Fall back to older "pick first link" method if no backlink index exists.
* Initial revisionpaul2002-12-131-0/+50