static void ospf6_abr_delete_route(struct ospf6_route *range,
struct ospf6_route *summary,
struct ospf6_route_table *summary_table,
- struct ospf6_lsa *old, struct ospf6 *ospf6)
+ struct ospf6_lsa *old)
{
if (summary) {
- ospf6_route_remove(summary, summary_table, ospf6);
+ ospf6_route_remove(summary, summary_table);
}
if (old && !OSPF6_LSA_IS_MAXAGE(old))
area->ospf6->router_id, area->lsdb);
if (old)
ospf6_lsa_purge(old);
- ospf6_route_remove(ro, area->summary_prefix, area->ospf6);
+ ospf6_route_remove(ro, area->summary_prefix);
}
/* Withdraw all summary router-routes previously originated */
area->ospf6->router_id, area->lsdb);
if (old)
ospf6_lsa_purge(old);
- ospf6_route_remove(ro, area->summary_router, area->ospf6);
+ ospf6_route_remove(ro, area->summary_router);
}
/* Schedule Router-LSA for each area (ABR status may change) */
"The range is not active. withdraw");
ospf6_abr_delete_route(route, summary,
- summary_table, old,
- area->ospf6);
+ summary_table, old);
}
} else if (old) {
- ospf6_route_remove(summary, summary_table, area->ospf6);
+ ospf6_route_remove(summary, summary_table);
ospf6_lsa_purge(old);
}
return 0;
zlog_debug(
"Area has been stubbed, purge Inter-Router LSA");
- ospf6_abr_delete_route(route, summary, summary_table, old,
- area->ospf6);
+ ospf6_abr_delete_route(route, summary, summary_table, old);
return 0;
}
if (is_debug)
zlog_debug("Area has been stubbed, purge prefix LSA");
- ospf6_abr_delete_route(route, summary, summary_table, old,
- area->ospf6);
+ ospf6_abr_delete_route(route, summary, summary_table, old);
return 0;
}
zlog_debug(
"This is the secondary path to the ASBR, ignore");
ospf6_abr_delete_route(route, summary, summary_table,
- old, area->ospf6);
+ old);
return 0;
}
"Suppressed by range %pFX of area %s",
&range->prefix, route_area->name);
ospf6_abr_delete_route(route, summary, summary_table,
- old, area->ospf6);
+ old);
return 0;
}
}
zlog_debug(
"This is the range with DoNotAdvertise set. ignore");
ospf6_abr_delete_route(route, summary, summary_table,
- old, area->ospf6);
+ old);
return 0;
}
if (is_debug)
zlog_debug("The range is not active. withdraw");
ospf6_abr_delete_route(route, summary, summary_table,
- old, area->ospf6);
+ old);
return 0;
}
}
summary->path.origin.type,
summary->path.origin.adv_router, area->lsdb);
}
- summary = ospf6_route_add(summary, summary_table, area->ospf6);
+ summary = ospf6_route_add(summary, summary_table);
} else {
summary->type = route->type;
monotime(&summary->changed);
void ospf6_abr_old_path_update(struct ospf6_route *old_route,
struct ospf6_route *route,
- struct ospf6_route_table *table,
- struct ospf6 *ospf6)
+ struct ospf6_route_table *table)
{
struct ospf6_path *o_path = NULL;
struct listnode *anode, *anext;
: 0);
if (table->hook_add)
- (*table->hook_add)(old_route, ospf6);
+ (*table->hook_add)(old_route);
if (old_route->path.origin.id == route->path.origin.id &&
old_route->path.origin.adv_router ==
}
void ospf6_abr_old_route_remove(struct ospf6_lsa *lsa, struct ospf6_route *old,
- struct ospf6_route_table *table,
- struct ospf6 *ospf6)
+ struct ospf6_route_table *table)
{
if (listcount(old->paths) > 1) {
struct listnode *anode, *anext, *nnode, *rnode, *rnext;
: 0);
if (table->hook_add)
- (*table->hook_add)(old, ospf6);
+ (*table->hook_add)(old);
if ((old->path.origin.id == lsa->header->id) &&
(old->path.origin.adv_router
h_path->origin.adv_router;
}
} else
- ospf6_route_remove(old, table, ospf6);
+ ospf6_route_remove(old, table);
}
} else
- ospf6_route_remove(old, table, ospf6);
+ ospf6_route_remove(old, table);
}
/* RFC 2328 16.2. Calculating the inter-area routes */
if (is_debug)
zlog_debug("cost is LS_INFINITY, ignore");
if (old)
- ospf6_abr_old_route_remove(lsa, old, table, oa->ospf6);
+ ospf6_abr_old_route_remove(lsa, old, table);
return;
}
if (OSPF6_LSA_IS_MAXAGE(lsa)) {
zlog_debug("%s: LSA %s is MaxAge, ignore", __func__,
lsa->name);
if (old)
- ospf6_abr_old_route_remove(lsa, old, table, oa->ospf6);
+ ospf6_abr_old_route_remove(lsa, old, table);
return;
}
zlog_debug("LSA %s is self-originated, ignore",
lsa->name);
if (old)
- ospf6_route_remove(old, table, oa->ospf6);
+ ospf6_route_remove(old, table);
return;
}
zlog_debug(
"Prefix is equal to address range, ignore");
if (old)
- ospf6_route_remove(old, table, oa->ospf6);
+ ospf6_route_remove(old, table);
return;
}
if (is_debug)
zlog_debug("Prefix has NU/LA bit set, ignore");
if (old)
- ospf6_route_remove(old, table, oa->ospf6);
+ ospf6_route_remove(old, table);
return;
}
}
if (is_debug)
zlog_debug("Prefix has NU/LA bit set, ignore");
if (old)
- ospf6_route_remove(old, table, oa->ospf6);
+ ospf6_route_remove(old, table);
return;
}
"Ignorning Inter-Router LSA for an ABR (%s)",
buf);
if (old)
- ospf6_route_remove(old, table, oa->ospf6);
+ ospf6_route_remove(old, table);
return;
}
zlog_debug(
"%s: remove old entry: %s %p ",
__func__, buf, (void *)old);
- ospf6_route_remove(old, table, oa->ospf6);
+ ospf6_route_remove(old, table);
}
}
return;
zlog_debug(
"Prefix was denied by import-list");
if (old)
- ospf6_route_remove(old, table,
- oa->ospf6);
+ ospf6_route_remove(old, table);
return;
}
}
if (is_debug)
zlog_debug("Prefix was denied by prefix-list");
if (old)
- ospf6_route_remove(old, table, oa->ospf6);
+ ospf6_route_remove(old, table);
return;
}
}
*/
if (listcount(old_route->paths) > 1)
ospf6_abr_old_path_update(old_route, route,
- table, oa->ospf6);
+ table);
continue;
}
* For Inter-Router trigger summary update
*/
if (table->hook_add)
- (*table->hook_add)(old_route, oa->ospf6);
+ (*table->hook_add)(old_route);
/* Delete new route */
ospf6_route_delete(route);
ospf6_copy_nexthops(path->nh_list, abr_entry->nh_list);
listnode_add_sort(route->paths, path);
/* ospf6_ia_add_nw_route (table, &prefix, route); */
- ospf6_route_add(route, table, oa->ospf6);
+ ospf6_route_add(route, table);
}
}
extern int ospf6_abr_config_write(struct vty *vty);
extern void ospf6_abr_old_route_remove(struct ospf6_lsa *lsa,
struct ospf6_route *old,
- struct ospf6_route_table *table,
- struct ospf6 *ospf6);
+ struct ospf6_route_table *table);
extern void ospf6_abr_old_path_update(struct ospf6_route *old_route,
struct ospf6_route *route,
- struct ospf6_route_table *table,
- struct ospf6 *ospf6);
+ struct ospf6_route_table *table);
extern void ospf6_abr_init(void);
#endif /*OSPF6_ABR_H*/
}
}
-static void ospf6_area_route_hook_add(struct ospf6_route *route,
- struct ospf6 *ospf6)
+static void ospf6_area_route_hook_add(struct ospf6_route *route)
{
+ struct ospf6_area *oa = route->table->scope;
+ struct ospf6 *ospf6 = oa->ospf6;
struct ospf6_route *copy;
copy = ospf6_route_copy(route);
- ospf6_route_add(copy, ospf6->route_table, ospf6);
+ ospf6_route_add(copy, ospf6->route_table);
}
-static void ospf6_area_route_hook_remove(struct ospf6_route *route,
- struct ospf6 *ospf6)
+static void ospf6_area_route_hook_remove(struct ospf6_route *route)
{
+ struct ospf6_area *oa = route->table->scope;
+ struct ospf6 *ospf6 = oa->ospf6;
struct ospf6_route *copy;
copy = ospf6_route_lookup_identical(route, ospf6->route_table);
if (copy)
- ospf6_route_remove(copy, ospf6->route_table, ospf6);
+ ospf6_route_remove(copy, ospf6->route_table);
}
static void ospf6_area_stub_update(struct ospf6_area *area)
ospf6_lsdb_delete(oa->lsdb_self);
ospf6_lsdb_delete(oa->temp_router_lsa_lsdb);
- ospf6_spf_table_finish(oa->spf_table, oa->ospf6);
- ospf6_route_table_delete(oa->spf_table, oa->ospf6);
- ospf6_route_table_delete(oa->route_table, oa->ospf6);
+ ospf6_spf_table_finish(oa->spf_table);
+ ospf6_route_table_delete(oa->spf_table);
+ ospf6_route_table_delete(oa->route_table);
- ospf6_route_table_delete(oa->range_table, oa->ospf6);
- ospf6_route_table_delete(oa->summary_prefix, oa->ospf6);
- ospf6_route_table_delete(oa->summary_router, oa->ospf6);
+ ospf6_route_table_delete(oa->range_table);
+ ospf6_route_table_delete(oa->summary_prefix);
+ ospf6_route_table_delete(oa->summary_router);
listnode_delete(oa->ospf6->area_list, oa);
oa->ospf6 = NULL;
ospf6_lsdb_remove_all(oa->lsdb);
ospf6_lsdb_remove_all(oa->lsdb_self);
- ospf6_spf_table_finish(oa->spf_table, oa->ospf6);
- ospf6_route_remove_all(oa->route_table, oa->ospf6);
+ ospf6_spf_table_finish(oa->spf_table);
+ ospf6_route_remove_all(oa->route_table);
THREAD_OFF(oa->thread_router_lsa);
THREAD_OFF(oa->thread_intra_prefix_lsa);
zlog_debug("%s: for prefix %s, flag = %x", __func__,
argv[idx_ipv6_prefixlen]->arg, range->flag);
if (range->rnode == NULL) {
- ospf6_route_add(range, oa->range_table, oa->ospf6);
+ ospf6_route_add(range, oa->range_table);
}
if (ospf6_is_router_abr(ospf6)) {
/* purge the old aggregated summary LSA */
ospf6_abr_originate_summary(range, oa->ospf6);
}
- ospf6_route_remove(range, oa->range_table, oa->ospf6);
+ ospf6_route_remove(range, oa->range_table);
return CMD_SUCCESS;
}
route = ospf6_route_lookup(&prefix, spf_table);
if (route == NULL) {
- ospf6_spf_table_finish(spf_table, ospf6);
- ospf6_route_table_delete(spf_table, ospf6);
+ ospf6_spf_table_finish(spf_table);
+ ospf6_route_table_delete(spf_table);
return CMD_SUCCESS;
}
root = (struct ospf6_vertex *)route->route_option;
ospf6_spf_display_subtree(vty, "", 0, root);
- ospf6_spf_table_finish(spf_table, ospf6);
- ospf6_route_table_delete(spf_table, ospf6);
+ ospf6_spf_table_finish(spf_table);
+ ospf6_route_table_delete(spf_table);
return CMD_SUCCESS;
}
*/
if (ospf6->route_table->hook_add)
(*ospf6->route_table->hook_add)(
- old_route, ospf6);
+ old_route);
if (old_route->path.origin.id
== route->path.origin.id
route->path.cost);
}
ospf6_route_remove(old_route,
- ospf6->route_table, ospf6);
+ ospf6->route_table);
}
}
if (route_updated)
/* Update RIB/FIB */
if (ospf6->route_table->hook_add)
- (*ospf6->route_table->hook_add)(old_route,
- ospf6);
+ (*ospf6->route_table->hook_add)(old_route);
/* Delete the new route its info added to existing
* route.
if (!route_found) {
/* Add new route to existing node in ospf6 route table. */
- ospf6_route_add(route, ospf6->route_table, ospf6);
+ ospf6_route_add(route, ospf6->route_table);
}
}
old = ospf6_route_lookup(&route->prefix, ospf6->route_table);
if (!old) {
/* Add the new route to ospf6 instance route table. */
- ospf6_route_add(route, ospf6->route_table, ospf6);
+ ospf6_route_add(route, ospf6->route_table);
} else {
/* RFC 2328 16.4 (6)
* ECMP: Keep new equal preference path in current
*/
if (oa->ospf6->route_table->hook_add)
(*oa->ospf6->route_table
- ->hook_add)(
- route, oa->ospf6);
+ ->hook_add)(route);
/* route's primary path is similar
* to LSA, replace route's primary
}
} else {
ospf6_route_remove(
- route, oa->ospf6->route_table,
- oa->ospf6);
+ route, oa->ospf6->route_table);
}
}
continue;
&route->prefix, route->path.cost, route->path.u.cost_e2,
listcount(route->nh_list));
}
- ospf6_route_remove(route, oa->ospf6->route_table, oa->ospf6);
+ ospf6_route_remove(route, oa->ospf6->route_table);
}
if (route != NULL)
ospf6_route_unlock(route);
node = route_node_get(ospf6->external_id_table, &prefix_id);
node->info = route;
- route = ospf6_route_add(route, ospf6->external_table, ospf6);
+ route = ospf6_route_add(route, ospf6->external_table);
route->route_option = info;
if (IS_OSPF6_DEBUG_ASBR) {
route_unlock_node(node); /* to free the lookup lock */
route_unlock_node(node); /* to free the original lock */
- ospf6_route_remove(match, ospf6->external_table, ospf6);
+ ospf6_route_remove(match, ospf6->external_table);
XFREE(MTYPE_OSPF6_EXTERNAL_INFO, info);
/* Router-Bit (ASBR Flag) may have to be updated */
ospf6_lsdb_delete(oi->lsupdate_list);
ospf6_lsdb_delete(oi->lsack_list);
- ospf6_route_table_delete(oi->route_connected, oi->area->ospf6);
+ ospf6_route_table_delete(oi->route_connected);
/* cut link */
oi->interface->info = NULL;
return;
/* update "route to advertise" interface route table */
- ospf6_route_remove_all(oi->route_connected, oi->area->ospf6);
+ ospf6_route_remove_all(oi->route_connected);
for (ALL_LIST_ELEMENTS(oi->interface->connected, node, nnode, c)) {
if (c->address->family != AF_INET6)
inet_pton(AF_INET6, "::1", &nh_addr);
ospf6_route_add_nexthop(route, oi->interface->ifindex,
&nh_addr);
- ospf6_route_add(route, oi->route_connected, oi->area->ospf6);
+ ospf6_route_add(route, oi->route_connected);
}
/* create new Link-LSA */
if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
zlog_debug(" include %pFX", &route->prefix);
ospf6_route_add(ospf6_route_copy(route),
- route_advertise, oa->ospf6);
+ route_advertise);
}
}
oa->lsdb);
}
}
- ospf6_route_table_delete(route_advertise, oa->ospf6);
+ ospf6_route_table_delete(route_advertise);
return 0;
}
op = OSPF6_PREFIX_NEXT(op);
}
- ospf6_route_table_delete(route_advertise, oa->ospf6);
+ ospf6_route_table_delete(route_advertise);
if (prefix_num == 0) {
if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
zlog_debug(" include %pFX", &route->prefix);
- ospf6_route_add(route, route_advertise,
- oi->area->ospf6);
+ ospf6_route_add(route, route_advertise);
prefix_num--;
}
if (current != end && IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
prefix_num++;
}
- ospf6_route_table_delete(route_advertise, oi->area->ospf6);
+ ospf6_route_table_delete(route_advertise);
if (prefix_num == 0) {
if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
*/
if (oa->route_table->hook_add)
(*oa->route_table->hook_add)(
- old_route, oa->ospf6);
+ old_route);
if (old_route->path.origin.id ==
route->path.origin.id &&
}
if (oa->route_table->hook_remove)
ospf6_route_remove(old_route,
- oa->route_table,
- oa->ospf6);
+ oa->route_table);
else
SET_FLAG(old_route->flag,
OSPF6_ROUTE_REMOVE);
SET_FLAG(old_route->flag, OSPF6_ROUTE_ADD);
/* Update ospf6 route table and RIB/FIB */
if (oa->route_table->hook_add)
- (*oa->route_table->hook_add)(old_route,
- oa->ospf6);
+ (*oa->route_table->hook_add)(old_route);
/* Delete the new route its info added to existing
* route.
*/
if (!route_found) {
/* Add new route to existing node in ospf6 route table. */
- ospf6_route_add(route, oa->route_table, oa->ospf6);
+ ospf6_route_add(route, oa->route_table);
}
}
listcount(route->paths),
listcount(route->nh_list));
}
- ospf6_route_add(route, oa->route_table, oa->ospf6);
+ ospf6_route_add(route, oa->route_table);
}
prefix_num--;
}
* nh_list
*/
if (oa->route_table->hook_add)
- (*oa->route_table->hook_add)(route, oa->ospf6);
+ (*oa->route_table->hook_add)(route);
/* route's primary path is similar
* to LSA, replace route's primary
listcount(route->paths),
listcount(route->nh_list));
}
- ospf6_route_remove(route, oa->route_table,
- oa->ospf6);
+ ospf6_route_remove(route, oa->route_table);
}
}
if (route)
struct ospf6_route *route, *nroute;
uint16_t type;
struct ospf6_lsa *lsa;
- void (*hook_add)(struct ospf6_route *, struct ospf6 *) = NULL;
- void (*hook_remove)(struct ospf6_route *, struct ospf6 *) = NULL;
+ void (*hook_add)(struct ospf6_route *) = NULL;
+ void (*hook_remove)(struct ospf6_route *) = NULL;
if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX))
zlog_debug("Re-examin intra-routes for area %s", oa->name);
}
if (CHECK_FLAG(route->flag, OSPF6_ROUTE_REMOVE))
- ospf6_route_remove(route, oa->route_table, oa->ospf6);
+ ospf6_route_remove(route, oa->route_table);
else if (CHECK_FLAG(route->flag, OSPF6_ROUTE_ADD)
|| CHECK_FLAG(route->flag, OSPF6_ROUTE_CHANGE)) {
if (hook_add)
- (*hook_add)(route, oa->ospf6);
+ (*hook_add)(route);
route->flag = 0;
} else {
/* Redo the summaries as things might have changed */
void ospf6_intra_brouter_calculation(struct ospf6_area *oa)
{
struct ospf6_route *brouter, *nbrouter, *copy;
- void (*hook_add)(struct ospf6_route *, struct ospf6 *) = NULL;
- void (*hook_remove)(struct ospf6_route *, struct ospf6 *) = NULL;
+ void (*hook_add)(struct ospf6_route *) = NULL;
+ void (*hook_remove)(struct ospf6_route *) = NULL;
uint32_t brouter_id;
char brouter_name[16];
copy = ospf6_route_copy(brouter);
copy->type = OSPF6_DEST_TYPE_ROUTER;
copy->path.area_id = oa->area_id;
- ospf6_route_add(copy, oa->ospf6->brouter_table, oa->ospf6);
+ ospf6_route_add(copy, oa->ospf6->brouter_table);
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_ID(brouter_id)
|| IS_OSPF6_DEBUG_ROUTE(MEMORY)) {
* removes brouters which are marked for remove.
*/
oa->intra_brouter_calc = 1;
- ospf6_route_remove(brouter, oa->ospf6->brouter_table,
- oa->ospf6);
+ ospf6_route_remove(brouter, oa->ospf6->brouter_table);
brouter = NULL;
} else if (CHECK_FLAG(brouter->flag, OSPF6_ROUTE_ADD)
|| CHECK_FLAG(brouter->flag, OSPF6_ROUTE_CHANGE)) {
/* newly added */
if (hook_add)
- (*hook_add)(brouter, oa->ospf6);
+ (*hook_add)(brouter);
} else {
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_ID(
brouter_id)
struct ospf6_route *ospf6_route_create(void)
{
struct ospf6_route *route;
+
route = XCALLOC(MTYPE_OSPF6_ROUTE, sizeof(struct ospf6_route));
route->nh_list = list_new();
route->nh_list->cmp = (int (*)(void *, void *))ospf6_nexthop_cmp;
#endif /*DEBUG*/
struct ospf6_route *ospf6_route_add(struct ospf6_route *route,
- struct ospf6_route_table *table,
- struct ospf6 *ospf6)
+ struct ospf6_route_table *table)
{
struct route_node *node, *nextnode, *prevnode;
struct ospf6_route *current = NULL;
ospf6_route_table_assert(table);
if (table->hook_add)
- (*table->hook_add)(route, ospf6);
+ (*table->hook_add)(route);
return route;
}
SET_FLAG(route->flag, OSPF6_ROUTE_ADD);
if (table->hook_add)
- (*table->hook_add)(route, ospf6);
+ (*table->hook_add)(route);
return route;
}
SET_FLAG(route->flag, OSPF6_ROUTE_ADD);
if (table->hook_add)
- (*table->hook_add)(route, ospf6);
+ (*table->hook_add)(route);
return route;
}
void ospf6_route_remove(struct ospf6_route *route,
- struct ospf6_route_table *table, struct ospf6 *ospf6)
+ struct ospf6_route_table *table)
{
struct route_node *node;
struct ospf6_route *current;
/* Note hook_remove may call ospf6_route_remove */
if (table->hook_remove)
- (*table->hook_remove)(route, ospf6);
+ (*table->hook_remove)(route);
ospf6_route_unlock(route);
}
return next;
}
-void ospf6_route_remove_all(struct ospf6_route_table *table,
- struct ospf6 *ospf6)
+void ospf6_route_remove_all(struct ospf6_route_table *table)
{
struct ospf6_route *route;
for (route = ospf6_route_head(table); route;
route = ospf6_route_next(route))
- ospf6_route_remove(route, table, ospf6);
+ ospf6_route_remove(route, table);
}
struct ospf6_route_table *ospf6_route_table_create(int s, int t)
return new;
}
-void ospf6_route_table_delete(struct ospf6_route_table *table,
- struct ospf6 *ospf6)
+void ospf6_route_table_delete(struct ospf6_route_table *table)
{
- ospf6_route_remove_all(table, ospf6);
+ ospf6_route_remove_all(table);
bf_free(table->idspace);
route_table_finish(table->table);
XFREE(MTYPE_OSPF6_ROUTE, table);
bitfield_t idspace;
/* hooks */
- void (*hook_add)(struct ospf6_route *, struct ospf6 *);
+ void (*hook_add)(struct ospf6_route *);
void (*hook_change)(struct ospf6_route *);
- void (*hook_remove)(struct ospf6_route *, struct ospf6 *);
+ void (*hook_remove)(struct ospf6_route *);
};
#define OSPF6_SCOPE_TYPE_NONE 0
struct ospf6_route_table *table);
extern struct ospf6_route *ospf6_route_add(struct ospf6_route *route,
- struct ospf6_route_table *table,
- struct ospf6 *ospf6);
+ struct ospf6_route_table *table);
extern void ospf6_route_remove(struct ospf6_route *route,
- struct ospf6_route_table *table,
- struct ospf6 *ospf6);
+ struct ospf6_route_table *table);
extern struct ospf6_route *ospf6_route_head(struct ospf6_route_table *table);
extern struct ospf6_route *ospf6_route_next(struct ospf6_route *route);
extern struct ospf6_route *ospf6_route_match_next(struct prefix *prefix,
struct ospf6_route *route);
-extern void ospf6_route_remove_all(struct ospf6_route_table *, struct ospf6 *);
+extern void ospf6_route_remove_all(struct ospf6_route_table *table);
extern struct ospf6_route_table *ospf6_route_table_create(int s, int t);
-extern void ospf6_route_table_delete(struct ospf6_route_table *,
- struct ospf6 *);
+extern void ospf6_route_table_delete(struct ospf6_route_table *table);
extern void ospf6_route_dump(struct ospf6_route_table *table);
}
static int ospf6_spf_install(struct ospf6_vertex *v,
- struct ospf6_route_table *result_table,
- struct ospf6 *ospf6)
+ struct ospf6_route_table *result_table)
{
struct ospf6_route *route, *parent_route;
struct ospf6_vertex *prev;
listnode_add_sort(v->parent->child_list, v);
route->route_option = v;
- ospf6_route_add(route, result_table, ospf6);
+ ospf6_route_add(route, result_table);
return 0;
}
-void ospf6_spf_table_finish(struct ospf6_route_table *result_table,
- struct ospf6 *ospf6)
+void ospf6_spf_table_finish(struct ospf6_route_table *result_table)
{
struct ospf6_route *route, *nroute;
struct ospf6_vertex *v;
nroute = ospf6_route_next(route);
v = (struct ospf6_vertex *)route->route_option;
ospf6_vertex_delete(v);
- ospf6_route_remove(route, result_table, ospf6);
+ ospf6_route_remove(route, result_table);
}
}
struct ospf6_lsa *lsa;
struct in6_addr address;
- ospf6_spf_table_finish(result_table, oa->ospf6);
+ ospf6_spf_table_finish(result_table);
/* Install the calculating router itself as the root of the SPF tree */
/* construct root vertex */
while ((v = vertex_pqueue_pop(&candidate_list))) {
/* installing may result in merging or rejecting of the vertex
*/
- if (ospf6_spf_install(v, result_table, oa->ospf6) < 0)
+ if (ospf6_spf_install(v, result_table) < 0)
continue;
/* Skip overloaded routers */
return (reason);
}
-extern void ospf6_spf_table_finish(struct ospf6_route_table *result_table,
- struct ospf6 *ospf6);
+extern void ospf6_spf_table_finish(struct ospf6_route_table *result_table);
extern void ospf6_spf_calculation(uint32_t router_id,
struct ospf6_route_table *result_table,
struct ospf6_area *oa);
}
}
-static void ospf6_top_route_hook_add(struct ospf6_route *route,
- struct ospf6 *ospf6)
+static void ospf6_top_route_hook_add(struct ospf6_route *route)
{
+ struct ospf6 *ospf6 = route->table->scope;
+
ospf6_abr_originate_summary(route, ospf6);
ospf6_zebra_route_update_add(route, ospf6);
}
-static void ospf6_top_route_hook_remove(struct ospf6_route *route,
- struct ospf6 *ospf6)
+static void ospf6_top_route_hook_remove(struct ospf6_route *route)
{
+ struct ospf6 *ospf6 = route->table->scope;
+
route->flag |= OSPF6_ROUTE_REMOVE;
ospf6_abr_originate_summary(route, ospf6);
ospf6_zebra_route_update_remove(route, ospf6);
}
-static void ospf6_top_brouter_hook_add(struct ospf6_route *route,
- struct ospf6 *ospf6)
+static void ospf6_top_brouter_hook_add(struct ospf6_route *route)
{
+ struct ospf6 *ospf6 = route->table->scope;
+
if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL) ||
IS_OSPF6_DEBUG_BROUTER) {
uint32_t brouter_id;
ospf6_abr_originate_summary(route, ospf6);
}
-static void ospf6_top_brouter_hook_remove(struct ospf6_route *route,
- struct ospf6 *ospf6)
+static void ospf6_top_brouter_hook_remove(struct ospf6_route *route)
{
+ struct ospf6 *ospf6 = route->table->scope;
+
if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL) ||
IS_OSPF6_DEBUG_BROUTER) {
uint32_t brouter_id;
ospf6_lsdb_delete(o->lsdb);
ospf6_lsdb_delete(o->lsdb_self);
- ospf6_route_table_delete(o->route_table, o);
- ospf6_route_table_delete(o->brouter_table, o);
+ ospf6_route_table_delete(o->route_table);
+ ospf6_route_table_delete(o->brouter_table);
- ospf6_route_table_delete(o->external_table, o);
+ ospf6_route_table_delete(o->external_table);
route_table_finish(o->external_id_table);
ospf6_distance_reset(o);
ospf6_asbr_redistribute_reset(o->vrf_id);
ospf6_lsdb_remove_all(o->lsdb);
- ospf6_route_remove_all(o->route_table, o);
- ospf6_route_remove_all(o->brouter_table, o);
+ ospf6_route_remove_all(o->route_table);
+ ospf6_route_remove_all(o->brouter_table);
THREAD_OFF(o->maxage_remover);
THREAD_OFF(o->t_spf_calc);