DDOS配置导入流量阈值(bps)/(pps)属性增加限制;配置导入模板Rule Name增加批注

This commit is contained in:
zhangwenqing
2019-01-15 16:03:12 +08:00
parent 9b270be708
commit a6c01d19ac
2 changed files with 32 additions and 2 deletions

View File

@@ -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)){

View File

@@ -378,16 +378,31 @@ public class CheckIpFormatThread implements Callable<String>{
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)) {