From 3159e791247bffc6f7ee42f0f5c83b95f4bfa556 Mon Sep 17 00:00:00 2001 From: chenlinghy Date: Tue, 19 Jan 2021 10:13:06 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=E4=BF=AE=E6=94=B9=E5=A4=84?= =?UTF-8?q?=E7=BD=AE=E4=BB=BB=E5=8A=A1=E6=8E=A5=E5=8F=A3=E5=85=A5=E5=8F=82?= =?UTF-8?q?=E6=94=BB=E5=87=BB=E7=B1=BB=E5=9E=8B=EF=BC=8C=E4=B8=8D=E4=BC=A0?= =?UTF-8?q?=E6=94=BB=E5=87=BB=E7=B1=BB=E5=9E=8B=E6=97=B6=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=97=A0=E6=94=BB=E5=87=BB=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dispose/controller/DisposeTaskController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/dispose/controller/DisposeTaskController.java b/src/main/java/com/dispose/controller/DisposeTaskController.java index a21267f9..f0591291 100644 --- a/src/main/java/com/dispose/controller/DisposeTaskController.java +++ b/src/main/java/com/dispose/controller/DisposeTaskController.java @@ -104,7 +104,8 @@ public class DisposeTaskController { String endTime = String.valueOf(req.getDisposeTime() == -1 ? 5256000: req.getDisposeTime()); NetflowDirection netDir = CommonEnumHandler.codeOf(NetflowDirection.class, Optional.ofNullable(req.getFlowDirection()).orElse(2)); - Long attackType = DDoSAttackType.getTypeMaskFromAttackType(new Integer[]{DDoSAttackType.RST_FLOOD.getValue()}); + Long attackType = DDoSAttackType.getTypeMaskFromAttackType(Optional.ofNullable(req.getAttackType()) + .orElse(new Integer[]{DDoSAttackType.NONE_ATTACKS.getValue()})); Integer flowBand = Optional.ofNullable(req.getFlowBandwidth()) .orElse(DisposeConfigValue.DEFAULT_DISPOSE_BANDWIDTH); @@ -184,7 +185,8 @@ public class DisposeTaskController { Optional.ofNullable(req.getFlowDirection()) .orElse(2))) .attackType(DDoSAttackType.getTypeMaskFromAttackType( - new Integer[]{DDoSAttackType.RST_FLOOD.getValue()})) + Optional.ofNullable(req.getAttackType()) + .orElse(new Integer[]{DDoSAttackType.NONE_ATTACKS.getValue()}))) .flowBandWidth(Optional.ofNullable(req.getFlowBandwidth()) .orElse(DisposeConfigValue.DEFAULT_DISPOSE_BANDWIDTH)) .build(); @@ -234,7 +236,8 @@ public class DisposeTaskController { String endTime = String.valueOf(req.getDisposeTime()); NetflowDirection netDir = CommonEnumHandler.codeOf(NetflowDirection.class, Optional.ofNullable(req.getFlowDirection()).orElse(2)); - Long attackType = DDoSAttackType.getTypeMaskFromAttackType(new Integer[]{DDoSAttackType.RST_FLOOD.getValue()}); + Long attackType = DDoSAttackType.getTypeMaskFromAttackType(Optional.ofNullable(req.getAttackType()) + .orElse(new Integer[]{DDoSAttackType.NONE_ATTACKS.getValue()})); Integer flowBand = Optional.ofNullable(req.getFlowBandwidth()) .orElse(DisposeConfigValue.DEFAULT_DISPOSE_BANDWIDTH);