OSPF6_OPT_CLEAR_ALL(router_lsa->options);
memcpy(router_lsa->options, oa->options, 3);
- if (ospf6_is_router_abr(ospf6))
+ if (ospf6_is_router_abr(oa->ospf6))
SET_FLAG(router_lsa->bits, OSPF6_ROUTER_BIT_B);
else
UNSET_FLAG(router_lsa->bits, OSPF6_ROUTER_BIT_B);
struct listnode *i, *j;
int full_count = 0;
unsigned short prefix_num = 0;
- char buf[PREFIX2STR_BUFFER];
struct ospf6_route_table *route_advertise;
int ls_id = 0;
/* connected prefix to advertise */
for (route = ospf6_route_head(oi->route_connected); route;
route = ospf6_route_best_next(route)) {
- if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX)) {
- prefix2str(&route->prefix, buf, sizeof(buf));
- zlog_debug(" include %s", buf);
- }
+ if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
+ zlog_debug(" include %pFX", &route->prefix);
ospf6_route_add(ospf6_route_copy(route),
- route_advertise);
+ route_advertise, oa->ospf6);
}
}
oa->lsdb);
}
}
- ospf6_route_table_delete(route_advertise);
+ ospf6_route_table_delete(route_advertise, oa->ospf6);
return 0;
}
op = OSPF6_PREFIX_NEXT(op);
}
- ospf6_route_table_delete(route_advertise);
+ ospf6_route_table_delete(route_advertise, oa->ospf6);
if (prefix_num == 0) {
if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
struct ospf6_link_lsa *link_lsa;
char *start, *end, *current;
uint16_t type;
- char buf[PREFIX2STR_BUFFER];
oi = (struct ospf6_interface *)THREAD_ARG(thread);
oi->thread_intra_prefix_lsa = NULL;
route->path.area_id = oi->area->area_id;
route->path.type = OSPF6_PATH_TYPE_INTRA;
- if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX)) {
- prefix2str(&route->prefix, buf, sizeof(buf));
- zlog_debug(" include %s", buf);
- }
+ if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
+ zlog_debug(" include %pFX", &route->prefix);
- ospf6_route_add(route, route_advertise);
+ ospf6_route_add(route, route_advertise,
+ oi->area->ospf6);
prefix_num--;
}
if (current != end && IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
prefix_num++;
}
- ospf6_route_table_delete(route_advertise);
+ ospf6_route_table_delete(route_advertise, oi->area->ospf6);
if (prefix_num == 0) {
if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
return 0;
}
-static void ospf6_intra_prefix_update_route_origin(struct ospf6_route *oa_route)
+static void ospf6_intra_prefix_update_route_origin(struct ospf6_route *oa_route,
+ struct ospf6 *ospf6)
{
struct ospf6_path *h_path;
struct ospf6_route *g_route, *nroute;
/* Update Global ospf6 route path */
- g_route = ospf6_route_lookup(&oa_route->prefix,
- ospf6->route_table);
+ g_route = ospf6_route_lookup(&oa_route->prefix, ospf6->route_table);
assert(g_route);
* nh_list
*/
if (oa->route_table->hook_add)
- (*oa->route_table->hook_add)
- (old_route);
+ (*oa->route_table->hook_add)(
+ old_route, oa->ospf6);
if (old_route->path.origin.id ==
route->path.origin.id &&
old_route->path.origin.adv_router ==
route->path.origin.adv_router) {
ospf6_intra_prefix_update_route_origin(
- old_route);
+ old_route, oa->ospf6);
}
break;
}
}
if (oa->route_table->hook_remove)
ospf6_route_remove(old_route,
- oa->route_table);
+ oa->route_table,
+ oa->ospf6);
else
SET_FLAG(old_route->flag,
OSPF6_ROUTE_REMOVE);
ospf6_linkstate_prefix(
o_path->origin.adv_router,
o_path->origin.id, &adv_prefix);
- prefix2str(&adv_prefix, buf,
- sizeof(buf));
zlog_debug(
- "%s: adv_router %s lsa not found",
- __func__, buf);
+ "%s: adv_router %pFX lsa not found",
+ __func__, &adv_prefix);
}
continue;
}
}
}
- if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {
- prefix2str(&route->prefix, buf, sizeof(buf));
+ if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX))
zlog_debug(
- "%s: route %s %p with final effective paths %u nh%u",
- __func__, buf, (void *)old_route,
+ "%s: route %pFX %p with final effective paths %u nh%u",
+ __func__, &route->prefix,
+ (void *)old_route,
old_route->paths
? listcount(old_route->paths)
: 0,
listcount(old_route->nh_list));
- }
/* used in intra_route_calculation() to add to
* global ospf6 route table.
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->route_table->hook_add)(old_route,
+ oa->ospf6);
/* 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);
+ ospf6_route_add(route, oa->route_table, oa->ospf6);
}
}
listcount(route->paths),
listcount(route->nh_list));
}
- ospf6_route_add(route, oa->route_table);
+ ospf6_route_add(route, oa->route_table, oa->ospf6);
}
prefix_num--;
}
* nh_list
*/
if (oa->route_table->hook_add)
- (*oa->route_table->hook_add)(route);
+ (*oa->route_table->hook_add)(route, oa->ospf6);
/* route's primary path is similar
* to LSA, replace route's primary
if ((route->path.origin.id == lsa->header->id) &&
(route->path.origin.adv_router ==
lsa->header->adv_router)) {
- ospf6_intra_prefix_update_route_origin(route);
+ ospf6_intra_prefix_update_route_origin(route,
+ oa->ospf6);
}
}
listcount(route->paths),
listcount(route->nh_list));
}
- ospf6_route_remove(route, oa->route_table);
+ ospf6_route_remove(route, oa->route_table,
+ oa->ospf6);
}
}
if (route)
struct ospf6_route *route, *nroute;
uint16_t type;
struct ospf6_lsa *lsa;
- void (*hook_add)(struct ospf6_route *) = NULL;
- void (*hook_remove)(struct ospf6_route *) = NULL;
+ void (*hook_add)(struct ospf6_route *, struct ospf6 *) = NULL;
+ void (*hook_remove)(struct ospf6_route *, struct ospf6 *) = 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);
+ ospf6_route_remove(route, oa->route_table, oa->ospf6);
else if (CHECK_FLAG(route->flag, OSPF6_ROUTE_ADD)
|| CHECK_FLAG(route->flag, OSPF6_ROUTE_CHANGE)) {
if (hook_add)
- (*hook_add)(route);
+ (*hook_add)(route, oa->ospf6);
route->flag = 0;
} else {
/* Redo the summaries as things might have changed */
- ospf6_abr_originate_summary(route);
+ ospf6_abr_originate_summary(route, oa->ospf6);
route->flag = 0;
}
}
void ospf6_intra_brouter_calculation(struct ospf6_area *oa)
{
struct ospf6_route *brouter, *nbrouter, *copy;
- void (*hook_add)(struct ospf6_route *) = NULL;
- void (*hook_remove)(struct ospf6_route *) = NULL;
+ void (*hook_add)(struct ospf6_route *, struct ospf6 *) = NULL;
+ void (*hook_remove)(struct ospf6_route *, struct ospf6 *) = 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);
+ ospf6_route_add(copy, oa->ospf6->brouter_table, oa->ospf6);
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);
+ ospf6_route_remove(brouter, oa->ospf6->brouter_table,
+ oa->ospf6);
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);
+ (*hook_add)(brouter, oa->ospf6);
} else {
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_ID(
brouter_id)
zlog_info("brouter %s still exists via area %s",
brouter_name, oa->name);
/* But re-originate summaries */
- ospf6_abr_originate_summary(brouter);
+ ospf6_abr_originate_summary(brouter, oa->ospf6);
}
if (brouter) {