@JsonProperty(PROP_SRC_OR_DST_IPS) public SortedSet<IpWildcard> getSrcOrDstIps() { return asPositiveIpWildcards(_headerSpace.getSrcOrDstIps()); }
@JsonProperty(PROP_DST_IPS) public SortedSet<IpWildcard> getDstIps() { return asPositiveIpWildcards(_headerSpace.getDstIps()); }
@JsonProperty(PROP_SRC_IPS) public SortedSet<IpWildcard> getSrcIps() { return asPositiveIpWildcards(_headerSpace.getSrcIps()); }
@JsonProperty(PROP_SRC_IPS) public SortedSet<IpWildcard> getSrcIps() { return asPositiveIpWildcards(_reachabilitySettings.getHeaderSpace().getSrcIps()); }
@JsonProperty(PROP_SRC_OR_DST_IPS) public SortedSet<IpWildcard> getSrcOrDstIps() { return asPositiveIpWildcards(_reachabilitySettings.getHeaderSpace().getSrcOrDstIps()); }
@JsonProperty(PROP_DST_IPS) public SortedSet<IpWildcard> getDstIps() { return asPositiveIpWildcards(_reachabilitySettings.getHeaderSpace().getDstIps()); }
/** Test that asPositiveIpWildcards handles null */ @Test public void testAsPositiveIpWildcards() { assertThat(asPositiveIpWildcards(null), nullValue()); }
public static boolean overlap(HeaderSpace h, Prefix p) { if (h.getDstIps() == null) { return true; } for (IpWildcard ipWildcard : asPositiveIpWildcards(h.getDstIps())) { Prefix p2 = ipWildcard.toPrefix(); if (overlap(p, p2)) { return true; } } return false; }
/** * A slice is an abstracted network for a single destination EC. Given one destination EC, return * a mapping from each edge to a filter that will restrict traffic to that EC. We need separate * one for each one because they get mutated when we install the filters in the network. */ private Map<GraphEdge, EquivalenceClassFilter> processSlice(NetworkSlice slice) { Map<GraphEdge, EquivalenceClassFilter> filters = new HashMap<>(); // get the set of prefixes for this equivalence class. TreeSet<Prefix> prefixSet = asPositiveIpWildcards(slice.getHeaderSpace().getDstIps()).stream() .map(IpWildcard::toPrefix) .collect(Collectors.toCollection(TreeSet::new)); for (GraphEdge edge : slice.getGraph().getAllEdges()) { if (!edge.isAbstract() && !_graph.isLoopback(edge)) { // add a filter to restrict traffic to this equivalence class. filters.put( edge, new EquivalenceClassFilter(new PrefixTrie(prefixSet), slice.getIsDefaultCase())); } } return filters; }