From a6c01d19acadb8817386d2ee5a69c47dce7d20d9 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Tue, 15 Jan 2019 16:03:12 +0800 Subject: [PATCH] =?UTF-8?q?DDOS=E9=85=8D=E7=BD=AE=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=B5=81=E9=87=8F=E9=98=88=E5=80=BC(bps)/(pps)=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E5=A2=9E=E5=8A=A0=E9=99=90=E5=88=B6=EF=BC=9B=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=AF=BC=E5=85=A5=E6=A8=A1=E6=9D=BFRule=20Name?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=B9=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/util/excel/ExportExcel.java | 19 +++++++++++++++++-- .../excel/thread/CheckIpFormatThread.java | 15 +++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nis/util/excel/ExportExcel.java b/src/main/java/com/nis/util/excel/ExportExcel.java index 932c07abd..b42ab7a7a 100644 --- a/src/main/java/com/nis/util/excel/ExportExcel.java +++ b/src/main/java/com/nis/util/excel/ExportExcel.java @@ -143,6 +143,16 @@ public class ExportExcel { String defaultValue=""; int index=0; String[] titleInfo=new String[3]; + + // Rule Name + if("config_describe".equals(headerStr)) { + commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; + index++; + //1、非空 + commentStr=commentStr+"▶"+msgProp.getProperty("required")+"\n"; + index++; + } + //p2p_hash_type if("p2p_hash_type".equals(headerStr)){ commentStr=""; @@ -403,13 +413,17 @@ public class ExportExcel { if("bps_threadshold".equals(headerStr)){ commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; index++; - commentStr=commentStr+msgProp.getProperty("input_integer")+"\n"; + commentStr=commentStr+"▶"+msgProp.getProperty("input_integer")+"\n"; + index++; + commentStr=commentStr+"▶"+msgProp.getProperty("min_value")+"1000000\n"; index++; } if("pps_threadshold".equals(headerStr)){ commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n"; index++; - commentStr=commentStr+msgProp.getProperty("input_integer")+"\n"; + commentStr=commentStr+"▶"+msgProp.getProperty("input_integer")+"\n"; + index++; + commentStr=commentStr+"▶"+msgProp.getProperty("min_value")+"1000\n"; index++; } if("group".equals(headerStr)) { @@ -1099,6 +1113,7 @@ public class ExportExcel { if(StringUtil.isEmpty(defaultValue)){ defaultValue="0"; } + defaultValue = region.getFunctionId().equals(301)?"1":defaultValue; } /*}*/ /*if(StringUtil.isEmpty(commentStr)){ diff --git a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java index d8c7ce563..83def261f 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java @@ -378,16 +378,31 @@ public class CheckIpFormatThread implements Callable{ String.format(prop.getProperty("is_incorrect"), prop.getProperty("antiddos_protocol")) + ";"); } + if(bpsThreadshold==null) { errInfo.append( String.format(prop.getProperty("can_not_null"), prop.getProperty("bps_threadshold")) + ";"); + }else { + if(bpsThreadshold < 1000000) { + errInfo.append(prop.getProperty("bps_threadshold")+prop.getProperty("min_value")+"1000000;"); + }else if(String.valueOf(bpsThreadshold).length() > 18) { + errInfo.append(prop.getProperty("bps_threadshold")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":18") + ";"); + } } + if(ppsThreadshold==null) { errInfo.append( String.format(prop.getProperty("can_not_null"), prop.getProperty("pps_threadshold")) + ";"); + }else { + if(ppsThreadshold < 1000) { + errInfo.append(prop.getProperty("pps_threadshold")+prop.getProperty("min_value")+"1000;"); + }else if(String.valueOf(ppsThreadshold).length() > 18) { + errInfo.append(prop.getProperty("pps_threadshold")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":18") + ";"); + } } + if("TCP_SYN".equals(antiddosProtocol)) { baseIpCfg.setProtocol(6); }else if("UDP_NTP".equals(antiddosProtocol)) {