vcpe/srcs/vcpe_main.c

52 lines
916 B
C
Raw Normal View History

2022-05-10 06:43:27 +00:00
//
// Created by xajhu on 2021/6/29 0029.
//
#include <uv.h>
#include <zlog.h>
2022-05-10 06:43:27 +00:00
#include "cmdline.h"
#include "task_manager.h"
#include "init.h"
#include "user_info.h"
#include "lwip/sys.h"
#include "lwip/tcpip.h"
static void test_init(void *arg) { /* remove compiler warning */
sys_sem_t *init_sem;
init_sem = (sys_sem_t *)arg;
srand((unsigned int)time(0));
sys_sem_signal(init_sem);
}
static void lwip_init_env() {
err_t err;
sys_sem_t init_sem;
err = sys_sem_new(&init_sem, 0);
LWIP_UNUSED_ARG(err);
tcpip_init(test_init, &init_sem);
sys_sem_wait(&init_sem);
sys_sem_free(&init_sem);
}
2022-05-27 07:49:45 +00:00
2022-05-10 06:43:27 +00:00
int main(int argc, char **argv) {
uv_setup_args(argc, argv);
setvbuf(stdout, NULL, _IONBF, 0);
menu_run(argc, argv);
2022-05-27 07:49:45 +00:00
lwip_init_env();
2022-05-10 06:43:27 +00:00
user_info_init();
pppoe_session_init(NULL);
2022-05-10 06:43:27 +00:00
task_manager_run();
user_uninit();
return 0;
}