int ospf_if_up (struct ospf_interface *oi) { if (oi == NULL) return 0; if (oi->type == OSPF_IFTYPE_LOOPBACK) OSPF_ISM_EVENT_SCHEDULE (oi, ISM_LoopInd); else { //struct ospf *ospf = ospf_lookup (); struct ospf *ospf = oi->ospf; if (ospf != NULL) ospf_adjust_sndbuflen_oisock (ospf, oi->ifp->mtu,oi); else ; //zlog_warn ("%s: ospf_lookup() returned NULL", __func__); ospf_if_stream_set (oi); OSPF_ISM_EVENT_SCHEDULE (oi, ISM_InterfaceUp); } if(oi->t_packet_read == NULL) oi->t_packet_read = thread_add_read (master, ospf_read_oisock, oi, oi->packet_fd); return 1; }
int ospf_if_up (struct ospf_interface *oi) { if (oi == NULL) return 0; if (oi->type == OSPF_IFTYPE_LOOPBACK) OSPF_ISM_EVENT_SCHEDULE (oi, ISM_LoopInd); else { ospf_if_stream_set (oi); OSPF_ISM_EVENT_SCHEDULE (oi, ISM_InterfaceUp); } return 1; }
int ospf_if_up (struct ospf_interface *oi) { if (oi == NULL) return 0; if (oi->type == OSPF_IFTYPE_LOOPBACK) OSPF_ISM_EVENT_SCHEDULE (oi, ISM_LoopInd); else { if (oi->type != OSPF_IFTYPE_VIRTUALLINK) ospf_if_add_allspfrouters (oi->ospf, oi->address, oi->ifp->ifindex); ospf_if_stream_set (oi); OSPF_ISM_EVENT_SCHEDULE (oi, ISM_InterfaceUp); } return 1; }
int ospf_if_up(struct ospf_interface *oi) { if (oi == NULL) return 0; if (oi->type == OSPF_IFTYPE_LOOPBACK) OSPF_ISM_EVENT_SCHEDULE(oi, ISM_LoopInd); else { struct ospf *ospf = ospf_lookup(); if (ospf != NULL) ospf_adjust_sndbuflen(ospf, oi->ifp->mtu); else zlog_warn("%s: ospf_lookup() returned NULL", __func__); ospf_if_stream_set(oi); OSPF_ISM_EVENT_SCHEDULE(oi, ISM_InterfaceUp); } return 1; }
void ospf_vl_up_check (struct ospf_area *area, struct in_addr rid, struct vertex *v) { struct ospf *ospf = area->ospf; listnode node; struct ospf_vl_data *vl_data; struct ospf_interface *oi; if (IS_DEBUG_OSPF_EVENT) { zlog_info ("ospf_vl_up_check(): Start"); zlog_info ("ospf_vl_up_check(): Router ID is %s", inet_ntoa (rid)); zlog_info ("ospf_vl_up_check(): Area is %s", inet_ntoa (area->area_id)); } for (node = listhead (ospf->vlinks); node; nextnode (node)) { if ((vl_data = getdata (node)) == NULL) continue; if (IS_DEBUG_OSPF_EVENT) { zlog_info ("ospf_vl_up_check(): considering VL, name: %s", vl_data->vl_oi->ifp->name); zlog_info ("ospf_vl_up_check(): VL area: %s, peer ID: %s", inet_ntoa (vl_data->vl_area_id), inet_ntoa (vl_data->vl_peer)); } if (IPV4_ADDR_SAME (&vl_data->vl_peer, &rid) && IPV4_ADDR_SAME (&vl_data->vl_area_id, &area->area_id)) { oi = vl_data->vl_oi; SET_FLAG (vl_data->flags, OSPF_VL_FLAG_APPROVED); if (IS_DEBUG_OSPF_EVENT) zlog_info ("ospf_vl_up_check(): this VL matched"); if (oi->state == ISM_Down) { if (IS_DEBUG_OSPF_EVENT) zlog_info ("ospf_vl_up_check(): VL is down, waking it up"); SET_FLAG (oi->ifp->flags, IFF_UP); OSPF_ISM_EVENT_SCHEDULE (oi, ISM_InterfaceUp); } ospf_vl_set_params (vl_data, v); } } }
static int ospf_wait_timer(struct thread *thread) { struct ospf_interface *oi; oi = THREAD_ARG(thread); oi->t_wait = NULL; if (IS_DEBUG_OSPF(ism, ISM_TIMERS)) zlog(NULL, LOG_DEBUG, "ISM[%s]: Timer (Wait timer expire)", IF_NAME(oi)); OSPF_ISM_EVENT_SCHEDULE(oi, ISM_WaitTimer); return 0; }