summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlijia <[email protected]>2019-12-19 19:41:05 +0800
committerlijia <[email protected]>2019-12-19 19:41:05 +0800
commit86c5a186658644901d8ba049716f80ef890466a4 (patch)
treeb1685e49088e297499378a8216d64b67903712b5
parent422766471efa716d82f8d50f6041bb5944cd1d1a (diff)
无功能性更新, 删除一些运行时printf刷屏告警, 改为写runtime_log.
-rw-r--r--src/common/linux_kernel_jhash.c2
-rw-r--r--src/common/net_common.c14
-rw-r--r--src/common/stream_addr_inet.c10
-rw-r--r--src/dealpkt/callapp.c5
-rw-r--r--src/dealpkt/deal_ipv4.c8
-rw-r--r--src/dealpkt/deal_ipv6.c8
-rw-r--r--src/dealpkt/deal_tcp.c2
-rw-r--r--src/dealpkt/deal_teredo.c2
-rw-r--r--src/dealpkt/stream_manage.c2
-rw-r--r--src/packet_io/cycle_pkt_dump_through_write_offset.c4
-rw-r--r--src/packet_io/packet_io.c4
-rw-r--r--src/packet_io/packet_io_pcap.c2
-rw-r--r--src/packet_io/sapp_compat_wangyan_api.c2
-rw-r--r--src/packet_io/sendpacket.c50
-rw-r--r--src/project/project_requirement.c2
-rw-r--r--version.txt12
16 files changed, 61 insertions, 68 deletions
diff --git a/src/common/linux_kernel_jhash.c b/src/common/linux_kernel_jhash.c
index ac647b0..7d141ff 100644
--- a/src/common/linux_kernel_jhash.c
+++ b/src/common/linux_kernel_jhash.c
@@ -236,7 +236,7 @@ int stream_make_hash(struct streaminfo_private *stream_pr, unsigned int maxsize)
d = tuple4_v6->source;
}
}else{
- printf("stream_make_hash() error, addr type is not IPv4 or IPv6!\n");
+ //printf("stream_make_hash() error, addr type is not IPv4 or IPv6!\n");
sapp_runtime_log(RLOG_LV_FATAL, "stream_make_hash() error, addr type is not IPv4 or IPv6!\n");
abort();
}
diff --git a/src/common/net_common.c b/src/common/net_common.c
index 96bad71..1cc3043 100644
--- a/src/common/net_common.c
+++ b/src/common/net_common.c
@@ -166,7 +166,7 @@ static int udp_jump_to_layer(const char *raw_data, int raw_layer_type, int expe
}
else
{
- printf("TODO: jmp unsupport teredo hdr:0x%d!\n", *(unsigned int *)(next_layer_hdr));
+ sapp_runtime_log(20, "udp_jump_to_layer(): unsupport teredo hdr:0x%d!\n", *(unsigned int *)(next_layer_hdr));
return -1;
}
}
@@ -316,7 +316,7 @@ static int ipv6_jump_to_layer(const char *raw_data, int raw_layer_type, int exp
goto done;
default:
- printf("TODO:jmp Unknown IPv6 header type:0x%x!\n", next_hdr_type);
+ sapp_runtime_log(20, "ipv6_jump_to_layer(): unknown IPv6 header type:0x%x!\n", next_hdr_type);
skip_len = -1;
goto done;
break;
@@ -376,7 +376,7 @@ static int ppp_jump_to_layer(const char *raw_data, int raw_layer_type, int expe
break;
default:
- printf("TODO: jmp unsupport ppp pro:0x%x!\n", ntohs(pppoe_ses_hdr->ppp_protocol));
+ sapp_runtime_log(20, "ppp_jump_to_layer(): unsupport ppp pro:0x%x!\n", ntohs(pppoe_ses_hdr->ppp_protocol));
break;
}
@@ -535,7 +535,7 @@ static int vlan8021q_jump_to_layer(const char *raw_data, int raw_layer_type, in
break;
default:
- printf("TODO: jmp unsupport type in vlan8021q, 0x%x!\n", ntohs(vlan_hdr->type));
+ sapp_runtime_log(20, "vlan8021q_jump_to_layer(): unsupport type: 0x%x!\n", ntohs(vlan_hdr->type));
skip_len = -1;
}
@@ -654,7 +654,7 @@ const void *MESA_net_jump_to_layer(const void *raw_data, int raw_layer_type, in
case ADDR_TYPE_MPLS:
case ADDR_TYPE_GRE:
default:
- printf("TODO: jmp unsupport raw_layer_type:%d in MESA_net_jump_to_layer()!\n", raw_layer_type);
+ sapp_runtime_log(20, "MESA_net_jump_to_layer(): unsupport raw_layer_type:%d in MESA_net_jump_to_layer()!\n", raw_layer_type);
return NULL;
}
@@ -748,7 +748,7 @@ UINT8 net_layer_to_ipv4_protocol(int addr_type)
break;
default:
- printf("unknown ip4 protocolr:%d\n", addr_type);
+ sapp_runtime_log(20, "net_layer_to_ipv4_protocol(): unknown ip4 protocolr:%d\n", addr_type);
proto = 0xFF;
break;
}
@@ -774,7 +774,7 @@ UINT8 net_layer_to_ipv6_protocol(int addr_type)
break;
default:
- printf("unknown ip6 next-hdr:%d\n", addr_type);
+ sapp_runtime_log(20, "net_layer_to_ipv6_protocol(): unknown ip6 next-hdr:%d\n", addr_type);
return 0xFF;
break;
}
diff --git a/src/common/stream_addr_inet.c b/src/common/stream_addr_inet.c
index be13a26..4bcb7f7 100644
--- a/src/common/stream_addr_inet.c
+++ b/src/common/stream_addr_inet.c
@@ -539,14 +539,14 @@ static int __addr_mac_pton(char *addr_str, addr_continuous_bin_t *addr_bin_val)
for(i = 0; i < MAC_ADDR_LEN; i++){
tmp_bin_val = 0; /* ������, ������ֵ��䶼�ǻ���� */
if(isxdigit(*str_val)==0){
- printf("MAC string type error!\n");
+ sapp_runtime_log(20, "MAC string type error!\n");
return -1;
}
tmp_bin_val |= MESA_ascii_to_hex(*str_val) << 4;
str_val++;
if(isxdigit(*str_val)==0) {
- printf("MAC string type error!\n");
+ sapp_runtime_log(20, "MAC string type error!\n");
return -1;
}
tmp_bin_val |= MESA_ascii_to_hex(*str_val);
@@ -555,7 +555,7 @@ static int __addr_mac_pton(char *addr_str, addr_continuous_bin_t *addr_bin_val)
}
if(*str_val != '-'){
- printf("MAC string type error!\n");
+ sapp_runtime_log(20, "MAC string type error!\n");
return -1;
}
str_val++;
@@ -563,14 +563,14 @@ static int __addr_mac_pton(char *addr_str, addr_continuous_bin_t *addr_bin_val)
for(i = 0; i < MAC_ADDR_LEN; i++){
tmp_bin_val = 0; /* ������, ������ֵ��䶼�ǻ���� */
if(isxdigit(*str_val)==0){
- printf("MAC string type error!\n");
+ sapp_runtime_log(20, "MAC string type error!\n");
return -1;
}
tmp_bin_val |= MESA_ascii_to_hex(*str_val) << 4;
str_val++;
if(isxdigit(*str_val)==0) {
- printf("MAC string type error!\n");
+ sapp_runtime_log(20, "MAC string type error!\n");
return -1;
}
tmp_bin_val |= MESA_ascii_to_hex(*str_val);
diff --git a/src/dealpkt/callapp.c b/src/dealpkt/callapp.c
index dd2ed50..02a36ac 100644
--- a/src/dealpkt/callapp.c
+++ b/src/dealpkt/callapp.c
@@ -73,7 +73,8 @@ int stream_register_funtoArray(int funtype,char (*x)(void),stFunArray *pArrary,i
{
if(*pNum>=MAX_FUN_NUM)
{
- printf("too many funcitons ,max ip fun is %d\n",MAX_FUN_NUM);
+ sapp_runtime_log(30, "too many funcitons of type:%d, max number is %d\n", funtype, MAX_FUN_NUM);
+
return -1;
}
@@ -228,7 +229,7 @@ int stream_register_tcp_takeover (STREAM_CB_FUN_T x)
{
if(g_StreamTcpTakeover!=NULL)
{
- printf("only support one take over fun \n");
+ sapp_runtime_log(30, "only support one take over function!\n");
return -1;
}
g_StreamTcpTakeover=x;
diff --git a/src/dealpkt/deal_ipv4.c b/src/dealpkt/deal_ipv4.c
index f083a0c..5338c3c 100644
--- a/src/dealpkt/deal_ipv4.c
+++ b/src/dealpkt/deal_ipv4.c
@@ -690,13 +690,6 @@ int ipv4_entry(struct streaminfo_private *pfstream_pr, const void *this_layer_da
need_free = 1;
pstream->addr.pktipfragtype = PKT_TYPE_IPREBUILD | PKT_TYPE_IP_FRAG_LAST;
-#if IPV4_DEBUG
- /* ʹ�÷�Ƭicmp����IP��Ƭ����ģ�� */
- if(IPPROTO_ICMP == a_packet->ip_p)
- {
- test_print_icmp(a_packet);
- }
-#endif
}
/* 2017-05-11 lijia add,
@@ -838,6 +831,7 @@ int ipv4_frag_init(int thread_count, uint32 hash_size)
g_ipv4_frag_manage[i].frag_hash_table = ipv4_frag_htable_create();
if(NULL == g_ipv4_frag_manage[i].frag_hash_table){
printf("ipv4_frag_init(): MESA_htable_create fail!\n");
+ sapp_runtime_log(30, "ipv4_frag_init(): MESA_htable_create fail!\n");
goto err;
}
#else
diff --git a/src/dealpkt/deal_ipv6.c b/src/dealpkt/deal_ipv6.c
index c65cb3e..c783c53 100644
--- a/src/dealpkt/deal_ipv6.c
+++ b/src/dealpkt/deal_ipv6.c
@@ -768,11 +768,12 @@ int ipv6_entry(struct streaminfo_private *pfstream_pr, const void *this_layer_hd
#endif
if(0 == g_ipv6_decapsulation_enabled){
- static int __print_flag = 1; /* ����ֻ��ӡһ��, ����ˢ�� */
+ static int __print_flag = 1; /* ǰ�˾���ֻ��ӡһ��, ����ˢ�� */
if(__print_flag){
- printf("\033[41m[Warning]recv a IPv6 packet, but IPv6 module is not enable!\033[0m\n");
+ printf("\033[41m[Warning]recv a IPv6 packet, but IPv6 decapsulation is not enable!\033[0m\n");
__print_flag = 0;
}
+ sapp_runtime_log(20, "recv a IPv6 packet, but IPv6 decapsulation is not enable!\n");
return PASS;
}
@@ -844,9 +845,6 @@ int ipv6_entry(struct streaminfo_private *pfstream_pr, const void *this_layer_hd
thread_num, routedir, raw_pkt);
new_ip6h = ipv6_defrag(&(tmp_index.stream), thread_num, a_packet,
(struct ipv6_frag_hdr *)next_hdr_ptr, last_hdr-(uchar *)a_packet, raw_pkt);
-#if IPV6_DEBUG
- //printf("ipv6_frag_num: %u\n", ipv6_frag_num++);
-#endif
if(new_ip6h)
{
assert(new_ip6h->ip6_nxt_hdr != NEXTHDR_FRAGMENT); /* ǿ��У��, ��Ƭ����İ����������Ƿ�Ƭ, ����ѭ����!! */
diff --git a/src/dealpkt/deal_tcp.c b/src/dealpkt/deal_tcp.c
index 72d16a0..163ed0f 100644
--- a/src/dealpkt/deal_tcp.c
+++ b/src/dealpkt/deal_tcp.c
@@ -3036,7 +3036,7 @@ int set_stream_addr_transport(struct streaminfo_private *this_stream_pr, UINT16
this_addr->addrtype = ADDR_TYPE_IPV6;/* ����pappƽ̨, TCP-v6�����Ԫ��ʹ��'ADDR_TYPE_IPV6��ʾ' */
this_stream->addr.addrlen = sizeof(struct stream_tuple4_v6);
}else{
- printf("set_stream_addr_transport() error, addr type is not IPv4 or IPv6!\n");
+ //printf("set_stream_addr_transport() error, addr type is not IPv4 or IPv6!\n");
sapp_runtime_log(RLOG_LV_FATAL, "set_stream_addr_transport() error, addr type is not IPv4 or IPv6!\n");
abort();
}
diff --git a/src/dealpkt/deal_teredo.c b/src/dealpkt/deal_teredo.c
index 0790f61..70baffe 100644
--- a/src/dealpkt/deal_teredo.c
+++ b/src/dealpkt/deal_teredo.c
@@ -101,7 +101,7 @@ int teredo_entry(struct streaminfo_private *pfstream_pr,void *this_layer_data,in
}
else
{
- printf("TODO: jmp unsupport teredo hdr:0x%u!\n", *(unsigned int *)(next_layer_hdr));
+ sapp_runtime_log(20, "unsupport teredo hdr:0x%u!\n", *(unsigned int *)(next_layer_hdr));
return -1;
}
}
diff --git a/src/dealpkt/stream_manage.c b/src/dealpkt/stream_manage.c
index 10498db..6f02c37 100644
--- a/src/dealpkt/stream_manage.c
+++ b/src/dealpkt/stream_manage.c
@@ -913,7 +913,7 @@ int mkstreamhash_new(struct streaminfo_private *pstream_pr, int maxsize)
break;
default:
- printf("Unknown addr type:%d!", this_stream->addr.addrtype);
+ //printf("Unknown addr type:%d!", this_stream->addr.addrtype);
sapp_runtime_log(RLOG_LV_FATAL, "%s:%d: mkstreamhash_new() Unknown addr type:%d.\n", __FILE__, __LINE__, this_stream->addr.addrtype);
//assert(0);
return -1;
diff --git a/src/packet_io/cycle_pkt_dump_through_write_offset.c b/src/packet_io/cycle_pkt_dump_through_write_offset.c
index 2262154..acd8eec 100644
--- a/src/packet_io/cycle_pkt_dump_through_write_offset.c
+++ b/src/packet_io/cycle_pkt_dump_through_write_offset.c
@@ -160,7 +160,7 @@ retry:
break;
default:
- printf("pkt dump, read error:%s, ptr=%p, expect_count=%lu, left_count=%lu\n",
+ sapp_runtime_log(20, "pkt dump, read error:%s, ptr=%p, expect_count=%lu, left_count=%lu\n",
strerror(errno), save_ptr, expect_count, left_count);
break;
}
@@ -192,7 +192,7 @@ retry:
break;
default:
- printf("pkt dump, write error:%s\n", strerror(errno));
+ sapp_runtime_log(20, "pkt dump, write error:%s\n", strerror(errno));
/* д�������ռ䲻��, ��������, �����Ӱ���������������� */
break;
}
diff --git a/src/packet_io/packet_io.c b/src/packet_io/packet_io.c
index 07d6b97..53268db 100644
--- a/src/packet_io/packet_io.c
+++ b/src/packet_io/packet_io.c
@@ -901,7 +901,7 @@ static int packet_io_send_by_sys_routev6(MESA_send_handle *send_handle,int datal
sapp_gval_mthread_sys_stat_t *local_sys_stat = &sapp_global_val->mthread_volatile[send_handle->threadnum]->sys_stat;
if(0 == g_ipv6_send_packet_enabled){
- printf("IPv6 module is not support! Please check 'sapp.toml->ipv6_send_packet_enabled'.\n");
+ //printf("IPv6 module is not support! Please check 'sapp.toml->ipv6_send_packet_enabled'.\n");
sapp_runtime_log(RLOG_LV_FATAL, "%s:%d: IPv6 module is not support! Please check 'sapp.toml->ipv6_send_packet_enabled'.\n", __FILE__, __LINE__);
return -1;
}
@@ -963,7 +963,7 @@ static int packet_io_get_sendroute_mac(char dev_id, char link_id, unsigned char
return -1;
}else{
if(MESA_mac_pton(p_mac_addr, ':', (char *)out_mac_addr) < 0){
- printf("error, src mac:%s is not correct, for example:00:11:22:33:44:55\n", p_mac_addr);
+ sapp_runtime_log(20, "error, src mac:%s is not correct, for example:00:11:22:33:44:55\n", p_mac_addr);
return -1;
}
}
diff --git a/src/packet_io/packet_io_pcap.c b/src/packet_io/packet_io_pcap.c
index 7e6a9d0..2c92083 100644
--- a/src/packet_io/packet_io_pcap.c
+++ b/src/packet_io/packet_io_pcap.c
@@ -637,7 +637,7 @@ int pcap_dl_io_low_level_send(void *phandle, UINT8 *data,int datalen,
/* 2018-07-26 lijia add, �����˲���Լ��������̷߳�������, ���DZ��뷢��������ethernet��, �ײ�mac�������޷���� */
if(thread_num >= g_pcap_work_thread_num){
- printf("\033[1;31;40m send thread_seq is:%d, bigger than main.conf->thread_num(%d) !\033[0m\n", thread_num, g_pcap_work_thread_num);
+ sapp_runtime_log(30, "\033[1;31;40m send thread_seq is:%d, bigger than total thread num(%d) !\033[0m\n", thread_num, g_pcap_work_thread_num);
return -1;
}
diff --git a/src/packet_io/sapp_compat_wangyan_api.c b/src/packet_io/sapp_compat_wangyan_api.c
index 7c4a223..001ab7f 100644
--- a/src/packet_io/sapp_compat_wangyan_api.c
+++ b/src/packet_io/sapp_compat_wangyan_api.c
@@ -46,7 +46,7 @@ int Gserial_sendpacket_iplayer(int plug_id, struct streaminfo *stream,const char
if(plug_id <= 0 || plug_id > GSERIAL_PLUGID_MAX)
{
- printf("Plug id error, must be [1,%d]!\n", GSERIAL_PLUGID_MAX);
+ sapp_runtime_log(30, "Gserial_sendpacket_iplayer(): Plug id error, must be [1,%d]!\n", GSERIAL_PLUGID_MAX);
return -1;
}
diff --git a/src/packet_io/sendpacket.c b/src/packet_io/sendpacket.c
index 13f2b36..2f78994 100644
--- a/src/packet_io/sendpacket.c
+++ b/src/packet_io/sendpacket.c
@@ -1179,7 +1179,7 @@ static int calc_reserved_hdr_len(struct streaminfo *stream, int *net_layer_type)
}else if (STREAM_TYPE_UDP == stream->type){
reserved_hdr_len = sizeof(struct mesa_udp_hdr) + sizeof(struct mesa_ip4_hdr);
}else{
- printf("addr type is tuple4v4, but stream type is not TCP or UDP!\n");
+ //printf("addr type is tuple4v4, but stream type is not TCP or UDP!\n");
sapp_runtime_log(RLOG_LV_FATAL, "%s:%d: addr type is tuple4v4, but stream type is :%d, not TCP or UDP.\n", __FILE__, __LINE__, stream->type);
return -1;
//assert(0);
@@ -1202,7 +1202,7 @@ static int calc_reserved_hdr_len(struct streaminfo *stream, int *net_layer_type)
}else if (STREAM_TYPE_UDP == stream->type){
reserved_hdr_len = sizeof(struct mesa_udp_hdr) + sizeof(struct mesa_ip6_hdr);;
}else{
- printf("addr type is tuple4v6, but stream type is not TCP or UDP!\n");
+ //printf("addr type is tuple4v6, but stream type is not TCP or UDP!\n");
sapp_runtime_log(RLOG_LV_FATAL, "%s:%d: addr type is tuple4v6, but stream type is :%d, not TCP or UDP.\n", __FILE__, __LINE__, stream->type);
return -1;
//assert(0);
@@ -1227,7 +1227,7 @@ static int calc_reserved_hdr_len(struct streaminfo *stream, int *net_layer_type)
break;
case ADDR_TYPE_ARP:
- printf("Sendpacket use ARP!\n");
+ //printf("Sendpacket use ARP!\n");
sapp_runtime_log(RLOG_LV_FATAL, "%s:%d: Sendpacket use ARP.\n", __FILE__, __LINE__);
return -1;
//assert(0);
@@ -1302,7 +1302,7 @@ static int calc_reserved_hdr_len(struct streaminfo *stream, int *net_layer_type)
default:
/* to do */
- printf("calc_reserved_hdr_len(): Not support addrtype:%d\n", stream->addr.addrtype);
+ sapp_runtime_log(30, "calc_reserved_hdr_len(): Not support addrtype:%d\n", stream->addr.addrtype);
reserved_hdr_len = -1;
break;
}
@@ -1606,7 +1606,7 @@ static int build_net_layer_ipv6(struct streaminfo_private *stream_pr, int carry_
int threadnum = (int)stream_pr->stream_public.threadnum;
if(0 == g_ipv6_decapsulation_enabled){
- printf("IPv6 module is not support! Please set 'ipv6_decapsulation_enabled=1' in sapp.toml.\n");
+ sapp_runtime_log(30, "IPv6 module is not support! Please set 'ipv6_decapsulation_enabled=1' in sapp.toml.\n");
return -1;
}
@@ -2226,7 +2226,7 @@ static int build_net_layer_pkt(struct streaminfo_private *stream_pr, int carry_l
break;
default:
- printf("build_net_layer_pkt(): unsupport protocol:%d! TODO!\n", stream->addr.addrtype);
+ sapp_runtime_log(30, "build_net_layer_pkt(): unsupport addr type:%d!\n", stream->addr.addrtype);
goto err;
break;
}
@@ -2569,7 +2569,7 @@ int MESA_kill_connection(struct streaminfo *stream, const void *ext_raw_pkt)
case STREAM_TYPE_SOCKS5:
case STREAM_TYPE_HTTP_PROXY:
case STREAM_TYPE_PPPOE:
- printf("stream type: %d, not support kill_connection!\n", stream->type);
+ sapp_runtime_log(30, "stream type: %d, not support kill_connection!\n", stream->type);
return -1;
//assert(0);
break;
@@ -2617,7 +2617,7 @@ int MESA_kill_connection_feedback(struct streaminfo *stream, const void *ext_raw
case STREAM_TYPE_SOCKS5:
case STREAM_TYPE_HTTP_PROXY:
case STREAM_TYPE_PPPOE:
- printf("stream type: %d, not support kill_connection!\n", stream->type);
+ sapp_runtime_log(30, "stream type: %d, not support kill_connection!\n", stream->type);
return -1;
//assert(0);
break;
@@ -3163,7 +3163,7 @@ int MESA_sendpacket_ethlayer(int thread_num,const char *data, int data_len, unsi
if(data_len > MTU_MAX)
{
- printf("data length is more than MTU, %d\n", data_len);
+ sapp_runtime_log(30, "MESA_sendpacket_ethlayer(): data length is more than MTU, %d\n", data_len);
return -1;
}
@@ -3224,7 +3224,7 @@ unsigned char MESA_dir_reverse(unsigned char raw_dir)
static inline int dir_check(unsigned char raw_dir)
{
if(raw_dir & DIR_BIT_UNUSE_MASK){ /* ����ֻʹ������ߺ����λbit, �����������ֵ,˵�������ת��dirʱ���˴��� */
- printf("dir = 0x%x, is invalid, only the most or least significant bit can be used!", raw_dir);
+ sapp_runtime_log(30, "dir = 0x%x, is invalid, only the most or least significant bit can be used!", raw_dir);
//assert(0);
return -1;
}
@@ -3251,13 +3251,13 @@ static int __MESA_sendpacket_iplayer(int thread_index,const char *data, int dat
break;
default:
- printf("MESA_sendpacket_iplayer: Invalid cap_mode:%d\n", g_packet_io_cap_level);
+ sapp_runtime_log(30, "MESA_sendpacket_iplayer: Invalid cap_mode:%d\n", g_packet_io_cap_level);
//exit(1);
return -1;
}
if(data_len > (int)MTU_MAX-(int)sizeof(struct mesa_ethernet_hdr)){
- printf("TODO: MESA_sendpacket_iplayer error! datalen is more than MTU, need ip fragment!\n");
+ sapp_runtime_log(30,"TODO: MESA_sendpacket_iplayer error! datalen is more than MTU, need ip fragment!\n");
return -1;
}
@@ -3310,13 +3310,13 @@ int MESA_fakepacket_send_ipv4(int thread_index,u_int8_t ttl,
break;
default:
- printf("MESA_fakepacket_send_ipv4: Invalid cap_mode:%d\n", g_packet_io_cap_level);
+ sapp_runtime_log(30,"MESA_fakepacket_send_ipv4: Invalid cap_mode:%d\n", g_packet_io_cap_level);
//exit(1);
return -1;
}
if(payload_len > (int)MTU_MAX-(int)sizeof(struct mesa_ethernet_hdr)-(int)sizeof(struct mesa_ip4_hdr)){
- printf("TODO: MESA_fakepacket_send_ipv4 error! datalen is more than MTU, need ip fragment!\n");
+ sapp_runtime_log(30,"MESA_fakepacket_send_ipv4 error! datalen is more than MTU, need ip fragment!\n");
return -1;
}
@@ -3362,13 +3362,13 @@ int MESA_fakepacket_send_ipv4_detail(int thread_index,u_int8_t ttl,
break;
default:
- printf("MESA_fakepacket_send_ipv4: Invalid cap_mode:%d\n", g_packet_io_cap_level);
+ sapp_runtime_log(30,"MESA_fakepacket_send_ipv4: Invalid cap_mode:%d\n", g_packet_io_cap_level);
//exit(1);
return -1;
}
if(payload_len > (int)MTU_MAX-(int)sizeof(struct mesa_ethernet_hdr)-(int)sizeof(struct mesa_ip4_hdr)){
- printf("TODO: MESA_fakepacket_send_ipv4 error! datalen is more than MTU, need ip fragment!\n");
+ sapp_runtime_log(30,"MESA_fakepacket_send_ipv4 error! datalen is more than MTU, need ip fragment!\n");
return -1;
}
sendpacket_build_ipv4(payload_len, 0, ipid, 0 , ttl, protocol,
@@ -3414,13 +3414,13 @@ int MESA_fakepacket_send_tcp(int thread_index,u_int sip_host_order,u_int dip_hos
break;
default:
- printf("MESA_fakepacket_send_tcp: Invalid cap_mode:%d\n", g_packet_io_cap_level);
+ sapp_runtime_log(30,"MESA_fakepacket_send_tcp: Invalid cap_mode:%d\n", g_packet_io_cap_level);
//exit(1);
return -1;
}
if(payload_len > (int)MTU_MAX- (int)sizeof(struct mesa_ethernet_hdr)- (int)sizeof(struct mesa_ip4_hdr)- (int)sizeof(struct mesa_tcp_hdr)){
- printf("TODO: MESA_fakepacket_send_tcp error! datalen is more than MTU, need ip fragment!\n");
+ sapp_runtime_log(30,"MESA_fakepacket_send_tcp error! datalen is more than MTU, need ip fragment!\n");
return -1;
}
@@ -3475,13 +3475,13 @@ int MESA_fakepacket_send_tcp_detail(int thread_index,u_int sip_host_order,u_int
break;
default:
- printf("MESA_fakepacket_send_tcp: Invalid cap_mode:%d\n", g_packet_io_cap_level);
+ sapp_runtime_log(30,"MESA_fakepacket_send_tcp: Invalid cap_mode:%d\n", g_packet_io_cap_level);
//exit(1);
return -1;
}
if(payload_len > (int)MTU_MAX- (int)sizeof(struct mesa_ethernet_hdr)- (int)sizeof(struct mesa_ip4_hdr)- (int)sizeof(struct mesa_tcp_hdr)){
- printf("TODO: MESA_fakepacket_send_tcp error! datalen is more than MTU, need ip fragment!\n");
+ sapp_runtime_log(30,"MESA_fakepacket_send_tcp error! datalen is more than MTU, need ip fragment!\n");
return -1;
}
@@ -3530,13 +3530,13 @@ int MESA_fakepacket_send_udp(int thread_index, u_int sip_host_order, u_int dip_h
break;
default:
- printf("MESA_fakepacket_send_udp: Invalid cap_mode:%d\n", g_packet_io_cap_level);
+ sapp_runtime_log(30,"MESA_fakepacket_send_udp: Invalid cap_mode:%d\n", g_packet_io_cap_level);
//exit(1);
return -1;
}
if(payload_len > (int)MTU_MAX- (int)sizeof(struct mesa_ethernet_hdr)- (int)sizeof(struct mesa_ip4_hdr)- (int)sizeof(struct mesa_tcp_hdr)){
- printf("TODO: MESA_fakepacket_send_udp error! datalen is more than MTU, need ip fragment!\n");
+ sapp_runtime_log(30,"MESA_fakepacket_send_udp error! datalen is more than MTU, need ip fragment!\n");
return -1;
}
@@ -3588,13 +3588,13 @@ int MESA_fakepacket_send_udp_detail(int thread_index, u_int sip_host_order, u_in
break;
default:
- printf("MESA_fakepacket_send_udp: Invalid cap_mode:%d\n", g_packet_io_cap_level);
+ sapp_runtime_log(30,"MESA_fakepacket_send_udp: Invalid cap_mode:%d\n", g_packet_io_cap_level);
//exit(1);
return -1;
}
if(payload_len > (int)MTU_MAX- (int)sizeof(struct mesa_ethernet_hdr)- (int)sizeof(struct mesa_ip4_hdr)- (int)sizeof(struct mesa_tcp_hdr)){
- printf("TODO: MESA_fakepacket_send_udp error! datalen is more than MTU, need ip fragment!\n");
+ sapp_runtime_log(30,"MESA_fakepacket_send_udp error! datalen is more than MTU, need ip fragment!\n");
return -1;
}
@@ -4316,7 +4316,7 @@ int sapp_forward_current_pkt(const struct streaminfo *stream, unsigned int targe
//g_SysInputInfo[stream->threadnum][PKT_MARSIO_SND]++;
#else
- printf("sapp_forward_current_pkt() not support in non-marsio mode, TODO!\n");
+ sapp_runtime_log(30, "sapp_forward_current_pkt() not support in non-marsio mode, TODO!\n");
return -1;/* ����ģʽtodo */
#endif
diff --git a/src/project/project_requirement.c b/src/project/project_requirement.c
index 6a129f8..41ad0ba 100644
--- a/src/project/project_requirement.c
+++ b/src/project/project_requirement.c
@@ -107,7 +107,7 @@ int project_producer_register(const char *project_req_name, const char *project_
if(pro_req_id != -1){
if((NULL == free_cb )
&& (PROGECT_REQ_VALUE_TYPE_STRUCT == G_PROJECT_REQ_MANAGE[pro_req_id].project_req_type)){
- printf("project_producer_register() must implement 'free_cb' with 'struct' type!\n");
+ sapp_runtime_log(30, "project_producer_register() must implement 'free_cb' with 'struct' type!\n");
return -1;
}
G_PROJECT_REQ_MANAGE[pro_req_id].free_cb = free_cb;
diff --git a/version.txt b/version.txt
index 8537dee..02ec16a 100644
--- a/version.txt
+++ b/version.txt
@@ -3,16 +3,16 @@
VCS_TYPE="git"
VCS_BASENAME="v4.0"
VCS_UUID="efa070923d8398b49f41acda82b839d11eb75230"
-VCS_NUM="143"
-VCS_DATE="2019-12-11T17:59:45+0800"
-VCS_BRANCH="sapp_v4"
-VCS_TAG="v4.0.6"
+VCS_NUM="144"
+VCS_DATE="2019-12-18T11:25:47+0800"
+VCS_BRANCH="feature-v4.0-get-traffic"
+VCS_TAG="v4.0.7"
VCS_TICK="0"
VCS_EXTRA=""
VCS_ACTION_STAMP=""
-VCS_FULL_HASH="c3d16eed7e4ea689225cae69f3288b3918987570"
-VCS_SHORT_HASH="c3d16ee"
+VCS_FULL_HASH="422766471efa716d82f8d50f6041bb5944cd1d1a"
+VCS_SHORT_HASH="4227664"
VCS_WC_MODIFIED="1"