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;