
shemminger at vyatta
Dec 5, 2011, 11:16 AM
Post #1 of 1
(139 views)
Permalink
|
|
[PATCH 1/8] ospf: remove unused code
|
|
The code for nssa_range and other bits that were written but never used. --- ospfd/ospf_abr.c | 45 ------------------------------------------- ospfd/ospf_route.c | 55 ----------------------------------------------------- ospfd/ospf_spf.c | 2 + ospfd/ospf_vty.c | 3 +- ospfd/ospfd.c | 2 + 5 files changed, 6 insertions(+), 101 deletions(-) --- a/ospfd/ospf_abr.c 2011-12-05 10:09:10.413681764 -0800 +++ b/ospfd/ospf_abr.c 2011-12-05 10:11:04.998980418 -0800 @@ -613,15 +613,6 @@ set_metric (struct ospf_lsa *lsa, u_int3 memcpy(header->metric, mp, 3); } -static int -ospf_abr_check_nssa_range (struct prefix_ipv4 *p, u_int32_t cost, - struct ospf_area *area) -{ - /* The Type-7 is tested against the aggregated prefix and forwarded - for lsa installation and flooding */ - return 0; -} - /* ospf_abr_translate_nssa */ static int ospf_abr_translate_nssa (struct ospf_area *area, struct ospf_lsa *lsa) @@ -1577,42 +1568,6 @@ ospf_abr_send_nssa_aggregates (struct os } static void -ospf_abr_announce_nssa_defaults (struct ospf *ospf) /* By ABR-Translator */ -{ - struct listnode *node; - struct ospf_area *area; - - if (! IS_OSPF_ABR (ospf)) - return; - - if (IS_DEBUG_OSPF_NSSA) - zlog_debug ("ospf_abr_announce_stub_defaults(): Start"); - - for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area)) - { - if (IS_DEBUG_OSPF_NSSA) - zlog_debug ("ospf_abr_announce_nssa_defaults(): looking at area %s", - inet_ntoa (area->area_id)); - - if (area->external_routing != OSPF_AREA_NSSA) - continue; - - if (OSPF_IS_AREA_BACKBONE (area)) - continue; /* Sanity Check */ - - /* if (!TranslatorRole continue V 1.0 look for "always" conf */ - if (area->NSSATranslatorState) - { - if (IS_DEBUG_OSPF_NSSA) - zlog_debug ("ospf_abr_announce_nssa_defaults(): " - "announcing 0.0.0.0/0 to this nssa"); - /* ospf_abr_announce_nssa_asbr_to_as (&p, area->default_cost, area); */ - /*ospf_abr_announce_network_to_area (&p, area->default_cost, area);*/ - } - } -} - -static void ospf_abr_announce_stub_defaults (struct ospf *ospf) { struct listnode *node; --- a/ospfd/ospf_route.c 2011-12-05 10:09:10.453682240 -0800 +++ b/ospfd/ospf_route.c 2011-12-05 10:11:04.998980418 -0800 @@ -272,61 +272,6 @@ ospf_route_install (struct ospf *ospf, s } } -static void -ospf_intra_route_add (struct route_table *rt, struct vertex *v, - struct ospf_area *area) -{ - struct route_node *rn; - struct ospf_route *or; - struct prefix_ipv4 p; - struct ospf_path *path; - struct vertex_parent *parent; - struct listnode *node, *nnode; - - p.family = AF_INET; - p.prefix = v->id; - if (v->type == OSPF_VERTEX_ROUTER) - p.prefixlen = IPV4_MAX_BITLEN; - else - { - struct network_lsa *lsa = (struct network_lsa *) v->lsa; - p.prefixlen = ip_masklen (lsa->mask); - } - apply_mask_ipv4 (&p); - - rn = route_node_get (rt, (struct prefix *) &p); - if (rn->info) - { - zlog_warn ("Same routing information exists for %s", inet_ntoa (v->id)); - route_unlock_node (rn); - return; - } - - or = ospf_route_new (); - - if (v->type == OSPF_VERTEX_NETWORK) - { - or->type = OSPF_DESTINATION_NETWORK; - - for (ALL_LIST_ELEMENTS (v->parents, node, nnode, parent)) - { - path = ospf_path_new (); - path->nexthop = parent->nexthop->router; - listnode_add (or->paths, path); - } - } - else - or->type = OSPF_DESTINATION_ROUTER; - - or->id = v->id; - or->u.std.area_id = area->area_id; - or->u.std.external_routing= area->external_routing; - or->path_type = OSPF_PATH_INTRA_AREA; - or->cost = v->distance; - - rn->info = or; -} - /* RFC2328 16.1. (4). For "router". */ void ospf_intra_add_router (struct route_table *rt, struct vertex *v, --- a/ospfd/ospf_spf.c 2011-12-05 10:09:10.433682002 -0800 +++ b/ospfd/ospf_spf.c 2011-12-05 10:11:05.002980457 -0800 @@ -1042,6 +1042,7 @@ ospf_rtrs_free (struct route_table *rtrs route_table_finish (rtrs); } +#if 0 static void ospf_rtrs_print (struct route_table *rtrs) { @@ -1101,6 +1102,7 @@ ospf_rtrs_print (struct route_table *rtr zlog_debug ("ospf_rtrs_print() end"); } +#endif /* Calculating the shortest-path tree for an area. */ static void --- a/ospfd/ospf_vty.c 2011-12-05 10:09:10.461682335 -0800 +++ b/ospfd/ospf_vty.c 2011-12-05 10:11:05.002980457 -0800 @@ -3761,7 +3761,7 @@ show_as_external_lsa_detail (struct vty return 0; } -/* N.B. This function currently seems to be unused. */ +#if 0 static int show_as_external_lsa_stdvty (struct ospf_lsa *lsa) { @@ -3785,6 +3785,7 @@ show_as_external_lsa_stdvty (struct ospf return 0; } +#endif /* Show AS-NSSA-LSA detail information. */ static int --- a/ospfd/ospfd.c 2011-12-05 10:09:10.425681907 -0800 +++ b/ospfd/ospfd.c 2011-12-05 10:11:05.002980457 -0800 @@ -1204,6 +1204,7 @@ ospf_area_nssa_translator_role_set (stru return 1; } +#if 0 /* XXX: unused? Leave for symmetry? */ static int ospf_area_nssa_translator_role_unset (struct ospf *ospf, @@ -1221,6 +1222,7 @@ ospf_area_nssa_translator_role_unset (st return 1; } +#endif int ospf_area_export_list_set (struct ospf *ospf, _______________________________________________ Quagga-dev mailing list Quagga-dev [at] lists http://lists.quagga.net/mailman/listinfo/quagga-dev
|