[PAKCET_IO] framework intermediate state

This commit is contained in:
liuwentan
2022-07-28 15:12:46 +08:00
parent 82a97ff067
commit 7ae4ca2e2a
22 changed files with 986 additions and 273 deletions

0
src/common/common.h Normal file
View File

13
src/common/global_var.cpp Normal file
View File

@@ -0,0 +1,13 @@
/*
**********************************************************************************************
* File: global_var.cpp
* Description:
* Authors: Liu WenTan <liuwentan@geedgenetworks.com>
* Date: 2022-07-15
* Copyright: (c) 2018-2022 Geedge Networks, Inc. All rights reserved.
***********************************************************************************************
*/
#include "global_var.h"
struct stellar_engine g_engine_instance;

63
src/common/global_var.h Normal file
View File

@@ -0,0 +1,63 @@
/*
**********************************************************************************************
* File: global_var.h
* Description: global variable and data structure
* Authors: Liu WenTan <liuwentan@geedgenetworks.com>
* Date: 2022-07-15
* Copyright: (c) 2018-2022 Geedge Networks, Inc. All rights reserved.
***********************************************************************************************
*/
#pragma once
#include <limits.h>
#include <stdint.h>
#define DEV_MAX_CNT 16
enum packet_io_run_mode {
PACKET_IO_RUN_MODE_PCAP_FILE,
PACKET_IO_RUN_MODE_PCAP_LIVE,
PACKET_IO_RUN_MODE_MARSIO,
PACKET_IO_RUN_MODE_MAX,
};
struct cpu_config {};
struct mem_config {};
struct system_config {
char instance_name[NAME_MAX];
};
/* store packet_io config */
struct packet_io_config {
/* packet_io run mode */
enum packet_io_run_mode mode;
/* worker thread num */
uint32_t thread_num;
/* device name list */
char dev_name[DEV_MAX_CNT][NAME_MAX];
/* device counts */
uint32_t dev_cnt;
};
struct lib_config {
const char *libmarsio_path;
};
struct stellar_config {
struct cpu_config cpu;
struct mem_config mem;
struct system_config system;
struct packet_io_config packet_io;
struct lib_config lib;
};
struct stellar_engine {
struct stellar_config config;
};
extern struct stellar_engine g_engine_instance;