TSG-16531 PacketAdapter适配容器环境,使用mrzcpd收包,通过RAW Socket注RST包

This commit is contained in:
luwenpeng
2023-08-09 18:47:16 +08:00
parent 1063574ca0
commit e34aa3f5e2
65 changed files with 4379 additions and 1174 deletions

73
common/include/log.h Normal file
View File

@@ -0,0 +1,73 @@
#ifndef _LOG_H
#define _LOG_H
#ifdef __cpluscplus
extern "C"
{
#endif
#include <stdio.h>
#include <MESA/MESA_handle_logger.h>
extern void *default_logger;
int LOG_INIT(const char *profile);
void LOG_CLOSE(void);
void LOG_RELOAD(void);
#define LOG_DEBUG(format, ...) \
do \
{ \
if (default_logger == NULL) \
{ \
fprintf(stdout, "[DEBUG] " format "\n", ##__VA_ARGS__); \
fflush(stdout); \
} \
else \
{ \
if (MESA_handle_runtime_log_level_enabled(default_logger, RLOG_LV_DEBUG)) \
{ \
MESA_handle_runtime_log(default_logger, RLOG_LV_DEBUG, __FUNCTION__, format, ##__VA_ARGS__); \
} \
} \
} while (0)
#define LOG_INFO(format, ...) \
do \
{ \
if (default_logger == NULL) \
{ \
fprintf(stdout, "[INFOR] " format "\n", ##__VA_ARGS__); \
fflush(stdout); \
} \
else \
{ \
if (MESA_handle_runtime_log_level_enabled(default_logger, RLOG_LV_INFO)) \
{ \
MESA_handle_runtime_log(default_logger, RLOG_LV_INFO, __FUNCTION__, format, ##__VA_ARGS__); \
} \
} \
} while (0)
#define LOG_ERROR(format, ...) \
do \
{ \
if (default_logger == NULL) \
{ \
fprintf(stdout, "[ERROR] " format "\n", ##__VA_ARGS__); \
fflush(stdout); \
} \
else \
{ \
if (MESA_handle_runtime_log_level_enabled(default_logger, RLOG_LV_FATAL)) \
{ \
MESA_handle_runtime_log(default_logger, RLOG_LV_FATAL, __FUNCTION__, format, ##__VA_ARGS__); \
} \
} \
} while (0)
#ifdef __cpluscplus
}
#endif
#endif