Codota Logo
RoutingProtocol
Code IndexAdd Codota to your IDE (free)

How to use
RoutingProtocol
in
org.batfish.datamodel

Best Java code snippets using org.batfish.datamodel.RoutingProtocol (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: batfish/batfish

 @Override
 public String toString() {
  return getClass().getSimpleName() + "<" + _protocol.protocolName() + ">";
 }
}
origin: batfish/batfish

private static Map<String, RoutingProtocol> buildMap() {
 ImmutableMap.Builder<String, RoutingProtocol> map = ImmutableMap.builder();
 for (RoutingProtocol protocol : RoutingProtocol.values()) {
  String protocolName = protocol._protocolName.toLowerCase();
  map.put(protocolName, protocol);
 }
 return map.build();
}
origin: batfish/batfish

 return result;
result = _protocol.compareTo(rhs._protocol);
if (result != 0) {
 return result;
origin: batfish/batfish

private int defaultAdminDistance(Configuration conf, Protocol proto) {
 RoutingProtocol rp = Protocol.toRoutingProtocol(proto);
 return rp.getDefaultAdministrativeCost(conf.getConfigurationFormat());
}
origin: batfish/batfish

@Override
public Result evaluate(Environment environment) {
 Result result = new Result();
 // Workaround: Treat ISIS_ANY as a special value
 if (_protocol == RoutingProtocol.ISIS_ANY) {
  result.setBooleanValue(ISIS_EXPANSION.contains(environment.getOriginalRoute().getProtocol()));
 } else {
  result.setBooleanValue(environment.getOriginalRoute().getProtocol().equals(_protocol));
 }
 return result;
}
origin: batfish/batfish

@Override
public int hashCode() {
 return Objects.hash(_protocol.ordinal());
}
origin: batfish/batfish

 @Override
 public BooleanExpr toBooleanExpr(Configuration c, CiscoConfiguration cc, Warnings w) {
  Disjunction d = new Disjunction();
  List<BooleanExpr> disjuncts = d.getDisjuncts();
  for (String protocol : _protocols) {
   disjuncts.add(new MatchProtocol(RoutingProtocol.fromProtocolName(protocol)));
  }
  return d.simplify();
 }
}
origin: batfish/batfish

int admin = RoutingProtocol.OSPF_IA.getSummaryAdministrativeCost(_c.getConfigurationFormat());
origin: batfish/batfish

/** Initialize RIP routes from the interface prefixes */
@VisibleForTesting
void initBaseRipRoutes() {
 if (_vrf.getRipProcess() == null) {
  return; // nothing to do
 }
 // init internal routes from connected routes
 for (String ifaceName : _vrf.getRipProcess().getInterfaces()) {
  Interface iface = _vrf.getInterfaces().get(ifaceName);
  if (iface.getActive()) {
   Set<Prefix> allNetworkPrefixes =
     iface.getAllAddresses().stream()
       .map(InterfaceAddress::getPrefix)
       .collect(Collectors.toSet());
   long cost = RipProcess.DEFAULT_RIP_COST;
   for (Prefix prefix : allNetworkPrefixes) {
    RipInternalRoute route =
      new RipInternalRoute(
        prefix,
        Route.UNSET_ROUTE_NEXT_HOP_IP,
        RoutingProtocol.RIP.getDefaultAdministrativeCost(_c.getConfigurationFormat()),
        cost);
    _ripInternalRib.mergeRouteGetDelta(route);
   }
  }
 }
}
origin: batfish/batfish

if (!sessionProperties.isEbgp() && remoteRouteProtocol.equals(RoutingProtocol.IBGP)) {
 BgpRoute bgpRemoteRoute = (BgpRoute) route;
 originatorIp = bgpRemoteRoute.getOriginatorIp();
  return null;
 if (remoteRouteProtocol.equals(RoutingProtocol.IBGP) && !sessionProperties.isEbgp()) {
origin: batfish/batfish

@Override
public int hashCode() {
 if (_hashCode != 0) {
  return _hashCode;
 }
 _hashCode =
   Objects.hash(
     _admin,
     _asPath,
     _clusterList,
     _communities,
     _discard,
     _localPreference,
     _med,
     _network,
     _nextHopIp,
     _originatorIp,
     _originType.ordinal(),
     _protocol.ordinal(),
     _receivedFromIp,
     _receivedFromRouteReflectorClient,
     _srcProtocol == null ? 0 : _srcProtocol.ordinal(),
     _weight);
 return _hashCode;
}
origin: batfish/batfish

public String prettyPrint(String prefix) {
 String net = getNetwork().toString();
 String prot = _srcProtocol.protocolName();
 String routeStr =
   String.format(
     "%s%s dstNode:%s dstVrf:%s dstIp:%s srcNode:%s srcVrf:%s srcIp:%s net:%s nhip:%s "
       + "origin:%s lp:%s med:%s weight:%s asPath:%s communities:%s orIp:%s clst:%s "
       + "srcProt:%s\n",
     prefix,
     _type,
     _dstNode,
     _dstVrf,
     _dstIp,
     _srcNode,
     _srcVrf,
     _srcIp,
     net,
     _nextHopIp,
     _originType,
     _localPreference,
     _med,
     _weight,
     _asPath,
     _communities,
     _originatorIp,
     _clusterList,
     prot);
 return routeStr;
}
origin: batfish/batfish

int adminCost = RoutingProtocol.OSPF.getDefaultAdministrativeCost(_c.getConfigurationFormat());
SortedSet<Edge> edges = topology.getNodeEdges().get(node);
if (edges == null) {
origin: batfish/batfish

@Test
public void testAll() {
 assertThat(
   RoutingProtocolSpecifier.create("all").getProtocols(),
   equalTo(Stream.of(RoutingProtocol.values()).collect(Collectors.toSet())));
}
origin: batfish/batfish

@Override
public int hashCode() {
 final int prime = 31;
 int result = 1;
 result = prime * result + _administrativeCost;
 result = prime * result + Long.hashCode(_metric);
 result = prime * result + _nextHopIp.hashCode();
 result = prime * result + _node.hashCode();
 result = prime * result + _network.hashCode();
 result = prime * result + _protocol.ordinal();
 result = prime * result + _tag;
 result = prime * result + _vrf.hashCode();
 return result;
}
origin: batfish/batfish

 return result;
result = _protocol.compareTo(rhs._protocol);
if (result != 0) {
 return result;
origin: batfish/batfish

 break;
default:
 throw new BatfishException("Unrecognized protocol: " + other.protocolName());
origin: batfish/batfish

   > RoutingProtocol.BGP.getDefaultAdministrativeCost(ConfigurationFormat.CISCO_IOS)) {
protocol = RoutingProtocol.IBGP;
origin: batfish/batfish

@Test
public void testCreationDefault() {
 assertThat(
   RoutingProtocolSpecifier.create(null).getProtocols(),
   equalTo(Stream.of(RoutingProtocol.values()).collect(Collectors.toSet())));
}
origin: batfish/batfish

@Override
public int hashCode() {
 final int prime = 31;
 int result = 1;
 result = prime * result + _administrativeCost;
 result = prime * result + _metric;
 result = prime * result + _nextHopIp.hashCode();
 result = prime * result + _node.hashCode();
 result = prime * result + _network.hashCode();
 result = prime * result + _protocol.ordinal();
 result = prime * result + _tag;
 result = prime * result + _vrf.hashCode();
 return result;
}
org.batfish.datamodelRoutingProtocol

Most used methods

  • protocolName
  • equals
  • values
  • compareTo
  • fromProtocolName
  • getDefaultAdministrativeCost
  • getSummaryAdministrativeCost
  • ordinal

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • setContentView (Activity)
  • getContentResolver (Context)
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JFileChooser (javax.swing)
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