Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ce1b2976d | ||
|
|
3b4db47008 | ||
|
|
5a2181eb1e |
17
.gitignore
vendored
Normal file
17
.gitignore
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
SI/
|
||||||
|
*.log
|
||||||
|
*.o
|
||||||
|
*.so
|
||||||
|
*.si4project/
|
||||||
|
*.a
|
||||||
|
*.d
|
||||||
|
build/
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
core.*
|
||||||
|
cmake-build-*
|
||||||
|
GPATH
|
||||||
|
GTAGS
|
||||||
|
GRTAGS
|
||||||
|
src/tags
|
||||||
|
version.txt
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
work_path=$1
|
work_path=$1
|
||||||
branch=`git status | grep branch | awk '{print $NF}'`
|
branch=`git status | grep branch | awk '{print $NF}'`
|
||||||
git log --branches=$branch --no-merges --date=local --show-signature --pretty="* %ad %an %ae %nhash: %H%ncommit:%n%B" | awk -F"-" '{print "- "$0}' | sed 's/- \*/\*/g' | sed 's/- $//g' | sed 's/-/ -/g' | sed 's/[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}//g' > $work_path/changelog.txt
|
git log --branches=$branch --no-merges --date=local --show-signature --pretty="* %cd %an %ae %nhash: %H%ncommit:%n%B" | awk -F"-" '{print "- "$0}' | sed 's/- \*/\*/g' | sed 's/- $//g' | sed 's/-/ -/g' | sed 's/[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}//g' > $work_path/changelog.txt
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ char *g_fw_dns_conffile=(char *)"tsgconf/main.conf";
|
|||||||
|
|
||||||
static int fw_dns_send_log(struct streaminfo *a_stream, dns_info_t *dns_info, struct Maat_rule_t *result, int result_num, int thread_seq)
|
static int fw_dns_send_log(struct streaminfo *a_stream, dns_info_t *dns_info, struct Maat_rule_t *result, int result_num, int thread_seq)
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0,cname_flag=0;
|
||||||
dns_rr_t *rr=NULL;
|
dns_rr_t *rr=NULL;
|
||||||
tsg_log_t log_msg;
|
tsg_log_t log_msg;
|
||||||
int dns_sec=1;
|
int dns_sec=1;
|
||||||
@@ -90,33 +90,41 @@ static int fw_dns_send_log(struct streaminfo *a_stream, dns_info_t *dns_info, st
|
|||||||
{
|
{
|
||||||
item=cJSON_CreateString((const char *)rr->rdata.cname);
|
item=cJSON_CreateString((const char *)rr->rdata.cname);
|
||||||
cJSON_AddItemToArray(cname_array, item);
|
cJSON_AddItemToArray(cname_array, item);
|
||||||
|
cname_flag=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cname=cJSON_PrintUnformatted(cname_array);
|
if(cname_flag==1)
|
||||||
if(cname!=NULL && strlen(cname)>0)
|
|
||||||
{
|
{
|
||||||
TLD_append(handle, (char *)"dns_cname", (void *)cname, TLD_TYPE_STRING);
|
cname=cJSON_PrintUnformatted(cname_array);
|
||||||
cJSON_free(cname);
|
if(cname!=NULL)
|
||||||
cname=NULL;
|
{
|
||||||
|
TLD_append(handle, (char *)"dns_cname", (void *)cname, TLD_TYPE_STRING);
|
||||||
|
cJSON_free(cname);
|
||||||
|
cname=NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cJSON_Delete(cname_array);
|
cJSON_Delete(cname_array);
|
||||||
cname_array=NULL;
|
cname_array=NULL;
|
||||||
|
|
||||||
cJSON * object=cJSON_CreateObject();
|
|
||||||
get_rr_str2json(object, dns_info, &dns_sec);
|
|
||||||
rr_buf=cJSON_PrintUnformatted(object);
|
|
||||||
TLD_append(handle, (char *)"dns_rr", (void *)rr_buf, TLD_TYPE_STRING);
|
|
||||||
|
|
||||||
cJSON_Delete(object);
|
|
||||||
object=NULL;
|
|
||||||
|
|
||||||
cJSON_free(rr_buf);
|
if(dns_info->rr_count>0)
|
||||||
rr_buf=NULL;
|
{
|
||||||
|
cJSON * object=cJSON_CreateObject();
|
||||||
|
get_rr_str2json(object, dns_info, &dns_sec);
|
||||||
|
rr_buf=cJSON_PrintUnformatted(object);
|
||||||
|
if(rr_buf!=NULL)
|
||||||
|
{
|
||||||
|
TLD_append(handle, (char *)"dns_rr", (void *)rr_buf, TLD_TYPE_STRING);
|
||||||
|
cJSON_free(rr_buf);
|
||||||
|
rr_buf=NULL;
|
||||||
|
}
|
||||||
|
cJSON_Delete(object);
|
||||||
|
object=NULL;
|
||||||
|
}
|
||||||
|
|
||||||
TLD_append(handle, (char *)"dns_sub", (void *)(long)dns_sec, TLD_TYPE_LONG);
|
TLD_append(handle, (char *)"dns_sub", (void *)(long)dns_sec, TLD_TYPE_LONG);
|
||||||
|
|
||||||
TLD_append(handle, (char *)"common_schema_type", (void *)"DNS", TLD_TYPE_STRING);
|
TLD_append(handle, (char *)"common_schema_type", (void *)"DNS", TLD_TYPE_STRING);
|
||||||
|
|
||||||
log_msg.a_stream=a_stream;
|
log_msg.a_stream=a_stream;
|
||||||
@@ -242,8 +250,8 @@ extern "C" char FW_DNS_PLUG_ENTRY(stSessionInfo* session_info, void **pme, int
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fw_dns_send_log(a_stream, dns_info, result, hit_num, thread_seq);
|
|
||||||
tsg_notify_hited_monitor_result(a_stream, result, hit_num, thread_seq);
|
tsg_notify_hited_monitor_result(a_stream, result, hit_num, thread_seq);
|
||||||
|
fw_dns_send_log(a_stream, dns_info, result, hit_num, thread_seq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user