summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author刘学利 <[email protected]>2020-01-07 17:49:18 +0800
committer刘学利 <[email protected]>2020-01-07 17:49:18 +0800
commit1c9d36df0a93eecfb1ee683160e38c8516a88fd1 (patch)
treeb136279ea8d7185fe660ae243985b3fc734f6a7d
parent2c249d671606aa5df8b81403cc4ddadb0f9ef3ae (diff)
parent0d8e315ad5ee0d57d80ec577e2ea4c2a00324c13 (diff)
Merge branch 'develop' into 'master'v1.0.2
Develop See merge request tango/fw_dns_plug!1
-rw-r--r--.gitlab-ci.yml21
-rw-r--r--src/fw_dns_plug.cpp34
-rw-r--r--src/fw_dns_rule.cpp4
-rw-r--r--src/fw_dns_rule.h2
4 files changed, 10 insertions, 51 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 617d530..954bff5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -7,12 +7,10 @@ variables:
GIT_STRATEGY: "clone"
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
-
stages:
- build
- package
- release
- - docker
.build_before_script:
before_script:
@@ -90,7 +88,7 @@ fw_dns_plug_release-release:
- share
variables:
ARTIFACTS_JOB: "fw_dns_plug_release"
- PROJECT_NAME: "fw_dns_plug"
+ PROJECT_NAME: "fw-dns-plug"
USER_DEFINE: "release"
only:
- tags
@@ -104,20 +102,9 @@ fw_dns_plug_debug-release:
- share
variables:
ARTIFACTS_JOB: "fw_dns_plug_debug"
- PROJECT_NAME: "fw_dns_plug"
- USER_DEFINE: "release"
+ PROJECT_NAME: "fw-dns-plug"
+ USER_DEFINE: "debug"
only:
- tags
script:
- - /bin/bash -x ./autorelease.sh $CI_API_V4_URL $CI_PROJECT_URL $CI_PROJECT_ID $CI_TOKEN $CI_COMMIT_TAG $ARTIFACTS_JOB $PROJECT_NAME $USER_DEFINE
-
-build-docker:
- stage: docker
- script:
- - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- - docker build -t $IMAGE_TAG .
- - docker push $IMAGE_TAG
- tags:
- - share
- only:
- - master \ No newline at end of file
+ - /bin/bash -x ./autorelease.sh $CI_API_V4_URL $CI_PROJECT_URL $CI_PROJECT_ID $CI_TOKEN $CI_COMMIT_TAG $ARTIFACTS_JOB $PROJECT_NAME $USER_DEFINE \ No newline at end of file
diff --git a/src/fw_dns_plug.cpp b/src/fw_dns_plug.cpp
index 08e67ec..fe149c9 100644
--- a/src/fw_dns_plug.cpp
+++ b/src/fw_dns_plug.cpp
@@ -11,40 +11,12 @@
#include "tsg_rule.h"
#include "tsg_send_log.h"
#include "fw_dns_plug.h"
-
+#include "tsg_statistic.h"
char *g_fw_dns_conffile=(char *)"tsgconf/main.conf";
-char FW_DNS_PLUG_VERSION_20191209=0;
+char FW_DNS_PLUG_VERSION_20191220=0;
struct _fw_dns_plug g_fw_dns_plug_info;
-enum TSG_ETHOD_TYPE
-{
- TSG_METHOD_TYPE_UNKNOWN=0,
- TSG_METHOD_TYPE_DROP,
- TSG_METHOD_TYPE_REDIRECTION,
- TSG_METHOD_TYPE_MAX
-};
-
-const struct _str2index method2index[TSG_METHOD_TYPE_MAX]={ {TSG_METHOD_TYPE_UNKNOWN, 7, (char *)"unknown"},
- {TSG_METHOD_TYPE_DROP, 4, (char *)"drop"},
- {TSG_METHOD_TYPE_REDIRECTION, 8, (char *)"redirect"}
- };
-
-int tsg_get_method_id(char *method)
-{
- int i=0;
-
- for(i=0; i<TSG_METHOD_TYPE_MAX; i++)
- {
- if(method2index[i].len==(int)strlen(method) && (strncasecmp(method2index[i].type, method, method2index[i].len))==0)
- {
- return method2index[i].index;
- }
- }
-
- return -1;
-}
-
static int get_answer_ttl(cJSON *object)
{
int min=0;
@@ -354,7 +326,7 @@ static int fw_dns_send_log(struct streaminfo *a_stream, dns_info_t *dns_info, st
log_msg.result_num=result_num;
tsg_send_log(g_tsg_log_instance, handle, &log_msg, thread_seq);
-
+ tsg_set_policy_flow(a_stream, result, a_stream->threadnum);
return 0;
}
diff --git a/src/fw_dns_rule.cpp b/src/fw_dns_rule.cpp
index 3756a4d..b564970 100644
--- a/src/fw_dns_rule.cpp
+++ b/src/fw_dns_rule.cpp
@@ -15,7 +15,7 @@
fw_dns_rule_t g_fw_dns_rule_info;
char FW_DNS_RULE_VERSION_20191201=0;
-struct _str2index str2index[]={{DNS_TYPE_CNAME, 5, (char *)"CNAME"},
+struct _dns_str2idx str2index[]={{DNS_TYPE_CNAME, 5, (char *)"CNAME"},
{DNS_TYPE_MX, 2, (char *)"MX"},
{DNS_TYPE_A, 1, (char *)"A"},
{DNS_TYPE_NS, 2, (char *)"NS"},
@@ -28,7 +28,7 @@ int fw_dns_type2index(char *type)
{
int i=0;
- for(i=0; i<(int)(sizeof(str2index)/sizeof(struct _str2index)); i++)
+ for(i=0; i<(int)(sizeof(str2index)/sizeof(struct _dns_str2idx)); i++)
{
if(str2index[i].len==(int)strlen(type) && (strncasecmp(str2index[i].type, type, str2index[i].len))==0)
{
diff --git a/src/fw_dns_rule.h b/src/fw_dns_rule.h
index 5933b71..a0eea1c 100644
--- a/src/fw_dns_rule.h
+++ b/src/fw_dns_rule.h
@@ -5,7 +5,7 @@
#define MAX_TABLE_NAME_LEN 32
-struct _str2index
+struct _dns_str2idx
{
int index;
int len;