From f4a4fff3c145d799a05f71f2318e0a1309e4fbf3 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Fri, 20 Dec 2019 11:09:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=BB=E6=96=AD=E6=96=B9=E5=BC=8F=E7=94=B1?= =?UTF-8?q?=E6=80=BB=E6=8E=A7=E6=8F=90=E4=BE=9B=E5=87=BD=E6=95=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fw_dns_plug.cpp | 34 +++------------------------------- src/fw_dns_rule.cpp | 4 ++-- src/fw_dns_rule.h | 2 +- 3 files changed, 6 insertions(+), 34 deletions(-) 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; ithreadnum); 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;