Lines Matching refs:ei

128 	struct eigrp_iface	*ei;  in if_addr_new()  local
147 TAILQ_FOREACH(ei, &iface->ei_list, i_entry) in if_addr_new()
148 if (ei->state == IF_STA_ACTIVE && ei->eigrp->af == if_addr->af) in if_addr_new()
149 eigrpe_orig_local_route(ei, if_addr, 0); in if_addr_new()
159 struct eigrp_iface *ei; in if_addr_del() local
173 TAILQ_FOREACH(ei, &iface->ei_list, i_entry) in if_addr_del()
174 if (ei->state == IF_STA_ACTIVE && ei->eigrp->af == if_addr->af) in if_addr_del()
175 eigrpe_orig_local_route(ei, if_addr, 1); in if_addr_del()
227 struct eigrp_iface *ei; in if_update() local
249 TAILQ_FOREACH(ei, &iface->ei_list, i_entry) { in if_update()
250 if (af != AF_UNSPEC && ei->eigrp->af != af) in if_update()
253 switch (ei->eigrp->af) { in if_update()
264 if (ei->state == IF_STA_DOWN) { in if_update()
267 ei->state = IF_STA_ACTIVE; in if_update()
268 eigrp_if_start(ei); in if_update()
269 } else if (ei->state == IF_STA_ACTIVE) { in if_update()
272 ei->state = IF_STA_DOWN; in if_update()
273 eigrp_if_reset(ei); in if_update()
282 struct eigrp_iface *ei; in eigrp_if_new() local
289 if ((ei = calloc(1, sizeof(*ei))) == NULL) in eigrp_if_new()
292 ei->state = IF_STA_DOWN; in eigrp_if_new()
296 ei->ifaceid = ifacecnt; in eigrp_if_new()
297 ei->eigrp = eigrp; in eigrp_if_new()
298 ei->iface = iface; in eigrp_if_new()
299 if (ei->iface->flags & IFF_LOOPBACK) in eigrp_if_new()
300 ei->passive = 1; in eigrp_if_new()
302 TAILQ_INIT(&ei->nbr_list); in eigrp_if_new()
303 TAILQ_INIT(&ei->update_list); in eigrp_if_new()
304 TAILQ_INIT(&ei->query_list); in eigrp_if_new()
305 TAILQ_INIT(&ei->summary_list); in eigrp_if_new()
306 TAILQ_INSERT_TAIL(&iface->ei_list, ei, i_entry); in eigrp_if_new()
307 TAILQ_INSERT_TAIL(&eigrp->ei_list, ei, e_entry); in eigrp_if_new()
308 if (RB_INSERT(iface_id_head, &ifaces_by_id, ei) != NULL) in eigrp_if_new()
311 return (ei); in eigrp_if_new()
315 eigrp_if_del(struct eigrp_iface *ei) in eigrp_if_del() argument
319 RB_REMOVE(iface_id_head, &ifaces_by_id, ei); in eigrp_if_del()
320 TAILQ_REMOVE(&ei->eigrp->ei_list, ei, e_entry); in eigrp_if_del()
321 TAILQ_REMOVE(&ei->iface->ei_list, ei, i_entry); in eigrp_if_del()
322 while ((summary = TAILQ_FIRST(&ei->summary_list)) != NULL) { in eigrp_if_del()
323 TAILQ_REMOVE(&ei->summary_list, summary, entry); in eigrp_if_del()
326 message_list_clr(&ei->query_list); in eigrp_if_del()
327 message_list_clr(&ei->update_list); in eigrp_if_del()
329 if (ei->state == IF_STA_ACTIVE) in eigrp_if_del()
330 eigrp_if_reset(ei); in eigrp_if_del()
332 if (TAILQ_EMPTY(&ei->iface->ei_list)) in eigrp_if_del()
333 if_del(ei->iface); in eigrp_if_del()
335 free(ei); in eigrp_if_del()
341 struct eigrp_iface *ei; in eigrp_if_lookup() local
343 TAILQ_FOREACH(ei, &iface->ei_list, i_entry) in eigrp_if_lookup()
344 if (ei->eigrp->af == af && in eigrp_if_lookup()
345 ei->eigrp->as == as) in eigrp_if_lookup()
346 return (ei); in eigrp_if_lookup()
360 eigrp_if_start(struct eigrp_iface *ei) in eigrp_if_start() argument
362 struct eigrp *eigrp = ei->eigrp; in eigrp_if_start()
367 log_debug("%s: %s as %u family %s", __func__, ei->iface->name, in eigrp_if_start()
371 ei->uptime = now.tv_sec; in eigrp_if_start()
375 ei->self = nbr_new(ei, &addr, 0, 1); in eigrp_if_start()
376 nbr_init(ei->self); in eigrp_if_start()
378 TAILQ_FOREACH(if_addr, &ei->iface->addr_list, entry) { in eigrp_if_start()
382 eigrpe_orig_local_route(ei, if_addr, 0); in eigrp_if_start()
385 if (ei->passive) in eigrp_if_start()
390 if (if_join_ipv4_group(ei->iface, &global.mcast_addr_v4)) in eigrp_if_start()
394 if (if_join_ipv6_group(ei->iface, &global.mcast_addr_v6)) in eigrp_if_start()
401 evtimer_set(&ei->hello_timer, eigrp_if_hello_timer, ei); in eigrp_if_start()
402 eigrp_if_start_hello_timer(ei); in eigrp_if_start()
406 eigrp_if_reset(struct eigrp_iface *ei) in eigrp_if_reset() argument
408 struct eigrp *eigrp = ei->eigrp; in eigrp_if_reset()
411 log_debug("%s: %s as %u family %s", __func__, ei->iface->name, in eigrp_if_reset()
416 while ((nbr = TAILQ_FIRST(&ei->nbr_list)) != NULL) in eigrp_if_reset()
419 if (ei->passive) in eigrp_if_reset()
425 if_leave_ipv4_group(ei->iface, &global.mcast_addr_v4); in eigrp_if_reset()
428 if_leave_ipv6_group(ei->iface, &global.mcast_addr_v6); in eigrp_if_reset()
434 eigrp_if_stop_hello_timer(ei); in eigrp_if_reset()
441 struct eigrp_iface *ei = arg; in eigrp_if_hello_timer() local
444 send_hello(ei, NULL, 0); in eigrp_if_hello_timer()
448 tv.tv_sec = ei->hello_interval; in eigrp_if_hello_timer()
449 if (evtimer_add(&ei->hello_timer, &tv) == -1) in eigrp_if_hello_timer()
454 eigrp_if_start_hello_timer(struct eigrp_iface *ei) in eigrp_if_start_hello_timer() argument
459 tv.tv_sec = ei->hello_interval; in eigrp_if_start_hello_timer()
460 if (evtimer_add(&ei->hello_timer, &tv) == -1) in eigrp_if_start_hello_timer()
465 eigrp_if_stop_hello_timer(struct eigrp_iface *ei) in eigrp_if_stop_hello_timer() argument
467 if (evtimer_pending(&ei->hello_timer, NULL) && in eigrp_if_stop_hello_timer()
468 evtimer_del(&ei->hello_timer) == -1) in eigrp_if_stop_hello_timer()
473 if_to_ctl(struct eigrp_iface *ei) in if_to_ctl() argument
479 ictl.af = ei->eigrp->af; in if_to_ctl()
480 ictl.as = ei->eigrp->as; in if_to_ctl()
481 memcpy(ictl.name, ei->iface->name, sizeof(ictl.name)); in if_to_ctl()
482 ictl.ifindex = ei->iface->ifindex; in if_to_ctl()
483 switch (ei->eigrp->af) { in if_to_ctl()
485 ictl.addr.v4.s_addr = if_primary_addr(ei->iface); in if_to_ctl()
486 ictl.prefixlen = if_primary_addr_prefixlen(ei->iface); in if_to_ctl()
489 ictl.addr.v6 = ei->iface->linklocal; in if_to_ctl()
490 if (!IN6_IS_ADDR_UNSPECIFIED(&ei->iface->linklocal)) in if_to_ctl()
498 ictl.flags = ei->iface->flags; in if_to_ctl()
499 ictl.linkstate = ei->iface->linkstate; in if_to_ctl()
500 ictl.mtu = ei->iface->mtu; in if_to_ctl()
501 ictl.type = ei->iface->type; in if_to_ctl()
502 ictl.if_type = ei->iface->if_type; in if_to_ctl()
503 ictl.baudrate = ei->iface->baudrate; in if_to_ctl()
504 ictl.delay = ei->delay; in if_to_ctl()
505 ictl.bandwidth = ei->bandwidth; in if_to_ctl()
506 ictl.hello_holdtime = ei->hello_holdtime; in if_to_ctl()
507 ictl.hello_interval = ei->hello_interval; in if_to_ctl()
508 ictl.splithorizon = ei->splithorizon; in if_to_ctl()
509 ictl.passive = ei->passive; in if_to_ctl()
513 if (ei->state != IF_STA_DOWN && ei->uptime != 0) in if_to_ctl()
514 ictl.uptime = now.tv_sec - ei->uptime; in if_to_ctl()
518 TAILQ_FOREACH(nbr, &ei->nbr_list, entry) in if_to_ctl()