Example #1
0
File: oor.c Project: biels/oor
JNIEXPORT void JNICALL Java_org_openoverlayrouter_noroot_OOR_1JNI_oor_1loop(JNIEnv * env, jclass cl)
{
    oor_running = TRUE;
    ctrl_dev_run(ctrl_dev);

    /* EVENT LOOP */
    while (oor_running) {
        sockmstr_wait_on_all_read(smaster);
        sockmstr_process_all(smaster);
    }
    /* event_loop returned: bad! */
    exit_cleanup();
}
Example #2
0
JNIEXPORT void JNICALL Java_org_lispmob_noroot_LISPmob_1JNI_lispd_1loop(JNIEnv * env, jclass cl)
{
    lispd_running = TRUE;
    ctrl_dev_run(ctrl_dev);

    /* EVENT LOOP */
    while (lispd_running) {
        sockmstr_wait_on_all_read(smaster);
        sockmstr_process_all(smaster);
    }

    /* event_loop returned: bad! */
    LMLOG(LINF, "Exiting...");
    exit_cleanup();
}
Example #3
0
File: oor.c Project: biels/oor
int
main(int argc, char **argv)
{
    oor_dev_type_e dev_type;
    lisp_xtr_t *tunnel_router;

    initial_setup();

    handle_oor_command_line(argc, argv);

    /* see if we need to daemonize, and if so, do it */
    demonize_start();

    /* create socket master, timer wheel, initialize interfaces */
    smaster = sockmstr_create();
    oor_timers_init();
    ifaces_init();

    /* create control. Only one instance for now */
    if ((lctrl = ctrl_create())==NULL){
        exit_cleanup();
    }

    /* Detect the data plane type */
    data_plane_select();

    /* parse config and create ctrl_dev */
    if (parse_config_file() != GOOD){
        exit_cleanup();
    }


    dev_type = ctrl_dev_mode(ctrl_dev);
    if (dev_type == xTR_MODE || dev_type == RTR_MODE || dev_type == MN_MODE) {
        OOR_LOG(LDBG_2, "Configuring data plane");
        tunnel_router = CONTAINER_OF(ctrl_dev, lisp_xtr_t, super);
        if (data_plane->datap_init(dev_type,tr_get_encap_type(tunnel_router))!=GOOD){
            exit_cleanup();
        }
        OOR_LOG(LDBG_1, "Data plane initialized");
    }

    /* The control should be initialized after data plane */
    ctrl_init(lctrl);
    init_netlink();

    /* run lisp control device xtr/ms */
    if (!ctrl_dev) {
        OOR_LOG(LDBG_1, "device NULL");
        exit(0);
    }

    ctrl_dev_run(ctrl_dev);

    OOR_LOG(LINF,"\n\n Open Overlay Router (%s): started... \n\n",OOR_VERSION);

#ifndef ANDROID
    /* Initialize API for external access */
    oor_api_init_server(&oor_api_connection);

    for (;;) {
        sockmstr_wait_on_all_read(smaster);
        sockmstr_process_all(smaster);
        oor_api_loop(&oor_api_connection);
    }
#else
    for (;;) {
        sockmstr_wait_on_all_read(smaster);
        sockmstr_process_all(smaster);
    }
#endif

    /* event_loop returned: bad! */
    OOR_LOG(LINF, "Exiting...");
    exit_cleanup();
    return(0);
}
Example #4
0
int
main(int argc, char **argv)
{
    lisp_dev_type_e dev_type;

    initial_setup();

    handle_lispd_command_line(argc, argv);

    /* see if we need to daemonize, and if so, do it */
    demonize_start();

    /* create socket master, timer wheel, initialize interfaces */
    smaster = sockmstr_create();
    lmtimers_init();
    ifaces_init();

    /* create control. Only one instance for now */
    if ((lctrl = ctrl_create())==NULL){
        exit_cleanup();
    }

    /* Detect the data plane type */
    data_plane_select();

    /* parse config and create ctrl_dev */
    if (parse_config_file() != GOOD){
        exit_cleanup();
    }


    dev_type = ctrl_dev_mode(ctrl_dev);
    if (dev_type == xTR_MODE || dev_type == RTR_MODE || dev_type == MN_MODE) {
        data_plane->datap_init(dev_type);
    }

    ctrl_init(lctrl);
    init_netlink();

    /* run lisp control device xtr/ms */
    if (!ctrl_dev) {
        LMLOG(LDBG_1, "device NULL");
        exit(0);
    }
    ctrl_dev_run(ctrl_dev);

    LMLOG(LINF,"\n\n LISPmob (%s): 'lispd' started... \n\n",LISPD_VERSION);

#ifndef ANDROID
    /* Initialize API for external access */
    lmapi_init_server(&lmapi_connection);

    for (;;) {
        sockmstr_wait_on_all_read(smaster);
        sockmstr_process_all(smaster);
        lmapi_loop(&lmapi_connection);
    }
#else
    for (;;) {
        sockmstr_wait_on_all_read(smaster);
        sockmstr_process_all(smaster);
    }
#endif



    /* EVENT LOOP */
    for (;;) {
        sockmstr_wait_on_all_read(smaster);
        sockmstr_process_all(smaster);
#ifndef ANDROID
        lmapi_loop(&lmapi_connection);
#endif
    }

    /* event_loop returned: bad! */
    LMLOG(LINF, "Exiting...");
    exit_cleanup();
    return(0);
}