traffic_mirror增加配置项app_symbol
This commit is contained in:
@@ -390,6 +390,7 @@ error_out:
|
||||
static int traffic_mirror_ethdev_init(struct traffic_mirror_instance * instance)
|
||||
{
|
||||
char str_ethdev[TFE_SYMBOL_MAX] = {0};
|
||||
char app_symbol[TFE_SYMBOL_MAX] = {0};
|
||||
const char * profile = "./conf/tfe/tfe.conf";
|
||||
|
||||
int ret = MESA_load_profile_string_nodef(profile, "traffic_mirror", "device",
|
||||
@@ -407,14 +408,22 @@ static int traffic_mirror_ethdev_init(struct traffic_mirror_instance * instance)
|
||||
unsigned int device_type;
|
||||
MESA_load_profile_uint_def(profile, "traffic_mirror", "type", &device_type, TRAFFIC_MIRROR_ETHDEV_AF_PACKET);
|
||||
|
||||
ret = MESA_load_profile_string_nodef(profile, "traffic_mirror", "app_symbol", app_symbol, sizeof(app_symbol));
|
||||
if (ret < 0)
|
||||
{
|
||||
TFE_LOG_ERROR(instance->logger, "failed at reading conffile, "
|
||||
"[traffic_mirror]app_symbol is not defined.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (device_type == TRAFFIC_MIRROR_ETHDEV_AF_PACKET)
|
||||
{
|
||||
instance->ethdev = traffic_mirror_ethdev_pcap_create(str_ethdev, instance->logger);
|
||||
}
|
||||
else if(device_type == TRAFFIC_MIRROR_ETHDEV_MARSIO)
|
||||
{
|
||||
instance->ethdev = traffic_mirror_ethdev_mr4_create(str_ethdev,
|
||||
tfe_proxy_get_work_thread_count(), instance->logger);
|
||||
instance->ethdev = traffic_mirror_ethdev_mr4_create(str_ethdev,
|
||||
app_symbol, tfe_proxy_get_work_thread_count(), instance->logger);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user