Codota Logo
EigrpInterface
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
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

  • Updating database using SQL prepared statement
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Menu (java.awt)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now