@Override public void applyTo( HeaderSpace.Builder headerSpaceBuilder, JuniperConfiguration jc, Warnings w, Configuration c) { PrefixList pl = jc.getMasterLogicalSystem().getPrefixLists().get(_name); if (pl != null) { if (pl.getIpv6()) { return; } RouteFilterList sourcePrefixList = c.getRouteFilterLists().get(_name); // if referenced prefix list is empty, it should not match anything if (sourcePrefixList.getLines().isEmpty()) { headerSpaceBuilder.addSrcIp(EmptyIpSpace.INSTANCE); return; } headerSpaceBuilder.addSrcIp( AclIpSpace.union( sourcePrefixList.getMatchingIps().stream() .map(IpWildcard::toIpSpace) .collect(ImmutableList.toImmutableList()))); } else { w.redFlag("Reference to undefined source prefix-list: \"" + _name + "\""); } } }
@Override public void applyTo( HeaderSpace.Builder headerSpaceBuilder, JuniperConfiguration jc, Warnings w, Configuration c) { PrefixList pl = jc.getMasterLogicalSystem().getPrefixLists().get(_name); if (pl != null) { if (pl.getIpv6()) { return; } RouteFilterList sourcePrefixList = c.getRouteFilterLists().get(_name); // if referenced prefix list is empty, it should not match anything if (sourcePrefixList.getLines().isEmpty()) { headerSpaceBuilder.addNotSrcIp(EmptyIpSpace.INSTANCE); return; } headerSpaceBuilder.addNotSrcIp( AclIpSpace.union( sourcePrefixList.getMatchingIps().stream() .map(IpWildcard::toIpSpace) .collect(ImmutableList.toImmutableList()))); } else { w.redFlag("Reference to undefined source prefix-list: \"" + _name + "\""); } } }
@Override public void applyTo( HeaderSpace.Builder headerSpaceBuilder, JuniperConfiguration jc, Warnings w, Configuration c) { PrefixList pl = jc.getMasterLogicalSystem().getPrefixLists().get(_name); if (pl != null) { if (pl.getIpv6()) { return; } RouteFilterList destinationPrefixList = c.getRouteFilterLists().get(_name); // if referenced prefix list is empty, it should not match anything if (destinationPrefixList.getLines().isEmpty()) { headerSpaceBuilder.addDstIp(EmptyIpSpace.INSTANCE); return; } headerSpaceBuilder.addDstIp( AclIpSpace.union( destinationPrefixList.getMatchingIps().stream() .map(IpWildcard::toIpSpace) .collect(ImmutableList.toImmutableList()))); } else { w.redFlag("Reference to undefined destination prefix-list: \"" + _name + "\""); } } }
@Override public void applyTo( HeaderSpace.Builder headerSpaceBuilder, JuniperConfiguration jc, Warnings w, Configuration c) { PrefixList pl = jc.getMasterLogicalSystem().getPrefixLists().get(_name); if (pl != null) { if (pl.getIpv6()) { return; } RouteFilterList prefixList = c.getRouteFilterLists().get(_name); // if referenced prefix list is empty, it should not match anything if (prefixList.getLines().isEmpty()) { headerSpaceBuilder.addSrcOrDstIp(EmptyIpSpace.INSTANCE); return; } headerSpaceBuilder.addSrcOrDstIp( AclIpSpace.union( prefixList.getMatchingIps().stream() .map(IpWildcard::toIpSpace) .collect(ImmutableList.toImmutableList()))); } else { w.redFlag("Reference to undefined prefix-list: \"" + _name + "\""); } } }
@Override public void applyTo( HeaderSpace.Builder headerSpaceBuilder, JuniperConfiguration jc, Warnings w, Configuration c) { PrefixList pl = jc.getMasterLogicalSystem().getPrefixLists().get(_name); if (pl != null) { if (pl.getIpv6()) { return; } RouteFilterList destinationPrefixList = c.getRouteFilterLists().get(_name); // if referenced prefix list is empty, it should not match anything if (destinationPrefixList.getLines().isEmpty()) { headerSpaceBuilder.addNotDstIp(EmptyIpSpace.INSTANCE); return; } headerSpaceBuilder.addNotDstIp( AclIpSpace.union( destinationPrefixList.getMatchingIps().stream() .map(IpWildcard::toIpSpace) .collect(ImmutableList.toImmutableList()))); } else { w.redFlag("Reference to undefined destination prefix-list: \"" + _name + "\""); } } }