@Test public void testaddSrcIpMatches_v4NoSrcNetwork() { AceIpBuilder builder = new AceIpBuilder(); AceIpv4Builder v4builder = new AceIpv4Builder(); v4builder.setSourceIpv4Network(null); builder.setAceIpVersion(v4builder.build()); List<MatchInfoBase> flowMatches = AclServiceOFFlowBuilder.addSrcIpMatches(builder.build()); assertTrue(flowMatches.contains(MatchEthernetType.IPV4)); AclServiceTestUtils.verifyMatchFieldTypeDontExist(flowMatches, MatchIpv4Source.class); }
public static List<MatchInfoBase> addSrcIpMatches(AceIp acl) { List<MatchInfoBase> flowMatches = new ArrayList<>(); if (acl.getAceIpVersion() instanceof AceIpv4) { flowMatches.add(MatchEthernetType.IPV4); Ipv4Prefix srcNetwork = ((AceIpv4)acl.getAceIpVersion()).getSourceIpv4Network(); if (null != srcNetwork && !srcNetwork.getValue().equals(AclConstants.IPV4_ALL_NETWORK)) { flowMatches.add(new MatchIpv4Source(srcNetwork)); } } else if (acl.getAceIpVersion() instanceof AceIpv6) { flowMatches.add(MatchEthernetType.IPV6); Ipv6Prefix srcNetwork = ((AceIpv6)acl.getAceIpVersion()).getSourceIpv6Network(); if (null != srcNetwork && !srcNetwork.getValue().equals(AclConstants.IPV6_ALL_NETWORK)) { flowMatches.add(new MatchIpv6Source(srcNetwork)); } } return flowMatches; }
AclServiceOFFlowBuilder { public static List<MatchInfoBase> addSrcIpMatches(AceIp acl) { List<MatchInfoBase> flowMatches = new ArrayList<>(); if (acl.getAceIpVersion() instanceof AceIpv4) { flowMatches.add(MatchEthernetType.IPV4); Ipv4Prefix srcNetwork = ((AceIpv4)acl.getAceIpVersion()).getSourceIpv4Network(); if (null != srcNetwork && !srcNetwork.getValue().equals(AclConstants.IPV4_ALL_NETWORK)) { flowMatches.add(new MatchIpv4Source(srcNetwork)); } } else if (acl.getAceIpVersion() instanceof AceIpv6) { flowMatches.add(MatchEthernetType.IPV6); Ipv6Prefix srcNetwork = ((AceIpv6)acl.getAceIpVersion()).getSourceIpv6Network(); if (null != srcNetwork && !srcNetwork.getValue().equals(AclConstants.IPV6_ALL_NETWORK)) { flowMatches.add(new MatchIpv6Source(srcNetwork)); } } return flowMatches; } }
AclServiceOFFlowBuilder { public static List<MatchInfoBase> addSrcIpMatches(AceIp acl) { List<MatchInfoBase> flowMatches = new ArrayList<>(); if (acl.getAceIpVersion() instanceof AceIpv4) { flowMatches.add(MatchEthernetType.IPV4); Ipv4Prefix srcNetwork = ((AceIpv4)acl.getAceIpVersion()).getSourceIpv4Network(); if (null != srcNetwork && !srcNetwork.getValue().equals(AclConstants.IPV4_ALL_NETWORK)) { flowMatches.add(new MatchIpv4Source(srcNetwork)); } } else if (acl.getAceIpVersion() instanceof AceIpv6) { flowMatches.add(MatchEthernetType.IPV6); Ipv6Prefix srcNetwork = ((AceIpv6)acl.getAceIpVersion()).getSourceIpv6Network(); if (null != srcNetwork && !srcNetwork.getValue().equals(AclConstants.IPV6_ALL_NETWORK)) { flowMatches.add(new MatchIpv6Source(srcNetwork)); } } return flowMatches; } private  AclServiceOFFlowBuilder(); }
AclServiceOFFlowBuilder { public static List<MatchInfoBase> addSrcIpMatches(AceIp acl) { List<MatchInfoBase> flowMatches = new ArrayList<>(); if (acl.getAceIpVersion() instanceof AceIpv4) { flowMatches.add(MatchEthernetType.IPV4); Ipv4Prefix srcNetwork = ((AceIpv4)acl.getAceIpVersion()).getSourceIpv4Network(); if (null != srcNetwork && !srcNetwork.getValue().equals(AclConstants.IPV4_ALL_NETWORK)) { flowMatches.add(new MatchIpv4Source(srcNetwork)); } } else if (acl.getAceIpVersion() instanceof AceIpv6) { flowMatches.add(MatchEthernetType.IPV6); Ipv6Prefix srcNetwork = ((AceIpv6)acl.getAceIpVersion()).getSourceIpv6Network(); if (null != srcNetwork && !srcNetwork.getValue().equals(AclConstants.IPV6_ALL_NETWORK)) { flowMatches.add(new MatchIpv6Source(srcNetwork)); } } return flowMatches; } private  AclServiceOFFlowBuilder(); @Nullable static Map<String, List<MatchInfoBase>> programIpFlow(Matches matches); static Map<String,List<MatchInfoBase>> programEtherFlow(AceIp acl); static Map<String,List<MatchInfoBase>> programOtherProtocolFlow(AceIp acl); static Map<String,List<MatchInfoBase>> programIcmpFlow(AceIp acl); static Map<String,List<MatchInfoBase>> programTcpFlow(AceIp acl); static Map<String,List<MatchInfoBase>> programUdpFlow(AceIp acl); static List<MatchInfoBase> addSrcIpMatches(AceIp acl); static List<MatchInfoBase> addDstIpMatches(AceIp acl); static List<MatchInfoBase> addLPortTagMatches(int lportTag, int conntrackState, int conntrackMask,
            Class<? extends ServiceModeBase> serviceMode); static List<InstructionInfo> getDropInstructionInfo(); static List<InstructionInfo> getResubmitInstructionInfo(short tableId); static List<InstructionInfo> getGotoInstructionInfo(short gotoTableId); static Map<Integer,Integer> getLayer4MaskForRange(int portMin, int portMax); }
AclServiceOFFlowBuilder { public static List<MatchInfoBase> addSrcIpMatches(AceIp acl) { List<MatchInfoBase> flowMatches = new ArrayList<>(); if (acl.getAceIpVersion() instanceof AceIpv4) { flowMatches.add(MatchEthernetType.IPV4); Ipv4Prefix srcNetwork = ((AceIpv4)acl.getAceIpVersion()).getSourceIpv4Network(); if (null != srcNetwork && !srcNetwork.getValue().equals(AclConstants.IPV4_ALL_NETWORK)) { flowMatches.add(new MatchIpv4Source(srcNetwork)); } } else if (acl.getAceIpVersion() instanceof AceIpv6) { flowMatches.add(MatchEthernetType.IPV6); Ipv6Prefix srcNetwork = ((AceIpv6)acl.getAceIpVersion()).getSourceIpv6Network(); if (null != srcNetwork && !srcNetwork.getValue().equals(AclConstants.IPV6_ALL_NETWORK)) { flowMatches.add(new MatchIpv6Source(srcNetwork)); } } return flowMatches; } private  AclServiceOFFlowBuilder(); @Nullable static Map<String, List<MatchInfoBase>> programIpFlow(Matches matches); static Map<String,List<MatchInfoBase>> programEtherFlow(AceIp acl); static Map<String,List<MatchInfoBase>> programOtherProtocolFlow(AceIp acl); static Map<String,List<MatchInfoBase>> programIcmpFlow(AceIp acl); static Map<String,List<MatchInfoBase>> programTcpFlow(AceIp acl); static Map<String,List<MatchInfoBase>> programUdpFlow(AceIp acl); static List<MatchInfoBase> addSrcIpMatches(AceIp acl); static List<MatchInfoBase> addDstIpMatches(AceIp acl); static List<MatchInfoBase> addLPortTagMatches(int lportTag, int conntrackState, int conntrackMask,
            Class<? extends ServiceModeBase> serviceMode); static List<InstructionInfo> getDropInstructionInfo(); static List<InstructionInfo> getResubmitInstructionInfo(short tableId); static List<InstructionInfo> getGotoInstructionInfo(short gotoTableId); static Map<Integer,Integer> getLayer4MaskForRange(int portMin, int portMax);  }