SSL_SNI和HTTP_HOST的deny动作由总控负责处理
修复获取全局流ID时的错误
This commit is contained in:
@@ -113,7 +113,7 @@ static Maat_rule_t *tsg_policy_decision_criteria(Maat_rule_t *result, int result
|
||||
extern "C" char TSG_MASTER_TCP_ENTRY(struct streaminfo *a_tcp, void **pme, int thread_seq,void *a_packet)
|
||||
{
|
||||
int send_log=0,identify_flag=0;
|
||||
int ret=0,hit_num=0,ip_policy=0;
|
||||
int ret=0,hit_num=0;
|
||||
int state=APP_STATE_DROPME;
|
||||
scan_status_t mid=NULL;
|
||||
char *domain_field_name=NULL;
|
||||
@@ -160,23 +160,19 @@ extern "C" char TSG_MASTER_TCP_ENTRY(struct streaminfo *a_tcp, void **pme, int t
|
||||
p_result=tsg_policy_decision_criteria(all_result, hit_num);
|
||||
|
||||
if(p_result!=NULL)
|
||||
{
|
||||
if(q_result!=NULL && (p_result==q_result))
|
||||
{
|
||||
ip_policy=1;
|
||||
send_log=1;
|
||||
}
|
||||
|
||||
{
|
||||
switch((unsigned char)p_result->action)
|
||||
{
|
||||
case TSG_ACTION_DENY:
|
||||
if(ip_policy==1)
|
||||
{
|
||||
MESA_kill_tcp(a_tcp, a_packet);
|
||||
state|=APP_STATE_DROPPKT|APP_STATE_KILL_OTHER;
|
||||
}
|
||||
send_log=1;
|
||||
MESA_kill_tcp(a_tcp, a_packet);
|
||||
state|=APP_STATE_DROPPKT|APP_STATE_KILL_OTHER;
|
||||
break;
|
||||
case TSG_ACTION_MONITOR:
|
||||
if(q_result!=NULL && (p_result==q_result))
|
||||
{
|
||||
send_log=1;
|
||||
}
|
||||
break;
|
||||
case TSG_ACTION_BYPASS:
|
||||
send_log=1;
|
||||
@@ -184,7 +180,6 @@ extern "C" char TSG_MASTER_TCP_ENTRY(struct streaminfo *a_tcp, void **pme, int t
|
||||
FS_operate(g_tsg_para.fs2_handle, g_tsg_para.fs2_field_id[TSG_FS2_BYPASS], 0, FS_OP_ADD, 1);
|
||||
break;
|
||||
case TSG_ACTION_INTERCEPT:
|
||||
send_log=0;
|
||||
FS_operate(g_tsg_para.fs2_handle, g_tsg_para.fs2_field_id[TSG_FS2_INTERCEPT], 0, FS_OP_ADD, 1);
|
||||
priority_label=(policy_priority_label_t *)dictator_malloc(thread_seq, sizeof(policy_priority_label_t));
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ unsigned long long tsg_get_stream_id(struct streaminfo * a_stream)
|
||||
int device_id_size=sizeof(unsigned long long);
|
||||
unsigned long long device_id=(unsigned long long)g_tsg_para.device_id;
|
||||
|
||||
ret=MESA_get_stream_opt(a_stream, MSO_GLOBAL_STREAM_ID, (void *)device_id, &device_id_size);
|
||||
ret=MESA_get_stream_opt(a_stream, MSO_GLOBAL_STREAM_ID, (void *)&device_id, &device_id_size);
|
||||
if(ret==0)
|
||||
{
|
||||
return device_id;
|
||||
@@ -134,6 +134,7 @@ int TLD_append_streaminfo(struct _tsg_log_instance *_instance, struct _tld_handl
|
||||
unsigned short tunnel_type=0;
|
||||
char nest_addr_buf[1024];
|
||||
char *addr_proto=NULL;
|
||||
unsigned long long stream_id=0;
|
||||
unsigned short c_port=0, s_port=0;
|
||||
int tunnel_type_size=sizeof(tunnel_type);
|
||||
struct layer_addr_ipv4 *ipv4=NULL;
|
||||
@@ -181,7 +182,9 @@ int TLD_append_streaminfo(struct _tsg_log_instance *_instance, struct _tld_handl
|
||||
TLD_append((TLD_handle_t)_handle, _instance->id2field[LOG_COMMON_S2C_PKT_NUM].name, (void *)(long)a_stream->ptcpdetail->serverpktnum, TLD_TYPE_LONG);
|
||||
TLD_append((TLD_handle_t)_handle, _instance->id2field[LOG_COMMON_S2C_BYTE_NUM].name, (void *)(long)a_stream->ptcpdetail->serverbytes, TLD_TYPE_LONG);
|
||||
|
||||
|
||||
stream_id=tsg_get_stream_id(a_stream);
|
||||
TLD_append((TLD_handle_t)_handle, _instance->id2field[LOG_COMMON_STREAM_TRACE_ID].name, (void *)(long)stream_id, TLD_TYPE_LONG);
|
||||
|
||||
addr_proto=(char *)layer_addr_prefix_ntop(a_stream);
|
||||
TLD_append((TLD_handle_t)_handle, _instance->id2field[LOG_COMMON_L4_PROTOCOL].name, (void *)addr_proto, TLD_TYPE_STRING);
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ global:
|
||||
extern "C++" {
|
||||
g_*;
|
||||
*TSG_MASTER_INIT*;
|
||||
*TSG_MASTER_TCPALL_ENTRY*;
|
||||
*TSG_MASTER_TCP_ENTRY*;
|
||||
*TSG_MASTER_UNLOAD*;
|
||||
*tsg_scan_nesting_addr*;
|
||||
*tsg_pull_policy_result*;
|
||||
|
||||
Reference in New Issue
Block a user