congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
EigrpInterface
Code IndexAdd Tabnine to your IDE (free)

How to use
EigrpInterface
in
org.batfish.datamodel.eigrp

Best Java code snippets using org.batfish.datamodel.eigrp.EigrpInterface (Showing top 14 results out of 315)

origin: batfish/batfish

/**
 * Propagate EIGRP internal routes from every valid EIGRP neighbors
 *
 * @param nodes mapping of node names to instances.
 * @param topology network topology
 * @param nc All network configurations
 * @return true if new routes have been added to the staging RIB
 */
boolean propagateInternalRoutes(
  Map<String, Node> nodes,
  Network<EigrpInterface, EigrpEdge> topology,
  NetworkConfigurations nc) {
 return _interfaces.stream()
   .filter(topology.nodes()::contains)
   .flatMap(n -> topology.inEdges(n).stream())
   .map(
     edge ->
       propagateInternalRoutesFromNeighbor(
         nodes.get(edge.getNode1().getHostname()),
         edge.getNode2().getInterfaceSettings(nc).getMetric(),
         edge.getNode1().getInterface(nc)))
   .reduce(false, (a, b) -> a || b);
}
origin: batfish/batfish

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (!(o instanceof EigrpEdge)) {
  return false;
 }
 EigrpEdge rhs = (EigrpEdge) o;
 return _node1.equals(rhs._node1) && _node2.equals(rhs._node2);
}
origin: batfish/batfish

private void queueOutgoingExternalRoutes(
  Map<String, Node> allNodes, @Nonnull RibDelta<EigrpExternalRoute> delta) {
 // Loop over neighbors, enqueue messages
 for (EigrpEdge edge : _incomingRoutes.keySet()) {
  Queue<RouteAdvertisement<EigrpExternalRoute>> queue =
    requireNonNull(
        allNodes
          .get(edge.getNode1().getHostname())
          .getVirtualRouters()
          .get(edge.getNode1().getVrf())
          .getEigrpProcess(_asn))
      ._incomingRoutes
      .get(edge.reverse());
  VirtualRouter.queueDelta(queue, delta);
 }
}
origin: batfish/batfish

@Nonnull
public IpEdge toIpEdge(NetworkConfigurations nc) {
 return new IpEdge(
   _node1.getHostname(),
   _node1.getInterface(nc).getAddress().getIp(),
   _node2.getHostname(),
   _node2.getInterface(nc).getAddress().getIp());
}
origin: batfish/batfish

private static SortedSet<VerboseEigrpEdge> getEigrpEdges(
  Map<String, Configuration> configs, Topology topology) {
 Network<EigrpInterface, EigrpEdge> eigrpTopology =
   EigrpTopology.initEigrpTopology(configs, topology);
 NetworkConfigurations nc = NetworkConfigurations.of(configs);
 SortedSet<VerboseEigrpEdge> eigrpEdges = new TreeSet<>();
 for (Configuration c : configs.values()) {
  String hostname = c.getHostname();
  for (Vrf vrf : c.getVrfs().values()) {
   eigrpEdges.addAll(
     vrf.getInterfaceNames().stream()
       .map(ifaceName -> new EigrpInterface(hostname, ifaceName, vrf.getName()))
       .filter(eigrpTopology.nodes()::contains)
       .flatMap(n -> eigrpTopology.inEdges(n).stream())
       .map(edge -> new VerboseEigrpEdge(edge, edge.toIpEdge(nc)))
       .collect(ImmutableSortedSet.toImmutableSortedSet(Comparator.naturalOrder())));
  }
 }
 return eigrpEdges;
}
origin: batfish/batfish

@VisibleForTesting
static Row eigrpEdgeToRow(EigrpEdge eigrpEdge) {
 RowBuilder row = Row.builder();
 row.put(
     COL_INTERFACE,
     new NodeInterfacePair(
       eigrpEdge.getNode1().getHostname(), eigrpEdge.getNode1().getInterfaceName()))
   .put(
     COL_REMOTE_INTERFACE,
     new NodeInterfacePair(
       eigrpEdge.getNode2().getHostname(), eigrpEdge.getNode2().getInterfaceName()));
 return row.build();
}
origin: batfish/batfish

@VisibleForTesting
static Multiset<Row> getEigrpEdges(
  Set<String> includeNodes,
  Set<String> includeRemoteNodes,
  Network<EigrpInterface, EigrpEdge> eigrpTopology) {
 return eigrpTopology.edges().stream()
   .filter(
     eigrpEdge ->
       includeNodes.contains(eigrpEdge.getNode1().getHostname())
         && includeRemoteNodes.contains(eigrpEdge.getNode2().getHostname()))
   .map(EdgesAnswerer::eigrpEdgeToRow)
   .collect(Collectors.toCollection(HashMultiset::create));
}
origin: batfish/batfish

 public @Nonnull EigrpInterfaceSettings getInterfaceSettings(@Nonnull NetworkConfigurations nc) {
  return requireNonNull(getInterface(nc).getEigrp());
 }
}
origin: batfish/batfish

/** Return an {@link EigrpEdge} if there is an EIGRP adjacency on {@code edge}. */
@Nonnull
static Optional<EigrpEdge> edgeIfAdjacent(Edge edge, Map<String, Configuration> configurations) {
 // vertex1
 Configuration c1 = configurations.get(edge.getNode1());
 Interface iface1 = c1.getAllInterfaces().get(edge.getInt1());
 EigrpInterfaceSettings eigrp1 = iface1.getEigrp();
 // vertex2
 Configuration c2 = configurations.get(edge.getNode2());
 Interface iface2 = c2.getAllInterfaces().get(edge.getInt2());
 EigrpInterfaceSettings eigrp2 = iface2.getEigrp();
 if (eigrp1 == null
   || eigrp2 == null
   || !eigrp1.getEnabled()
   || !eigrp2.getEnabled()
   || eigrp1.getAsn() != eigrp2.getAsn()
   || eigrp1.getPassive()
   || eigrp2.getPassive()) {
  return empty();
 }
 return Optional.of(
   new EigrpEdge(
     new EigrpInterface(c1.getHostname(), iface1),
     new EigrpInterface(c2.getHostname(), iface2)));
}
origin: batfish/batfish

Interface nextHopIntf = edge.getNode1().getInterface(nc);
Interface connectingIntf = edge.getNode2().getInterface(nc);
origin: batfish/batfish

@Test
public void testEigrpToRow() {
 EigrpEdge testEdge =
   new EigrpEdge(
     new EigrpInterface("host1", "int1", "vrf1"),
     new EigrpInterface("host2", "int2", "vrf2"));
 Row row = eigrpEdgeToRow(testEdge);
 assertThat(
   row,
   allOf(
     hasColumn(
       COL_INTERFACE, equalTo(new NodeInterfacePair("host1", "int1")), Schema.INTERFACE),
     hasColumn(
       COL_REMOTE_INTERFACE,
       equalTo(new NodeInterfacePair("host2", "int2")),
       Schema.INTERFACE)));
}
origin: batfish/batfish

@Test
public void testGetEigrpEdges() {
 MutableNetwork<EigrpInterface, EigrpEdge> eigrpTopology =
   NetworkBuilder.directed().allowsParallelEdges(false).allowsSelfLoops(false).build();
 EigrpInterface eigrpInterface1 = new EigrpInterface("host1", "int1", "vrf1");
 EigrpInterface eigrpInterface2 = new EigrpInterface("host2", "int2", "vrf2");
 eigrpTopology.addEdge(
   eigrpInterface1, eigrpInterface2, new EigrpEdge(eigrpInterface1, eigrpInterface2));
 Multiset<Row> rows = getEigrpEdges(_includeNodes, _includeRemoteNodes, eigrpTopology);
 assertThat(
   rows,
   contains(
     allOf(
       hasColumn(
         COL_INTERFACE,
         equalTo(new NodeInterfacePair("host1", "int1")),
         Schema.INTERFACE),
       hasColumn(
         COL_REMOTE_INTERFACE,
         equalTo(new NodeInterfacePair("host2", "int2")),
         Schema.INTERFACE))));
}
origin: batfish/batfish

 && iface.getEigrp().getAsn() == _asn
 && iface.getEigrp().getEnabled()) {
_interfaces.add(new EigrpInterface(c.getHostname(), iface));
requireNonNull(iface.getEigrp());
Set<Prefix> allNetworkPrefixes =
origin: batfish/batfish

vedges.addAll(
  vrf.getInterfaceNames().stream()
    .map(ifaceName -> new EigrpInterface(hostname, ifaceName, vrf.getName()))
    .filter(_eigrpTopology.nodes()::contains)
    .flatMap(n -> _eigrpTopology.inEdges(n).stream())
org.batfish.datamodel.eigrpEigrpInterface

Javadoc

Represents a configured EIGRP interface, at the control plane level. Hostname, prefix, and VRF uniquely define the interface and process, even in the presence of misconfiguration.

Most used methods

  • <init>
  • getHostname
  • getInterface
  • equals
  • getInterfaceName
  • getInterfaceSettings
  • getVrf

Popular in Java

  • Parsing JSON documents to java classes using gson
  • addToBackStack (FragmentTransaction)
  • notifyDataSetChanged (ArrayAdapter)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now