TSG-13837 支持decrypted traffic steering/mirroring,并重构packet_io
This commit is contained in:
@@ -45,10 +45,10 @@ static void sf_status_parse_config(const char *profile, struct sf_status_config
|
||||
MESA_load_profile_int_def(profile, "METRICS", "telegraf_listen_port", &(config->telegraf_listen_port), 8300);
|
||||
MESA_load_profile_string_def(profile, "METRICS", "telegraf_bind_address", config->telegraf_bind_address, sizeof(config->telegraf_bind_address), "127.0.0.1");
|
||||
|
||||
LOG_DEBUG("%s: METRICS->enable : %d", LOG_TAG_SF_STATUS, config->enable);
|
||||
LOG_DEBUG("%s: METRICS->interval_s : %d", LOG_TAG_SF_STATUS, config->interval_s);
|
||||
LOG_DEBUG("%s: METRICS->telegraf_listen_port : %d", LOG_TAG_SF_STATUS, config->telegraf_listen_port);
|
||||
LOG_DEBUG("%s: METRICS->telegraf_bind_address : %s", LOG_TAG_SF_STATUS, config->telegraf_bind_address);
|
||||
LOG_DEBUG("%s: METRICS->enable : %d", LOG_TAG_SF_STATUS, config->enable);
|
||||
LOG_DEBUG("%s: METRICS->interval_s : %d", LOG_TAG_SF_STATUS, config->interval_s);
|
||||
LOG_DEBUG("%s: METRICS->telegraf_listen_port : %d", LOG_TAG_SF_STATUS, config->telegraf_listen_port);
|
||||
LOG_DEBUG("%s: METRICS->telegraf_bind_address : %s", LOG_TAG_SF_STATUS, config->telegraf_bind_address);
|
||||
}
|
||||
|
||||
void sf_status_destory(struct sf_status *handle)
|
||||
@@ -104,7 +104,7 @@ struct sf_status *sf_status_create(const char *profile)
|
||||
|
||||
void sf_status_reset(struct sf_status *handle)
|
||||
{
|
||||
if (handle->config.enable == 0)
|
||||
if (handle == NULL || handle->config.enable == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -125,7 +125,7 @@ void sf_status_reset(struct sf_status *handle)
|
||||
|
||||
void sf_status_delete(struct sf_status *handle, int sf_profile_id)
|
||||
{
|
||||
if (handle->config.enable == 0)
|
||||
if (handle == NULL || handle->config.enable == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ void sf_status_delete(struct sf_status *handle, int sf_profile_id)
|
||||
|
||||
void sf_status_update(struct sf_status *handle, int sf_profile_id, int sf_status, int sf_latency)
|
||||
{
|
||||
if (handle->config.enable == 0)
|
||||
if (handle == NULL || handle->config.enable == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ void sf_status_send(struct sf_status *handle)
|
||||
struct node *temp = NULL;
|
||||
struct node *node = NULL;
|
||||
|
||||
if (handle->config.enable == 0)
|
||||
if (handle == NULL || handle->config.enable == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -203,5 +203,12 @@ void sf_status_send(struct sf_status *handle)
|
||||
|
||||
int sf_status_get_interval(struct sf_status *handle)
|
||||
{
|
||||
return handle->config.interval_s;
|
||||
if (handle == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return handle->config.interval_s;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user