From f2ebecc67822304d7ecad41e64f808008bb4cc45 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Mon, 6 Dec 2021 11:37:05 +0300 Subject: TSG-8795: 适配Sub Action(method)参数rst修改为reset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/tsg_rule.h | 1 + src/tsg_action.cpp | 1 + src/tsg_rule.cpp | 2 ++ 3 files changed, 4 insertions(+) diff --git a/inc/tsg_rule.h b/inc/tsg_rule.h index 36a76a8..b40c481 100644 --- a/inc/tsg_rule.h +++ b/inc/tsg_rule.h @@ -23,6 +23,7 @@ enum TSG_METHOD_TYPE TSG_METHOD_TYPE_REDIRECTION, TSG_METHOD_TYPE_BLOCK, TSG_METHOD_TYPE_RESET, + TSG_METHOD_TYPE_RST, TSG_METHOD_TYPE_ALERT, TSG_METHOD_TYPE_RATE_LIMIT, TSG_METHOD_TYPE_MIRRORED, diff --git a/src/tsg_action.cpp b/src/tsg_action.cpp index 6293e0a..97fefbd 100644 --- a/src/tsg_action.cpp +++ b/src/tsg_action.cpp @@ -790,6 +790,7 @@ unsigned char tsg_deal_deny_action(const struct streaminfo *a_stream, Maat_rule_ local_state=set_drop_stream(a_stream, protocol); } break; + case TSG_METHOD_TYPE_RST: case TSG_METHOD_TYPE_RESET: local_state=do_action_reset(a_stream, p_result, protocol); break; diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp index 0103580..0553a36 100644 --- a/src/tsg_rule.cpp +++ b/src/tsg_rule.cpp @@ -37,6 +37,7 @@ const struct _str2index method2index[TSG_METHOD_TYPE_MAX]={ {TSG_METHOD_TYPE_UNK {TSG_METHOD_TYPE_DROP, 4, (char *)"drop"}, {TSG_METHOD_TYPE_REDIRECTION, 8, (char *)"redirect"}, {TSG_METHOD_TYPE_BLOCK, 5, (char *)"block"}, + {TSG_METHOD_TYPE_RESET, 5, (char *)"reset"}, {TSG_METHOD_TYPE_RESET, 3, (char *)"rst"}, {TSG_METHOD_TYPE_ALERT, 5, (char *)"alert"}, {TSG_METHOD_TYPE_RATE_LIMIT, 10, (char *)"rate_limit"}, @@ -956,6 +957,7 @@ static struct compile_user_region *parse_deny_user_region(cJSON *object) user_region->drop_para=(struct drop_user_para *)calloc(1, sizeof(struct drop_user_para)); get_integer_from_json(object, "send_icmp_unreachable", &(user_region->drop_para->send_icmp_unreachable_enable)); break; + case TSG_METHOD_TYPE_RST: case TSG_METHOD_TYPE_RESET: break; case TSG_METHOD_TYPE_TAMPER: -- cgit v1.2.3