TSG-13584: Firewall的安全日志依赖session record日志,修复TRAFFIC_SHAPING_PROFILE表是否生效字段编号定义错误,使用cppcheck进行代码检查
This commit is contained in:
@@ -1,5 +1,142 @@
|
||||
#pragma once
|
||||
|
||||
#include <MESA/stream.h>
|
||||
#include <MESA/field_stat2.h>
|
||||
#include <ctemplate/template.h>
|
||||
|
||||
enum TSG_FS2_TYPE
|
||||
{
|
||||
TSG_FS2_TCP_LINKS=0,
|
||||
TSG_FS2_UDP_LINKS,
|
||||
TSG_FS2_BYPASS,
|
||||
TSG_FS2_HIT_ADDR,
|
||||
TSG_FS2_HIT_SHARE,
|
||||
TSG_FS2_INTERCEPT,
|
||||
TSG_FS2_SHAPING,
|
||||
TSG_FS2_EXCLUSION,
|
||||
TSG_FS2_APP_DPKT_RESULT,
|
||||
TSG_FS2_APP_Q_RESULT,
|
||||
TSG_FS2_APP_USER_RESULT,
|
||||
TSG_FS2_APP_BUILT_IN_RESULT,
|
||||
TSG_FS2_INJECT_PKT_SUCCESS,
|
||||
TSG_FS2_INJECT_PKT_FAILED,
|
||||
TSG_FS2_MIRRORED_PKT_SUCCESS,
|
||||
TSG_FS2_MIRRORED_BYTE_SUCCESS,
|
||||
TSG_FS2_MIRRORED_PKT_FAILED,
|
||||
TSG_FS2_MIRRORED_BYTE_FAILED,
|
||||
TSG_FS2_SET_TIMOUT_SUCCESS,
|
||||
TSG_FS2_SET_TIMOUT_FAILED,
|
||||
TSG_FS2_SUCESS_TAMPER,
|
||||
TSG_FS2_TAMPER_FAILED_PLOAD_LESS_4,
|
||||
TSG_FS2_TAMPER_FAILED_NOSWAP,
|
||||
TSG_FS2_ASN_ADD,
|
||||
TSG_FS2_ASN_DEL,
|
||||
TSG_FS2_GTPC_ADD,
|
||||
TSG_FS2_GTPC_DEL,
|
||||
TSG_FS2_LOCATION_ADD,
|
||||
TSG_FS2_LOCATION_DEL,
|
||||
TSG_FS2_FQDN_ADD,
|
||||
TSG_FS2_FQDN_DEL,
|
||||
TSG_FS2_SUBSCRIBER_ADD,
|
||||
TSG_FS2_SUBSCRIBER_DEL,
|
||||
TSG_FS2_SECURIRY_ADD,
|
||||
TSG_FS2_SECURIRY_DEL,
|
||||
TSG_FS2_MIRRORED_ADD,
|
||||
TSG_FS2_MIRRORED_DEL,
|
||||
TSG_FS2_HTTP_RES_ADD,
|
||||
TSG_FS2_HTTP_RES_DEL,
|
||||
TSG_FS2_DNS_RES_ADD,
|
||||
TSG_FS2_DNS_RES_DEL,
|
||||
TSG_FS2_APP_ID_ADD,
|
||||
TSG_FS2_APP_ID_DEL,
|
||||
TSG_FS2_TUNNEL_CATALOG_ADD,
|
||||
TSG_FS2_TUNNEL_CATALOG_DEL,
|
||||
TSG_FS2_TUNNEL_ENDPOINT_ADD,
|
||||
TSG_FS2_TUNNEL_ENDPOINT_DEL,
|
||||
TSG_FS2_TUNNEL_LABEL_ADD,
|
||||
TSG_FS2_TUNNEL_LABEL_DEL,
|
||||
TSG_FS2_MAX
|
||||
};
|
||||
|
||||
|
||||
enum DEPLOY_MODE
|
||||
{
|
||||
DEPLOY_MODE_MIRROR,
|
||||
DEPLOY_MODE_INLINE,
|
||||
DEPLOY_MODE_TRANSPARENT,
|
||||
DEPLOY_MODE_MAX
|
||||
};
|
||||
|
||||
enum MASTER_STATIC_TABLE
|
||||
{
|
||||
TABLE_SECURITY_COMPILE=0,
|
||||
TABLE_IP_ADDR,
|
||||
TABLE_SUBSCRIBER_ID,
|
||||
TABLE_APP_ID,
|
||||
TABLE_HTTP_HOST,
|
||||
TABLE_SSL_SNI,
|
||||
TABLE_EXCLUSION_SSL_SNI,
|
||||
TABLE_SRC_ASN,
|
||||
TABLE_DST_ASN,
|
||||
TABLE_SRC_LOCATION,
|
||||
TABLE_DST_LOCATION,
|
||||
TABLE_ASN_USER_DEFINED,
|
||||
TABLE_ASN_BUILT_IN,
|
||||
TABLE_LOCATION_USER_DEFINED,
|
||||
TABLE_LOCATION_BUILT_IN,
|
||||
TABLE_QUIC_SNI,
|
||||
TABLE_FQDN_CAT_ID,
|
||||
TABLE_FQDN_CAT_USER_DEFINED,
|
||||
TABLE_FQDN_CAT_BUILT_IN,
|
||||
TABLE_APP_ID_DICT,
|
||||
TABLE_SELECTOR_ID,
|
||||
TABLE_SELECTOR_PROPERTIES,
|
||||
TABLE_GTP_APN,
|
||||
TABLE_GTP_IMSI,
|
||||
TABLE_GTP_PHONE_NUMBER,
|
||||
TABLE_RESPONSE_PAGES,
|
||||
TABLE_DNS_PROFILE_RECORD,
|
||||
TABLE_PROFILE_MIRROR,
|
||||
TABLE_HTTP_URL,
|
||||
TABLE_DTLS_SNI,
|
||||
TABLE_TUNNEL_ID,
|
||||
TABLE_TUNNEL_CATALOG,
|
||||
TABLE_TUNNEL_ENDPOINT,
|
||||
TABLE_TUNNEL_LABEL,
|
||||
TABLE_SESSION_FLAGS,
|
||||
TABLE_MAX
|
||||
};
|
||||
|
||||
enum MASTER_DYNAMIC_TABLE
|
||||
{
|
||||
DYN_TABLE_SUBSCRIBER_IP=0,
|
||||
DYN_TABLE_GTP_SIGNALING,
|
||||
DYN_TABLE_MAX
|
||||
};
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef PRINTADDR
|
||||
#define PRINTADDR(a, b) ((b)<RLOG_LV_FATAL ? printaddr(&(a->addr), a->threadnum) : "")
|
||||
#endif
|
||||
|
||||
#ifndef MAX_TSG_ALL_RESULT_NUM
|
||||
#define MAX_TSG_ALL_RESULT_NUM MAX_RESULT_NUM*2
|
||||
#endif
|
||||
|
||||
#ifndef MAX_STRING_LEN32
|
||||
#define MAX_STRING_LEN32 32
|
||||
#endif
|
||||
|
||||
struct id2field
|
||||
{
|
||||
int type;
|
||||
int id;
|
||||
char name[MAX_STRING_LEN32];
|
||||
};
|
||||
|
||||
struct reset_argv
|
||||
{
|
||||
int pkt_num;
|
||||
@@ -10,7 +147,14 @@ struct reset_argv
|
||||
int remedy;
|
||||
};
|
||||
|
||||
#define _MAX_TABLE_NAME_LEN 64
|
||||
#ifndef MAX_TABLE_NAME_LEN
|
||||
#define MAX_TABLE_NAME_LEN 64
|
||||
#endif
|
||||
|
||||
#ifndef MAX_STRING_LEN128
|
||||
#define MAX_STRING_LEN128 128
|
||||
#endif
|
||||
|
||||
typedef struct tsg_para
|
||||
{
|
||||
int level;
|
||||
@@ -32,25 +176,19 @@ typedef struct tsg_para
|
||||
int unknown_app_id;
|
||||
int hit_path_switch;
|
||||
int default_compile_id;
|
||||
int table_id[TABLE_MAX];
|
||||
int table_id[TABLE_MAX];
|
||||
int dyn_table_id[DYN_TABLE_MAX];
|
||||
int priority_project_id;
|
||||
int shaping_project_id;
|
||||
int session_attribute_project_id;
|
||||
int context_project_id;
|
||||
int tcpall_project_id;
|
||||
int gather_app_project_id;
|
||||
int bridge_id[BRIDGE_TYPE_MAX];
|
||||
int proto_flag; //tsg_protocol_t
|
||||
int fs2_field_id[TSG_FS2_MAX];
|
||||
char device_sn[MAX_DOMAIN_LEN/8];
|
||||
char log_path[MAX_DOMAIN_LEN/8];
|
||||
char device_id_command[MAX_DOMAIN_LEN/8];
|
||||
char data_center[_MAX_TABLE_NAME_LEN];
|
||||
char device_tag[MAX_DOMAIN_LEN/2];
|
||||
char table_name[TABLE_MAX][_MAX_TABLE_NAME_LEN];
|
||||
char dyn_table_name[DYN_TABLE_MAX][_MAX_TABLE_NAME_LEN];
|
||||
char bridge_name[BRIDGE_TYPE_MAX][_MAX_TABLE_NAME_LEN];
|
||||
char device_sn[MAX_STRING_LEN128];
|
||||
char log_path[MAX_STRING_LEN128];
|
||||
char device_id_command[MAX_STRING_LEN128];
|
||||
char data_center[MAX_STRING_LEN128];
|
||||
char device_tag[MAX_STRING_LEN128];
|
||||
char table_name[TABLE_MAX][MAX_TABLE_NAME_LEN];
|
||||
char dyn_table_name[DYN_TABLE_MAX][MAX_TABLE_NAME_LEN];
|
||||
struct bridge_info bridge[BRIDGE_TYPE_MAX];
|
||||
void *logger;
|
||||
void *maat_logger;
|
||||
struct reset_argv reset;
|
||||
@@ -66,4 +204,5 @@ typedef struct tsg_para
|
||||
|
||||
extern g_tsg_para_t g_tsg_para;
|
||||
extern Maat_feather_t g_tsg_dynamic_maat_feather;
|
||||
extern id2field_t g_tsg_proto_name2id[PROTO_MAX];
|
||||
extern struct id2field g_tsg_proto_name2id[PROTO_MAX];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user