rename config -> options

This commit is contained in:
luwenpeng
2024-03-08 14:51:21 +08:00
parent d0914483bb
commit 734f6a5135
32 changed files with 336 additions and 336 deletions

View File

@@ -48,10 +48,10 @@ struct stellar_context stellar_context;
struct stellar_context *stellar_ctx = &stellar_context;
// config
struct device_config *dev_cfg = &stellar_context.config.dev_cfg;
struct packet_io_config *pkt_io_cfg = &stellar_context.config.pkt_io_cfg;
struct ip_reassembly_config *ip_reass_cfg = &stellar_context.config.ip_reass_cfg;
struct session_manager_config *sess_mgr_cfg = &stellar_context.config.sess_mgr_cfg;
struct device_options *dev_opts = &stellar_context.config.dev_opts;
struct packet_io_options *pkt_io_opts = &stellar_context.config.pkt_io_opts;
struct ip_reassembly_options *ip_reass_opts = &stellar_context.config.ip_reass_opts;
struct session_manager_options *sess_mgr_opts = &stellar_context.config.sess_mgr_opts;
static const char *log_config_file = "./conf/log.toml";
static const char *stellar_config_file = "./conf/stellar.toml";
@@ -207,14 +207,14 @@ static int thread_context_init(struct stellar_context *ctx, uint8_t nr_threads)
threads_ctx->need_exit = 0;
threads_ctx->is_runing = 0;
threads_ctx->sess_mgr = session_manager_new(sess_mgr_cfg);
threads_ctx->sess_mgr = session_manager_new(sess_mgr_opts);
if (threads_ctx->sess_mgr == NULL)
{
STELLAR_LOG_ERROR("unable to create session manager");
return -1;
}
threads_ctx->ip_mgr = ip_reassembly_new(ip_reass_cfg);
threads_ctx->ip_mgr = ip_reassembly_new(ip_reass_opts);
if (threads_ctx->ip_mgr == NULL)
{
STELLAR_LOG_ERROR("unable to create ip reassemble manager");
@@ -298,7 +298,7 @@ int main(int argc, char **argv)
config_dump(&stellar_ctx->config);
if (id_generator_init(dev_cfg->device_base, dev_cfg->device_offset) != 0)
if (id_generator_init(dev_opts->device_base, dev_opts->device_offset) != 0)
{
STELLAR_LOG_ERROR("unable to init id generator");
return -1;
@@ -306,8 +306,8 @@ int main(int argc, char **argv)
// TODO load plugin
uint8_t nr_threads = pkt_io_cfg->nr_threads;
stellar_ctx->packet_io = packet_io_new(pkt_io_cfg);
uint8_t nr_threads = pkt_io_opts->nr_threads;
stellar_ctx->packet_io = packet_io_new(pkt_io_opts);
if (stellar_ctx->packet_io == NULL)
{
STELLAR_LOG_ERROR("unable to create packet io");