TSG-7702 支持外层IPv4且内层为IPv4的封装模式 TSG-7703 支持外层IPv6且内层为IPv6的封装模式 TSG-7704 支持外层IPv6且内层为IPv4的封装模式 TSG-7705 支持外层IPv4且内层为IPv6的封装模式
33 lines
658 B
C
33 lines
658 B
C
#ifndef _LOG_H
|
|
#define _LOG_H
|
|
|
|
#ifdef __cpluscplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
#include <stdio.h>
|
|
|
|
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
|
|
|
#define PRINT_FILE_INFO 0
|
|
|
|
#if (PRINT_FILE_INFO)
|
|
#define LOG_DEBUG(format, ...) \
|
|
fprintf(stdout, "[%s-%s()-%05d] " format "\n", __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__);
|
|
|
|
#define LOG_ERROR(format, ...) \
|
|
fprintf(stderr, "[%s-%s()-%05d] " format "\n", __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__);
|
|
#else
|
|
#define LOG_DEBUG(format, ...) \
|
|
fprintf(stdout, format "\n", ##__VA_ARGS__);
|
|
|
|
#define LOG_ERROR(format, ...) \
|
|
fprintf(stderr, format "\n", ##__VA_ARGS__);
|
|
#endif
|
|
|
|
#ifdef __cpluscplus
|
|
}
|
|
#endif
|
|
|
|
#endif |