void set_default_output_ifaces()
{

    default_out_iface_v4 = get_any_output_iface(AF_INET);

    if (default_out_iface_v4 != NULL) {
       lispd_log_msg(LISP_LOG_DEBUG_2,"Default IPv4 iface %s\n",default_out_iface_v4->iface_name);
#ifdef ROUTER
       set_tun_default_route_v4();
#endif
    }
    
    default_out_iface_v6 = get_any_output_iface(AF_INET6);
    if (default_out_iface_v6 != NULL) {
       lispd_log_msg(LISP_LOG_DEBUG_2,"Default IPv6 iface %s\n",default_out_iface_v6->iface_name);
#ifdef ROUTER
       // For IPv6, the route is not updated and should be removed before adding the new one
       del_tun_default_route_v6();
       set_tun_default_route_v6();
#endif
    }

    if (!default_out_iface_v4 && !default_out_iface_v6){
        lispd_log_msg(LISP_LOG_CRIT,"NO OUTPUT IFACE: all the locators are down");
    }
}
void set_default_ctrl_ifaces()
{
    default_ctrl_iface_v4 = get_any_output_iface(AF_INET);

    if (default_ctrl_iface_v4 != NULL) {
       lispd_log_msg(LISP_LOG_DEBUG_2,"Default IPv4 control iface %s: %s\n",
               default_ctrl_iface_v4->iface_name, get_char_from_lisp_addr_t(*(default_ctrl_iface_v4->ipv4_address)));
    }

    default_ctrl_iface_v6 = get_any_output_iface(AF_INET6);
    if (default_ctrl_iface_v6 != NULL) {
        lispd_log_msg(LISP_LOG_DEBUG_2,"Default IPv6 control iface %s: %s\n",
                default_ctrl_iface_v6->iface_name, get_char_from_lisp_addr_t(*(default_ctrl_iface_v6->ipv6_address)));
    }

    // XXX alopez If no output interface found exit --> To be modified when iface management implemented
    if (!default_ctrl_iface_v4 && !default_ctrl_iface_v6){
        lispd_log_msg(LISP_LOG_ERR,"NO CONTROL IFACE: all the locators are down");
    }
}
Exemple #3
0
lisp_addr_t *
vpnapi_control_dp_get_default_addr(oor_ctrl_t *ctrl, int afi)
{
    iface_t *iface;
    lisp_addr_t *addr = NULL;

    iface = get_any_output_iface(afi);
    if (iface != NULL){
        addr = iface_address(iface, afi);
    }

    return (addr);
}