@JsonProperty(PROP_INT1) public String getInt1() { return _tail.getInterface(); }
@JsonProperty(PROP_INT2) public String getInt2() { return _head.getInterface(); }
/** Function that processes an interface blacklist across all configurations */ private static void processInterfaceBlacklist( Set<NodeInterfacePair> interfaceBlacklist, NetworkConfigurations configurations) { interfaceBlacklist.stream() .map(iface -> configurations.getInterface(iface.getHostname(), iface.getInterface())) .filter(Optional::isPresent) .map(Optional::get) .forEach(Interface::blacklist); }
/** * Return the representative of the broadcast domain of {@code nodeInterfacePair}, or {@link * Optional#empty} if not represented in the layer-2 topology. */ public @Nonnull Optional<Layer2Node> getBroadcastDomainRepresentative( NodeInterfacePair nodeInterfacePair) { return getBroadcastDomainRepresentative( nodeInterfacePair.getHostname(), nodeInterfacePair.getInterface()); }
/** Return whether the two interfaces are in the same broadcast domain. */ public boolean inSameBroadcastDomain(NodeInterfacePair i1, NodeInterfacePair i2) { return inSameBroadcastDomain( layer2Node(i1.getHostname(), i1.getInterface()), layer2Node(i2.getHostname(), i2.getInterface())); }
@Override public String toString() { return "<" + getTail().getHostname() + ":" + getTail().getInterface() + ", " + getHead().getHostname() + ":" + getHead().getInterface() + ">"; } }
receiver -> { String recvNode = receiver.getHostname(); String recvInterface = receiver.getInterface(); IpSpace recvReplies = _arpReplies.get(recvNode).get(recvInterface);
FlowDisposition disposition = computeDisposition( nextHopInterface.getHostname(), nextHopInterface.getInterface(), dstIp); FlowTrace trace = neighborUnreachableOrExitsNetworkTrace(
/** Returns {@code true} iff the given {@link Location} is active (aka, interface is up). */ @VisibleForTesting static boolean isActive(Location l, Map<String, Configuration> configs) { NodeInterfacePair iface; if (l instanceof InterfaceLocation) { iface = new NodeInterfacePair( ((InterfaceLocation) l).getNodeName(), ((InterfaceLocation) l).getInterfaceName()); } else { assert l instanceof InterfaceLinkLocation; iface = new NodeInterfacePair( ((InterfaceLinkLocation) l).getNodeName(), ((InterfaceLinkLocation) l).getInterfaceName()); } return configs .get(iface.getHostname()) .getAllInterfaces() .get(iface.getInterface()) .getActive(); }
for (NodeInterfacePair p : blacklistInterfaces) { String hostname = p.getHostname(); String ifaceName = p.getInterface(); Configuration node = configurations.get(hostname); Interface iface = node.getAllInterfaces().get(ifaceName);
@Test public void testGetterEquivalence() { assertThat(EDGE.getNode1(), equalTo(EDGE.getTail().getHostname())); assertThat(EDGE.getNode2(), equalTo(EDGE.getHead().getHostname())); assertThat(EDGE.getInt1(), equalTo(EDGE.getTail().getInterface())); assertThat(EDGE.getInt2(), equalTo(EDGE.getHead().getInterface())); }
session.getNextHop().getInterface(), transmissionContext.branch( new NodeInterfacePair(currentNodeName, session.getOutgoingInterface()),
nodeConfig.getAllInterfaces().get(nextHopInterface.getInterface());