DEFINE_HOOK(ospf_ism_change,
(struct ospf_interface * oi, int state, int oldstate),
- (oi, state, oldstate))
+ (oi, state, oldstate));
/* elect DR and BDR. Refer to RFC2319 section 9.4 */
static struct ospf_neighbor *ospf_dr_election_sub(struct list *routers)
}
}
-static int ospf_dr_election(struct ospf_interface *oi)
+int ospf_dr_election(struct ospf_interface *oi)
{
struct in_addr old_dr, old_bdr;
int old_state, new_state;
new_state = ospf_ism_state(oi);
- zlog_debug("DR-Election[1st]: Backup %s", inet_ntoa(BDR(oi)));
- zlog_debug("DR-Election[1st]: DR %s", inet_ntoa(DR(oi)));
+ zlog_debug("DR-Election[1st]: Backup %pI4", &BDR(oi));
+ zlog_debug("DR-Election[1st]: DR %pI4", &DR(oi));
if (new_state != old_state
&& !(new_state == ISM_DROther && old_state < ISM_DROther)) {
new_state = ospf_ism_state(oi);
- zlog_debug("DR-Election[2nd]: Backup %s", inet_ntoa(BDR(oi)));
- zlog_debug("DR-Election[2nd]: DR %s", inet_ntoa(DR(oi)));
+ zlog_debug("DR-Election[2nd]: Backup %pI4", &BDR(oi));
+ zlog_debug("DR-Election[2nd]: DR %pI4", &DR(oi));
}
list_delete(&el_list);
}
-int ospf_hello_timer(struct thread *thread)
+void ospf_hello_timer(struct thread *thread)
{
struct ospf_interface *oi;
/* Hello timer set. */
OSPF_HELLO_TIMER_ON(oi);
-
- return 0;
}
-static int ospf_wait_timer(struct thread *thread)
+static void ospf_wait_timer(struct thread *thread)
{
struct ospf_interface *oi;
zlog_debug("ISM[%s]: Timer (Wait timer expire)", IF_NAME(oi));
OSPF_ISM_EVENT_SCHEDULE(oi, ISM_WaitTimer);
-
- return 0;
}
/* Hook function called after ospf ISM event is occurred. And vty's
}
/* Execute ISM event process. */
-int ospf_ism_event(struct thread *thread)
+void ospf_ism_event(struct thread *thread)
{
int event;
int next_state;
/* Make sure timer is set. */
ism_timer_set(oi);
-
- return 0;
}