1、删除tsg 相关头文件 2、增加cmsg 相关日志
This commit is contained in:
@@ -17,8 +17,8 @@ bypass: drome: pme_new_fail: destroy_pme
|
||||
#include <signal.h>
|
||||
#include <inttypes.h>
|
||||
#include "tfe_mgr.h"
|
||||
#include "tsg/tsg_rule.h"
|
||||
#include "tsg/tsg_send_log.h"
|
||||
#include <tsg/tsg_rule.h>
|
||||
#include <tsg/tsg_send_log.h>
|
||||
#include "ssl_utils.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -29,7 +29,7 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
#include "kni_tun.h"
|
||||
#include "tsg/tsg_statistic.h"
|
||||
#include <tsg/tsg_statistic.h>
|
||||
#include <MESA/stream_inc/stream_control.h>
|
||||
#include "kni_entry.h"
|
||||
#include "kni_pxy_tcp_option.h"
|
||||
@@ -258,6 +258,11 @@ int wrapped_kni_cmsg_set(struct kni_cmsg *cmsg, uint16_t type, const unsigned ch
|
||||
if(ret < 0){
|
||||
KNI_LOG_ERROR(logger, "Failed set cmsg, type = %d, stream traceid = %s, stream addr = %s", type, pmeinfo->stream_traceid, pmeinfo->stream_addr);
|
||||
}
|
||||
else
|
||||
{
|
||||
KNI_LOG_DEBUG(logger, "Successd to set cmsg, type = %d/%s, stream traceid = %s, stream addr = %s", type,tfe_cmsg_tlv_type_to_string[type], pmeinfo->stream_traceid, pmeinfo->stream_addr);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -296,7 +301,7 @@ static int session_attribute_cmsg_set(struct kni_cmsg *cmsg, struct pme_info *pm
|
||||
|
||||
if(session_attribute_label->server_asn == NULL)
|
||||
{
|
||||
ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_SRC_ASN, (const unsigned char*)empty_arr, strlen(empty_arr), pmeinfo);
|
||||
ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_DST_ASN, (const unsigned char*)empty_arr, strlen(empty_arr), pmeinfo);
|
||||
if(ret < 0) break;
|
||||
ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_DST_ORGANIZATION, (const unsigned char*)empty_arr, strlen(empty_arr), pmeinfo);
|
||||
if(ret < 0) break;
|
||||
@@ -486,6 +491,7 @@ static unsigned char* kni_cmsg_serialize_header_new(struct pme_info *pmeinfo, st
|
||||
if(ret < 0) goto error_out;
|
||||
|
||||
bufflen = kni_cmsg_serialize_size_get(cmsg);
|
||||
KNI_LOG_DEBUG(logger, "Successd set cmsg size:%d, stream traceid = %s", bufflen, pmeinfo->stream_traceid);
|
||||
buff = (unsigned char*)ALLOC(char, bufflen);
|
||||
serialize_len = 0;
|
||||
ret = kni_cmsg_serialize(cmsg, buff, bufflen, &serialize_len);
|
||||
@@ -508,9 +514,11 @@ error_out:
|
||||
|
||||
static char* add_cmsg_to_packet(struct pme_info *pmeinfo, struct streaminfo *stream, struct pkt_info *pktinfo, int *len){
|
||||
//tcp option: kind 88, len 4, control_info_len
|
||||
void * logger = g_kni_handle->local_logger;
|
||||
char *new_pkt = (char*)ALLOC(struct wrapped_packet, 1);
|
||||
int offset = 0;
|
||||
//iphdr
|
||||
KNI_LOG_ERROR(logger, "Kni add cmsg to packet malloc buffer size:%d",sizeof(struct wrapped_packet));
|
||||
if(pmeinfo->addr_type == ADDR_TYPE_IPV6){
|
||||
memcpy(new_pkt, (void*)pktinfo->iphdr.v6, pktinfo->iphdr_len);
|
||||
}
|
||||
@@ -539,10 +547,12 @@ static char* add_cmsg_to_packet(struct pme_info *pmeinfo, struct streaminfo *str
|
||||
uint16_t header_len = 0;
|
||||
unsigned char* header = kni_cmsg_serialize_header_new(pmeinfo, stream, pktinfo, &header_len);
|
||||
if(header == NULL){
|
||||
KNI_LOG_ERROR(logger, "Kni add cmsg to packet: serialize_header failed");
|
||||
goto error_out;
|
||||
}
|
||||
memcpy(new_pkt + offset, (void*)header, header_len);
|
||||
offset += header_len;
|
||||
KNI_LOG_DEBUG(logger, "Kni add cmsg to packet:offset=%d,header_len=%d, tcp_data_len=%d",offset,header_len,pktinfo->data_len);
|
||||
FREE(&header);
|
||||
//ipv6
|
||||
if(pmeinfo->addr_type == ADDR_TYPE_IPV6){
|
||||
@@ -2511,7 +2521,7 @@ extern "C" int kni_init(){
|
||||
MESA_htable_handle sslinfo2bypass_htable = NULL;
|
||||
struct tfe_mgr *_tfe_mgr = NULL;
|
||||
char label_buff[MAX_STRING_LEN*4]={0};
|
||||
|
||||
tfe_cmsg_enum_to_string();
|
||||
int ret = MESA_load_profile_string_nodef(profile, section, "log_path", log_path, sizeof(log_path));
|
||||
if(ret < 0){
|
||||
printf("MESA_prof_load: log_path not set, profile = %s, section = %s", profile, section);
|
||||
|
||||
Reference in New Issue
Block a user