summaryrefslogtreecommitdiff
path: root/ospfd/ospf_spf.h
AgeCommit message (Collapse)Author
2005-10-182005-10-18 Paul Jakma <paul.jakma@sun.com>paul
* (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-062005-05-06 Paul Jakma <paul.jakma@sun.com>paul
* (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.
2005-02-23 * ospf_lsa.h: New flag to the LSA structure for the SPF calculation.hasso
* 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.
2004-09-23Remove usage of evil list and listnode typedefs.hasso
2004-08-31Assorted changes from work at BBN. Most are minor, and several are ingdt
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-082004-04-08 Paul Jakma <paul@dishone.st>paul
* 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.
2002-12-13Initial revisionpaul