unsigned char conf_debug_ospf6_abr;
-int ospf6_is_router_abr(struct ospf6 *o)
+bool ospf6_check_and_set_router_abr(struct ospf6 *o)
{
struct listnode *node;
struct ospf6_area *oa;
if (IS_OSPF6_DEBUG_ABR)
zlog_debug("%s : set flag OSPF6_FLAG_ABR", __func__);
SET_FLAG(o->flag, OSPF6_FLAG_ABR);
- return 1;
+ return true;
} else {
if (IS_OSPF6_DEBUG_ABR)
zlog_debug("%s : reset flag OSPF6_FLAG_ABR", __func__);
UNSET_FLAG(o->flag, OSPF6_FLAG_ABR);
- return 0;
+ return false;
}
}
struct ospf6_route *route;
/* if not a ABR return success */
- if (!ospf6_is_router_abr(oa->ospf6))
+ if (!ospf6_check_and_set_router_abr(oa->ospf6))
return;
/* Redo summaries if required */
#define OSPF6_ABR_RANGE_CLEAR_COST(range) (range->path.cost = OSPF_AREA_RANGE_COST_UNSPEC)
#define IS_OSPF6_ABR(o) ((o)->flag & OSPF6_FLAG_ABR)
-extern int ospf6_is_router_abr(struct ospf6 *o);
+extern bool ospf6_check_and_set_router_abr(struct ospf6 *o);
extern void ospf6_abr_enable_area(struct ospf6_area *oa);
extern void ospf6_abr_disable_area(struct ospf6_area *oa);
ospf6_route_add(range, oa->range_table);
}
- if (ospf6_is_router_abr(ospf6)) {
+ if (ospf6_check_and_set_router_abr(ospf6)) {
/* Redo summaries if required */
ospf6_abr_prefix_resummarize(ospf6);
}
return CMD_SUCCESS;
}
- if (ospf6_is_router_abr(oa->ospf6)) {
+ if (ospf6_check_and_set_router_abr(oa->ospf6)) {
/* Blow away the aggregated LSA and route */
SET_FLAG(range->flag, OSPF6_ROUTE_REMOVE);
zlog_debug("%s: Withdraw AS-External route for %s",
__func__, lsa->name);
- if (ospf6_is_router_abr(ospf6))
+ if (ospf6_check_and_set_router_abr(ospf6))
oa = ospf6->backbone;
else
oa = listgetdata(listhead(ospf6->area_list));
OSPF6_OPT_CLEAR_ALL(router_lsa->options);
memcpy(router_lsa->options, oa->options, 3);
- if (ospf6_is_router_abr(oa->ospf6))
+ if (ospf6_check_and_set_router_abr(oa->ospf6))
SET_FLAG(router_lsa->bits, OSPF6_ROUTER_BIT_B);
else
UNSET_FLAG(router_lsa->bits, OSPF6_ROUTER_BIT_B);
if (IS_OSPF6_DEBUG_ABR)
zlog_debug("Running ABR task on timer");
- ospf6_is_router_abr(ospf6);
+ (void)ospf6_check_and_set_router_abr(ospf6);
ospf6_abr_nssa_check_status(ospf6);
ospf6_abr_task(ospf6);
/* if nssa-abr, then scan Type-7 LSDB */
SET_FLAG(lsa->flag, OSPF6_LSA_FLUSH);
ospf6_flood(NULL, lsa);
/* Flush the translated LSA */
- if (ospf6_is_router_abr(ospf6)) {
+ if (ospf6_check_and_set_router_abr(ospf6)) {
type = htons(OSPF6_LSTYPE_AS_EXTERNAL);
type5 = ospf6_lsdb_lookup(
htons(type), lsa->external_lsa_id,
struct ospf6_route *route;
if (IS_AREA_NSSA(area)) {
- if (!ospf6_is_router_abr(area->ospf6))
+ if (!ospf6_check_and_set_router_abr(area->ospf6))
OSPF6_OPT_CLEAR(area->options, OSPF6_OPT_E);
area->ospf6->anyNSSA++;
OSPF6_OPT_SET(area->options, OSPF6_OPT_N);
if (IS_OSPF6_DEBUG_ORIGINATE(ROUTER))
zlog_debug("Normal area for if %s", area->name);
OSPF6_OPT_CLEAR(area->options, OSPF6_OPT_N);
- if (ospf6_is_router_abr(area->ospf6))
+ if (ospf6_check_and_set_router_abr(area->ospf6))
OSPF6_OPT_SET(area->options, OSPF6_OPT_E);
area->ospf6->anyNSSA--;
area->NSSATranslatorState = OSPF6_NSSA_TRANSLATE_DISABLED;
OSPF6_ROUTER_LSA_SCHEDULE(area);
/* Check if router is ABR */
- if (ospf6_is_router_abr(area->ospf6)) {
+ if (ospf6_check_and_set_router_abr(area->ospf6)) {
if (IS_OSPF6_DEBUG_NSSA)
zlog_debug("Router is ABR area %s", area->name);
ospf6_schedule_abr_task(area->ospf6);
lsa->external_lsa_id, ospf6->router_id,
ospf6->lsdb);
- if (ospf6_is_router_abr(ospf6) && (type5 == NULL)) {
+ if (ospf6_check_and_set_router_abr(ospf6) && (type5 == NULL)) {
if (IS_OSPF6_DEBUG_NSSA)
zlog_debug("%s : Originating type5 LSA", __func__);
ospf6_lsa_translated_nssa_new(area, lsa);
return SNMP_INTEGER(3);
case OSPFv3AREABDRRTRSTATUS:
if (ospf6)
- return SNMP_INTEGER(ospf6_is_router_abr(ospf6)
- ? SNMP_TRUE
- : SNMP_FALSE);
+ return SNMP_INTEGER(
+ ospf6_check_and_set_router_abr(ospf6)
+ ? SNMP_TRUE
+ : SNMP_FALSE);
return SNMP_INTEGER(SNMP_FALSE);
case OSPFv3ASBDRRTRSTATUS:
if (ospf6)
monotime(&start);
ospf6->ts_spf = start;
- if (ospf6_is_router_abr(ospf6))
+ if (ospf6_check_and_set_router_abr(ospf6))
ospf6_abr_range_reset_cost(ospf6);
for (ALL_LIST_ELEMENTS_RO(ospf6->area_list, node, oa)) {
/* External LSA calculation */
ospf6_ase_calculate_timer_add(ospf6);
- if (ospf6_is_router_abr(ospf6))
+ if (ospf6_check_and_set_router_abr(ospf6))
ospf6_abr_defaults_to_stub(ospf6);
monotime(&end);
ospf6_interface_enable(oi);
/* If the router is ABR, originate summary routes */
- if (ospf6_is_router_abr(ospf6)) {
+ if (ospf6_check_and_set_router_abr(ospf6)) {
ospf6_abr_enable_area(oa);
ospf6_schedule_abr_task(oa->ospf6);
}