TSG-13878 tsg-service-chaining-engine支持fieldstat2

This commit is contained in:
luwenpeng
2023-02-21 09:58:31 +08:00
parent b1abe96b06
commit 823490bcd1
20 changed files with 555 additions and 204 deletions

View File

@@ -19,7 +19,7 @@ struct g_vxlan
unsigned int dir_is_e2i : 1;
unsigned int traffic_is_decrypted : 1;
unsigned int next_sf_index : 5; // max value 32
unsigned int sf_index : 5; // max value 32
unsigned int online_test : 1;
// Reserved 1 Bytes
@@ -34,11 +34,11 @@ struct g_vxlan
} __attribute__((__packed__));
void g_vxlan_set_packet_dir(struct g_vxlan *hdr, int dir_is_e2i);
void g_vxlan_set_next_sf_index(struct g_vxlan *hdr, int next_sf_index);
void g_vxlan_set_sf_index(struct g_vxlan *hdr, int sf_index);
void g_vxlan_set_traffic_type(struct g_vxlan *hdr, int traffic_is_decrypted);
int g_vxlan_get_packet_dir(struct g_vxlan *hdr);
int g_vxlan_get_next_sf_index(struct g_vxlan *hdr);
int g_vxlan_get_sf_index(struct g_vxlan *hdr);
int g_vxlan_get_traffic_type(struct g_vxlan *hdr);
// return 0 : success

View File

@@ -7,6 +7,7 @@ extern "C"
#endif
#include <stdio.h>
#include <pthread.h>
#include <MESA/MESA_handle_logger.h>
extern void *g_default_logger;
@@ -15,31 +16,50 @@ int LOG_INIT(const char *profile);
void LOG_CLOSE(void);
void LOG_RELOAD(void);
#define LOG_DEBUG(format, ...) \
do \
{ \
if (g_default_logger) \
MESA_handle_runtime_log(g_default_logger, RLOG_LV_DEBUG, __FUNCTION__, format, ##__VA_ARGS__); \
else \
fprintf(stdout, "DEBUG " format "\n", ##__VA_ARGS__); \
// __FUNCTION__
#define LOG_DEBUG(format, ...) \
do \
{ \
if (g_default_logger) \
{ \
char __tid_buff[16] = {0}; \
snprintf(__tid_buff, 16, "tid:%ld", pthread_self()); \
MESA_handle_runtime_log(g_default_logger, RLOG_LV_DEBUG, __tid_buff, format, ##__VA_ARGS__); \
} \
else \
{ \
fprintf(stdout, "DEBUG " format "\n", ##__VA_ARGS__); \
} \
} while (0)
#define LOG_INFO(format, ...) \
do \
{ \
if (g_default_logger) \
MESA_handle_runtime_log(g_default_logger, RLOG_LV_INFO, __FUNCTION__, format, ##__VA_ARGS__); \
else \
fprintf(stdout, "INFO " format "\n", ##__VA_ARGS__); \
#define LOG_INFO(format, ...) \
do \
{ \
if (g_default_logger) \
{ \
char __tid_buff[16] = {0}; \
snprintf(__tid_buff, 16, "tid:%ld", pthread_self()); \
MESA_handle_runtime_log(g_default_logger, RLOG_LV_INFO, __tid_buff, format, ##__VA_ARGS__); \
} \
else \
{ \
fprintf(stdout, "INFOR " format "\n", ##__VA_ARGS__); \
} \
} while (0)
#define LOG_ERROR(format, ...) \
do \
{ \
if (g_default_logger) \
MESA_handle_runtime_log(g_default_logger, RLOG_LV_FATAL, __FUNCTION__, format, ##__VA_ARGS__); \
else \
fprintf(stderr, "ERROR " format "\n", ##__VA_ARGS__); \
#define LOG_ERROR(format, ...) \
do \
{ \
if (g_default_logger) \
{ \
char __tid_buff[16] = {0}; \
snprintf(__tid_buff, 16, "tid:%ld", pthread_self()); \
MESA_handle_runtime_log(g_default_logger, RLOG_LV_FATAL, __tid_buff, format, ##__VA_ARGS__); \
} \
else \
{ \
fprintf(stderr, "ERROR " format "\n", ##__VA_ARGS__); \
} \
} while (0)
#ifdef __cpluscplus