2020-06-11 17:57:18 +08:00
|
|
|
#include <MESA/MESA_prof_load.h>
|
2023-03-30 19:39:18 +08:00
|
|
|
#include <MESA/maat.h>
|
2020-08-10 18:13:44 +08:00
|
|
|
#include <cjson/cJSON.h>
|
|
|
|
|
#include <tfe_kafka_logger.h>
|
|
|
|
|
#include <tfe_proxy.h>
|
|
|
|
|
#include <tfe_resource.h>
|
2020-06-11 17:57:18 +08:00
|
|
|
|
|
|
|
|
#define MAAT_INPUT_JSON 0
|
|
|
|
|
#define MAAT_INPUT_REDIS 1
|
|
|
|
|
#define MAAT_INPUT_FILE 2
|
|
|
|
|
|
2020-07-15 11:30:11 +08:00
|
|
|
struct maat_table_info
|
|
|
|
|
{
|
|
|
|
|
int id;
|
2020-08-10 18:13:44 +08:00
|
|
|
const char *name;
|
2020-07-15 11:30:11 +08:00
|
|
|
};
|
2020-10-23 19:03:08 +08:00
|
|
|
|
2023-03-30 19:39:18 +08:00
|
|
|
static struct maat *static_maat = NULL;
|
2020-06-24 16:40:53 +08:00
|
|
|
static tfe_kafka_logger_t *kafka_logger = NULL;
|
|
|
|
|
static char *device_id = NULL;
|
2021-10-18 18:29:10 +08:00
|
|
|
static char *effective_device_tag=NULL;
|
2020-06-11 17:57:18 +08:00
|
|
|
|
2023-03-30 19:39:18 +08:00
|
|
|
static struct maat *create_maat_feather(const char *instance_name, const char *profile, const char *section, int max_thread, void *logger)
|
2020-06-11 17:57:18 +08:00
|
|
|
{
|
2023-03-30 19:39:18 +08:00
|
|
|
struct maat *target=NULL;
|
2020-06-11 17:57:18 +08:00
|
|
|
int input_mode = 0, maat_stat_on = 0, maat_perf_on = 0;
|
2023-03-30 19:39:18 +08:00
|
|
|
int ret = 0, effect_interval = 60, log_level=0;
|
2020-06-11 17:57:18 +08:00
|
|
|
char table_info[TFE_STRING_MAX] = {0}, inc_cfg_dir[TFE_STRING_MAX] = {0}, ful_cfg_dir[TFE_STRING_MAX] = {0};
|
|
|
|
|
char redis_server[TFE_STRING_MAX] = {0};
|
|
|
|
|
char redis_port_range[TFE_STRING_MAX] = {0};
|
|
|
|
|
char accept_tags[TFE_STRING_MAX] = {0};
|
2020-08-10 18:13:44 +08:00
|
|
|
char accept_path[TFE_PATH_MAX] = {0};
|
2020-06-11 17:57:18 +08:00
|
|
|
int redis_port_begin = 0, redis_port_end = 0;
|
|
|
|
|
int redis_port_select = 0;
|
|
|
|
|
int redis_db_idx = 0;
|
2020-07-15 11:30:11 +08:00
|
|
|
int deferred_load_on = 0;
|
2020-06-11 17:57:18 +08:00
|
|
|
char json_cfg_file[TFE_STRING_MAX] = {0}, maat_stat_file[TFE_STRING_MAX] = {0};
|
|
|
|
|
|
|
|
|
|
MESA_load_profile_int_def(profile, section, "maat_input_mode", &(input_mode), 0);
|
|
|
|
|
MESA_load_profile_int_def(profile, section, "stat_switch", &(maat_stat_on), 1);
|
|
|
|
|
MESA_load_profile_int_def(profile, section, "perf_switch", &(maat_perf_on), 1);
|
|
|
|
|
MESA_load_profile_string_def(profile, section, "table_info", table_info, sizeof(table_info), "");
|
2020-07-24 18:53:07 +08:00
|
|
|
MESA_load_profile_string_def(profile, section, "accept_path", accept_path, sizeof(accept_path), "");
|
2020-06-11 17:57:18 +08:00
|
|
|
MESA_load_profile_string_def(profile, section, "json_cfg_file", json_cfg_file, sizeof(json_cfg_file), "");
|
|
|
|
|
MESA_load_profile_string_def(profile, section, "maat_redis_server", redis_server, sizeof(redis_server), "");
|
|
|
|
|
MESA_load_profile_string_def(profile, section, "maat_redis_port_range", redis_port_range, sizeof(redis_server), "6379");
|
|
|
|
|
MESA_load_profile_int_def(profile, section, "maat_redis_db_index", &(redis_db_idx), 0);
|
|
|
|
|
MESA_load_profile_string_def(profile, section, "inc_cfg_dir", inc_cfg_dir, sizeof(inc_cfg_dir), "");
|
|
|
|
|
MESA_load_profile_string_def(profile, section, "full_cfg_dir", ful_cfg_dir, sizeof(ful_cfg_dir), "");
|
|
|
|
|
MESA_load_profile_string_def(profile, section, "stat_file", maat_stat_file, sizeof(maat_stat_file), "");
|
|
|
|
|
MESA_load_profile_int_def(profile, section, "effect_interval_s", &(effect_interval), 60);
|
2020-07-15 11:30:11 +08:00
|
|
|
MESA_load_profile_int_def(profile, section, "deferred_load_on", &(deferred_load_on), 0);
|
2023-03-30 19:39:18 +08:00
|
|
|
MESA_load_profile_int_def(profile, section, "log_level", &(log_level), LOG_LEVEL_FATAL);
|
2020-06-11 17:57:18 +08:00
|
|
|
|
|
|
|
|
effect_interval *= 1000; //convert s to ms
|
|
|
|
|
|
2023-03-30 19:39:18 +08:00
|
|
|
struct maat_options *opts = maat_options_new();
|
|
|
|
|
maat_options_set_logger(opts, "log/maat.log", (enum log_level)log_level);
|
|
|
|
|
maat_options_set_instance_name(opts, instance_name);
|
|
|
|
|
maat_options_set_caller_thread_number(opts, max_thread);
|
2020-06-11 17:57:18 +08:00
|
|
|
switch (input_mode)
|
|
|
|
|
{
|
|
|
|
|
case MAAT_INPUT_JSON:
|
|
|
|
|
if (!strlen(json_cfg_file))
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(logger, "Invalid json_cfg_file, MAAT init failed.");
|
|
|
|
|
goto error_out;
|
|
|
|
|
}
|
2023-03-30 19:39:18 +08:00
|
|
|
maat_options_set_json_file(opts, json_cfg_file);
|
2020-06-11 17:57:18 +08:00
|
|
|
break;
|
|
|
|
|
case MAAT_INPUT_REDIS:
|
|
|
|
|
if (!strlen(redis_server))
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(logger, "Invalid maat_redis_server, MAAT init failed.");
|
|
|
|
|
goto error_out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ret = sscanf(redis_port_range, "%d-%d", &redis_port_begin, &redis_port_end);
|
|
|
|
|
if (ret == 1)
|
|
|
|
|
{
|
|
|
|
|
redis_port_select = redis_port_begin;
|
|
|
|
|
}
|
|
|
|
|
else if (ret == 2)
|
|
|
|
|
{
|
|
|
|
|
srand(time(NULL));
|
|
|
|
|
redis_port_select = redis_port_begin + rand() % (redis_port_end - redis_port_begin);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(logger, "Invalid redis port range %s, MAAT init failed.", redis_port_range);
|
|
|
|
|
|
|
|
|
|
goto error_out;
|
|
|
|
|
}
|
2023-03-30 19:39:18 +08:00
|
|
|
maat_options_set_redis(opts, redis_server, redis_port_select, redis_db_idx);
|
2020-06-11 17:57:18 +08:00
|
|
|
break;
|
|
|
|
|
case MAAT_INPUT_FILE:
|
|
|
|
|
if (!strlen(ful_cfg_dir))
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(logger, "Invalid ful_cfg_dir, MAAT init failed.");
|
|
|
|
|
goto error_out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!strlen(inc_cfg_dir))
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(logger, "Invalid inc_cfg_dir, MAAT init failed.");
|
|
|
|
|
goto error_out;
|
|
|
|
|
}
|
2023-03-30 19:39:18 +08:00
|
|
|
maat_options_set_iris(opts, ful_cfg_dir, inc_cfg_dir);
|
2020-06-11 17:57:18 +08:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
TFE_LOG_ERROR(logger, "Invalid MAAT Input Mode: %d.", input_mode);
|
|
|
|
|
goto error_out;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2023-03-30 19:39:18 +08:00
|
|
|
maat_options_set_foreign_cont_dir(opts, "./pangu_files");
|
|
|
|
|
if (maat_stat_on)
|
|
|
|
|
{
|
|
|
|
|
maat_options_set_stat_on(opts);
|
|
|
|
|
if (maat_perf_on)
|
|
|
|
|
{
|
|
|
|
|
maat_options_set_perf_on(opts);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-06-11 17:57:18 +08:00
|
|
|
|
2020-09-17 11:27:15 +08:00
|
|
|
if (deferred_load_on)
|
|
|
|
|
{
|
2023-03-30 19:39:18 +08:00
|
|
|
maat_options_set_deferred_load_on(opts);
|
2020-09-17 11:27:15 +08:00
|
|
|
}
|
2023-03-30 19:39:18 +08:00
|
|
|
|
|
|
|
|
maat_options_set_rule_effect_interval_ms(opts, effect_interval);
|
2020-07-24 18:53:07 +08:00
|
|
|
if (strlen(accept_path) > 0)
|
2020-06-11 17:57:18 +08:00
|
|
|
{
|
2020-08-10 18:13:44 +08:00
|
|
|
MESA_load_profile_string_def(accept_path, "maat", "ACCEPT_TAGS", accept_tags, sizeof(accept_tags), "{\"tags\":[{\"tag\":\"device_id\",\"value\":\"device_1\"}]}");
|
2023-03-30 19:39:18 +08:00
|
|
|
maat_options_set_accept_tags(opts, accept_tags);
|
2020-08-10 18:13:44 +08:00
|
|
|
TFE_LOG_INFO(logger, "tfe accept tags : %s", accept_tags);
|
2020-06-11 17:57:18 +08:00
|
|
|
}
|
|
|
|
|
|
2023-03-30 19:39:18 +08:00
|
|
|
target = maat_new(opts, table_info);
|
|
|
|
|
if (!target)
|
2020-06-11 17:57:18 +08:00
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(logger, "%s MAAT init failed.", __FUNCTION__);
|
|
|
|
|
goto error_out;
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-30 19:39:18 +08:00
|
|
|
maat_options_free(opts);
|
|
|
|
|
return target;
|
2020-06-11 17:57:18 +08:00
|
|
|
error_out:
|
2023-03-30 19:39:18 +08:00
|
|
|
maat_options_free(opts);
|
2020-06-11 17:57:18 +08:00
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-24 16:40:53 +08:00
|
|
|
static tfe_kafka_logger_t *create_kafka_logger(const char *profile, const char *section, void *logger)
|
|
|
|
|
{
|
2022-09-23 15:34:50 +08:00
|
|
|
int enable = 0, vsystem_id = 0;
|
2022-09-09 10:44:11 +08:00
|
|
|
char nic_name[TFE_SYMBOL_MAX] = {0};
|
2020-06-24 16:40:53 +08:00
|
|
|
char brokerlist[TFE_STRING_MAX] = {0};
|
|
|
|
|
char topic_name[TFE_STRING_MAX] = {0};
|
2021-08-19 16:24:19 +08:00
|
|
|
char sasl_username[TFE_STRING_MAX] = {0};
|
|
|
|
|
char sasl_passwd[TFE_STRING_MAX] = {0};
|
2020-06-24 16:40:53 +08:00
|
|
|
tfe_kafka_logger_t *kafka_logger = NULL;
|
|
|
|
|
|
|
|
|
|
MESA_load_profile_int_def(profile, section, "enable", &enable, 1);
|
2022-09-23 15:34:50 +08:00
|
|
|
MESA_load_profile_int_def(profile, section, "VSYSTEM_ID", &vsystem_id, 1);
|
2020-06-24 16:40:53 +08:00
|
|
|
MESA_load_profile_string_def(profile, section, "NIC_NAME", nic_name, sizeof(nic_name), "eth0");
|
|
|
|
|
MESA_load_profile_string_def(profile, section, "KAFKA_BROKERLIST", brokerlist, sizeof(brokerlist), "");
|
|
|
|
|
MESA_load_profile_string_def(profile, section, "KAFKA_TOPIC", topic_name, sizeof(topic_name), "POLICY-EVENT-LOG");
|
2021-08-19 16:24:19 +08:00
|
|
|
MESA_load_profile_string_def(profile, section, "SASL_USERNAME", sasl_username, sizeof(sasl_username), "");
|
|
|
|
|
MESA_load_profile_string_def(profile, section, "SASL_PASSWD", sasl_passwd, sizeof(sasl_passwd), "");
|
2020-06-24 16:40:53 +08:00
|
|
|
|
|
|
|
|
if (!strlen(brokerlist))
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(logger, "tfe kafka init failed, no brokerlist in profile %s section %s.", profile, section);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-19 16:24:19 +08:00
|
|
|
kafka_logger = tfe_kafka_logger_create(enable, nic_name, brokerlist, topic_name, sasl_username, sasl_passwd, logger);
|
2020-06-24 16:40:53 +08:00
|
|
|
if (kafka_logger == NULL)
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(logger, "tfe kafka init failed, error to create kafka logger.");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2022-10-26 14:30:45 +08:00
|
|
|
kafka_logger->t_vsys_id=vsystem_id;
|
2020-06-24 16:40:53 +08:00
|
|
|
|
|
|
|
|
TFE_LOG_INFO(logger, "tfe kafka logger : %s", enable ? "ENABLE" : "DISABLE");
|
2022-09-23 15:34:50 +08:00
|
|
|
TFE_LOG_INFO(logger, "tfe kafka vsystem id : %d", vsystem_id);
|
2020-06-24 16:40:53 +08:00
|
|
|
TFE_LOG_INFO(logger, "tfe kafka topic : %s", topic_name);
|
|
|
|
|
TFE_LOG_INFO(logger, "tfe kafka brokerlist : %s", brokerlist);
|
|
|
|
|
|
2021-08-19 16:24:19 +08:00
|
|
|
if (strlen(sasl_username) > 0 && strlen(sasl_passwd) > 0)
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_INFO(logger, "tfe kafka sasl_username : %s", sasl_username);
|
|
|
|
|
TFE_LOG_INFO(logger, "tfe kafka sasl_passwd : %s", sasl_passwd);
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-24 16:40:53 +08:00
|
|
|
return kafka_logger;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static char *cerate_device_id(const char *profile, const char *section, void *logger)
|
|
|
|
|
{
|
|
|
|
|
int ret = -1;
|
|
|
|
|
size_t device_id_size = 0;
|
|
|
|
|
char *tsg_sn_file = NULL, *device_id;
|
|
|
|
|
|
|
|
|
|
const char *device_def_id = "DFT2201925000001";
|
|
|
|
|
cJSON *json = NULL, *item = NULL;
|
|
|
|
|
char device_id_filepath[TFE_STRING_MAX] = {0};
|
|
|
|
|
|
|
|
|
|
ret = MESA_load_profile_string_def(profile, section, "device_id_filepath", device_id_filepath, sizeof(device_id_filepath), NULL);
|
|
|
|
|
if (ret < 0)
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(logger, "Invalid device parameter: device_id_filepath not existed in profile %s section %s.", profile, section);
|
|
|
|
|
goto finish;
|
|
|
|
|
}
|
|
|
|
|
tsg_sn_file = tfe_read_file(device_id_filepath, &device_id_size);
|
|
|
|
|
if (tsg_sn_file == NULL)
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(logger, "Invalid device parameter: device sn file not existed.");
|
|
|
|
|
goto finish;
|
|
|
|
|
}
|
|
|
|
|
json = cJSON_Parse(tsg_sn_file);
|
|
|
|
|
if (json == NULL)
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(logger, "Invalid device parameter: %s invalid json format", tsg_sn_file);
|
|
|
|
|
goto finish;
|
|
|
|
|
}
|
|
|
|
|
item = cJSON_GetObjectItem(json, "sn");
|
|
|
|
|
if (unlikely(!item || !cJSON_IsString(item)))
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(logger, "Invalid device parameter: %s invalid json format", tsg_sn_file);
|
|
|
|
|
goto finish;
|
|
|
|
|
}
|
|
|
|
|
device_id = tfe_strdup(item->valuestring);
|
|
|
|
|
|
2023-04-04 16:06:40 +08:00
|
|
|
if(tsg_sn_file)
|
|
|
|
|
{
|
|
|
|
|
FREE(&tsg_sn_file);
|
|
|
|
|
}
|
2020-06-24 16:40:53 +08:00
|
|
|
cJSON_Delete(json);
|
|
|
|
|
TFE_LOG_INFO(logger, "tfe device id : %s", device_id);
|
|
|
|
|
|
|
|
|
|
return device_id;
|
|
|
|
|
finish:
|
|
|
|
|
TFE_LOG_INFO(logger, "tfe use default device id : %s", device_def_id);
|
|
|
|
|
if (json)
|
2023-04-04 16:06:40 +08:00
|
|
|
{
|
|
|
|
|
cJSON_Delete(json);
|
|
|
|
|
}
|
|
|
|
|
if(tsg_sn_file)
|
|
|
|
|
{
|
|
|
|
|
FREE(&tsg_sn_file);
|
|
|
|
|
}
|
2020-06-24 16:40:53 +08:00
|
|
|
return (char *)device_def_id;
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-18 18:29:10 +08:00
|
|
|
static char* create_effective_device_tag(const char *profile, const char *section, void *logger)
|
2020-10-23 19:03:08 +08:00
|
|
|
{
|
2021-10-18 18:29:10 +08:00
|
|
|
char *effective_device_tag=NULL;
|
2020-10-23 19:03:08 +08:00
|
|
|
char accept_path[TFE_PATH_MAX] = {0}, accept_tags[TFE_STRING_MAX] = {0};
|
|
|
|
|
|
|
|
|
|
MESA_load_profile_string_def(profile, section, "accept_path", accept_path, sizeof(accept_path), "");
|
|
|
|
|
if(strlen(accept_path) > 0)
|
|
|
|
|
{
|
|
|
|
|
MESA_load_profile_string_def(accept_path, "maat", "ACCEPT_TAGS", accept_tags, sizeof(accept_tags), "");
|
|
|
|
|
}
|
|
|
|
|
if(strlen(accept_tags) <= 0)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2021-10-18 18:29:10 +08:00
|
|
|
effective_device_tag = tfe_strdup(accept_tags);
|
|
|
|
|
TFE_LOG_INFO(logger, "tfe device tag : %s", effective_device_tag);
|
2020-10-23 19:03:08 +08:00
|
|
|
|
2021-10-18 18:29:10 +08:00
|
|
|
return effective_device_tag;
|
2020-10-23 19:03:08 +08:00
|
|
|
}
|
|
|
|
|
|
2020-07-15 11:30:11 +08:00
|
|
|
static struct maat_table_info maat_pub_tables[TABLE_TYPE_MAX] = {
|
2020-10-12 11:04:35 +08:00
|
|
|
{0, "TSG_SECURITY_SOURCE_ASN"},
|
|
|
|
|
{0, "TSG_SECURITY_DESTINATION_ASN"},
|
|
|
|
|
{0, "TSG_SECURITY_SOURCE_LOCATION"},
|
|
|
|
|
{0, "TSG_SECURITY_DESTINATION_LOCATION"},
|
|
|
|
|
{0, "TSG_OBJ_SUBSCRIBER_ID"}};
|
2020-07-15 11:30:11 +08:00
|
|
|
|
|
|
|
|
static int register_maat_table()
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < TABLE_TYPE_MAX; i++)
|
|
|
|
|
{
|
2023-03-30 19:39:18 +08:00
|
|
|
maat_pub_tables[i].id = maat_get_table_id(static_maat, maat_pub_tables[i].name);
|
2020-07-15 11:30:11 +08:00
|
|
|
if (maat_pub_tables[i].id < 0)
|
|
|
|
|
{
|
|
|
|
|
TFE_LOG_ERROR(g_default_logger, "Maat table %s register failed.", maat_pub_tables[i].name);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-11 17:57:18 +08:00
|
|
|
int tfe_bussiness_resouce_init()
|
|
|
|
|
{
|
2020-06-24 16:40:53 +08:00
|
|
|
const char *profile_path = "./conf/tfe/tfe.conf";
|
2020-06-11 17:57:18 +08:00
|
|
|
unsigned int thread_num = tfe_proxy_get_work_thread_count();
|
|
|
|
|
static_maat = create_maat_feather("static", profile_path, "MAAT", thread_num, g_default_logger);
|
|
|
|
|
if (!static_maat)
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-24 16:40:53 +08:00
|
|
|
kafka_logger = create_kafka_logger(profile_path, "kafka", g_default_logger);
|
|
|
|
|
if (!kafka_logger)
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
device_id = cerate_device_id(profile_path, "kafka", g_default_logger);
|
|
|
|
|
|
2021-10-18 18:29:10 +08:00
|
|
|
effective_device_tag = create_effective_device_tag(profile_path, "MAAT", g_default_logger);
|
2020-10-23 19:03:08 +08:00
|
|
|
|
2020-07-15 11:30:11 +08:00
|
|
|
if (register_maat_table())
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-11 17:57:18 +08:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void *tfe_bussiness_resouce_get(enum RESOURCE_TYPE type)
|
|
|
|
|
{
|
2020-06-24 16:40:53 +08:00
|
|
|
switch (type)
|
2020-06-11 17:57:18 +08:00
|
|
|
{
|
2020-06-24 16:40:53 +08:00
|
|
|
case STATIC_MAAT:
|
2020-06-11 17:57:18 +08:00
|
|
|
return static_maat;
|
2020-06-24 16:40:53 +08:00
|
|
|
case KAFKA_LOGGER:
|
|
|
|
|
return kafka_logger;
|
|
|
|
|
case DEVICE_ID:
|
|
|
|
|
return device_id;
|
2021-10-18 18:29:10 +08:00
|
|
|
case EFFECTIVE_DEVICE_TAG:
|
|
|
|
|
return effective_device_tag;
|
2020-06-24 16:40:53 +08:00
|
|
|
default:
|
|
|
|
|
return NULL;
|
2020-06-11 17:57:18 +08:00
|
|
|
}
|
2020-07-15 11:30:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int tfe_bussiness_tableid_get(enum TABLE_TYPE type)
|
|
|
|
|
{
|
|
|
|
|
return maat_pub_tables[type].id;
|
2020-06-11 17:57:18 +08:00
|
|
|
}
|