congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.batfish.datamodel.vendor_family
Code IndexAdd Tabnine to your IDE (free)

How to use org.batfish.datamodel.vendor_family

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

origin: batfish/batfish

 @Override
 protected CiscoFamily featureValueOf(VendorFamily actual) {
  return actual.getCisco();
 }
}
origin: batfish/batfish

/**
 * Provides a matcher that matches if the provided {@code subMatcher} matches the VendorFamily's
 * cisco
 */
public static HasCisco hasCisco(Matcher<? super CiscoFamily> subMatcher) {
 return new HasCisco(subMatcher);
}
origin: batfish/batfish

 /** Concatenates all non-null family pointers */
 @Override
 public String toString() {
  return String.join(
    " ",
    Stream.of(_aws, _cisco, _juniper)
      .filter(f -> f != null)
      .map(f -> Objects.toString(toFamilyType(f)))
      .collect(Collectors.toList()));
 }
}
origin: batfish/batfish

@Override
public List<Configuration> toVendorIndependentConfigurations() {
 final Configuration c = new Configuration(_hostname, _vendor);
 c.getVendorFamily().setCisco(_cf);
 c.setDefaultInboundAction(LineAction.PERMIT);
 c.setDefaultCrossZoneAction(LineAction.PERMIT);
 c.setTacacsSourceInterface(_tacacsSourceInterface);
 c.setNtpSourceInterface(_ntpSourceInterface);
 if (_cf.getNtp() != null) {
  c.setNtpServers(new TreeSet<>(_cf.getNtp().getServers().keySet()));
 if (_cf.getLogging() != null) {
  c.setLoggingSourceInterface(_cf.getLogging().getSourceInterface());
  c.setLoggingServers(new TreeSet<>(_cf.getLogging().getHosts().keySet()));
 for (Line line : _cf.getLines().values()) {
  String list = line.getLoginAuthentication();
  if (list == null) {
  Aaa aaa = _cf.getAaa();
  if (aaa != null) {
   AaaAuthentication authentication = aaa.getAuthentication();
   if (authentication != null) {
    AaaAuthenticationLogin login = authentication.getLogin();
    if (login != null && login.getLists().containsKey(list)) {
     found = true;
origin: batfish/batfish

@Test
public void toStringMulitipleFamilies() {
 VendorFamily family = new VendorFamily();
 family.setCisco(new CiscoFamily());
 family.setJuniper(new JuniperFamily());
 assertThat(
   family.toString(),
   equalTo(String.join(" ", Arrays.asList(Type.CISCO.toString(), Type.JUNIPER.toString()))));
}
origin: batfish/batfish

 @Test
 public void toStringOneFamily() {
  VendorFamily family = new VendorFamily();
  family.setCisco(new CiscoFamily());
  assertThat(family.toString(), equalTo(Type.CISCO.toString()));
 }
}
origin: batfish/batfish

@Override
public TableAnswerElement answer() {
 AaaAuthenticationLoginQuestion question = (AaaAuthenticationLoginQuestion) _question;
 TableAnswerElement answerElement = create(question);
 Set<String> specifiedNodes = question.getNodes().getMatchingNodes(_batfish);
 SortedMap<String, Configuration> configs = _batfish.loadConfigurations();
 configs.forEach(
   (configName, config) -> {
    if (specifiedNodes.contains(configName)) {
     Row row = null;
     if (config.getVendorFamily().getCisco() != null) {
      row = getRow(configName, config.getVendorFamily().getCisco().getLines().values());
     } else if (config.getVendorFamily().getJuniper() != null) {
      row = getRow(configName, config.getVendorFamily().getJuniper().getLines().values());
     }
     if (row != null) {
      answerElement.addRow(row);
     }
    }
   });
 answerElement.setSummary(answerElement.computeSummary(question.getAssertion()));
 return answerElement;
}
origin: batfish/batfish

iface.setAllAddresses(ifaceAddresses);
cfgNode.getVendorFamily().getAws().setVpcId(_vpcId);
cfgNode.getVendorFamily().getAws().setSubnetId(_subnetId);
cfgNode.getVendorFamily().getAws().setRegion(region.getName());
origin: batfish/batfish

 public Configuration toConfigurationNode(
   AwsConfiguration awsConfiguration, Region region, Warnings warnings) {
  Configuration cfgNode = Utils.newAwsConfiguration(_vpcId, "aws");
  cfgNode.getVendorFamily().getAws().setRegion(region.getName());
  cfgNode.getVendorFamily().getAws().setVpcId(_vpcId);
  cfgNode
    .getDefaultVrf()
    .getStaticRoutes()
    .add(
      StaticRoute.builder()
        .setAdministrativeCost(Route.DEFAULT_STATIC_ROUTE_ADMIN)
        .setMetric(Route.DEFAULT_STATIC_ROUTE_COST)
        .setNetwork(_cidrBlock)
        .setNextHopInterface(Interface.NULL_INTERFACE_NAME)
        .build());

  // we only create a node here
  // interfaces are added to this node as we traverse subnets and
  // internetgateways

  return cfgNode;
 }
}
origin: batfish/batfish

if (configuration.getVendorFamily().getAws().getSubnetId() != null) {
 String subnetId = configuration.getVendorFamily().getAws().getSubnetId();
 Aggregate subnetAggregate =
   pojoTopology.getOrCreateAggregate(subnetId, AggregateType.SUBNET);
 subnetAggregate.getContents().add(pojoNode.getId());
 String vpcId = configuration.getVendorFamily().getAws().getVpcId();
 Aggregate vpcAggregate = pojoTopology.getOrCreateAggregate(vpcId, AggregateType.VNET);
 vpcAggregate.getContents().add(subnetAggregate.getId());
} else if (configuration.getVendorFamily().getAws().getVpcId() != null) {
 String vpcId = configuration.getVendorFamily().getAws().getVpcId();
 Aggregate vpcAggregate = pojoTopology.getOrCreateAggregate(vpcId, AggregateType.VNET);
 vpcAggregate.getContents().add(pojoNode.getId());
 String region = configuration.getVendorFamily().getAws().getRegion();
 Aggregate regionAggregate =
   pojoTopology.getOrCreateAggregate(region, AggregateType.REGION);
 regionAggregate.getContents().add(vpcAggregate.getId());
} else if (configuration.getVendorFamily().getAws().getRegion() != null) {
 String region = configuration.getVendorFamily().getAws().getRegion();
 Aggregate regionAggregate =
   pojoTopology.getOrCreateAggregate(region, AggregateType.REGION);
origin: batfish/batfish

 public Configuration toConfigurationNode(
   AwsConfiguration awsConfiguration, Region region, Warnings warnings) {
  Configuration cfgNode = Utils.newAwsConfiguration(_natGatewayId, "aws");
  cfgNode.getVendorFamily().getAws().setRegion(region.getName());

  // TODO: Configure forwarding for this NAT
  //    for (NatGatewayAddress natAddress : _natGatewayAddresses) {
  // foreach natgatewayaddress create interfaces for public and private IPs, configure NAT rules
  // also connect the nat to the VPC router
  //    }

  return cfgNode;
 }
}
origin: batfish/batfish

@Test
public void toStringNoFamily() {
 VendorFamily family = new VendorFamily();
 assertThat(family.toString(), equalTo(""));
}
origin: batfish/batfish

_tacacsServers = new TreeSet<>();
_trackingGroups = new TreeMap<>();
_vendorFamily = new VendorFamily();
_vrfs = new TreeMap<>();
_zones = new TreeMap<>();
origin: batfish/batfish

public static Configuration newAwsConfiguration(String name, String domainName) {
 Configuration c =
   FACTORY
     .configurationBuilder()
     .setHostname(name)
     .setDomainName(domainName)
     .setConfigurationFormat(ConfigurationFormat.AWS)
     .setDefaultInboundAction(LineAction.PERMIT)
     .setDefaultCrossZoneAction(LineAction.PERMIT)
     .build();
 FACTORY.vrfBuilder().setName(Configuration.DEFAULT_VRF_NAME).setOwner(c).build();
 c.getVendorFamily().setAws(new AwsFamily());
 return c;
}
origin: batfish/batfish

_c.setNtpServers(_masterLogicalSystem.getNtpServers());
_c.setTacacsServers(_masterLogicalSystem.getTacplusServers());
_c.getVendorFamily().setJuniper(_masterLogicalSystem.getJf());
for (String riName : _masterLogicalSystem.getRoutingInstances().keySet()) {
 _c.getVrfs().put(riName, new Vrf(riName));
origin: batfish/batfish

subnetToVpc.setOutgoingFilter(outAcl);
cfgNode.getVendorFamily().getAws().setVpcId(_vpcId);
cfgNode.getVendorFamily().getAws().setSubnetId(_subnetId);
cfgNode.getVendorFamily().getAws().setRegion(region.getName());
origin: batfish/batfish

Configuration cfgNode = Utils.newAwsConfiguration(_domainName, "aws");
cfgNode.getVendorFamily().getAws().setVpcId(_vpcId);
cfgNode.getVendorFamily().getAws().setRegion(region.getName());
origin: batfish/batfish

public Configuration toConfigurationNode(AwsConfiguration awsConfiguration, Region region) {
 Configuration cfgNode = Utils.newAwsConfiguration(_internetGatewayId, "aws");
 cfgNode.getVendorFamily().getAws().setRegion(region.getName());
origin: batfish/batfish

Configuration cfgNode = Utils.newAwsConfiguration(_dbInstanceIdentifier, "aws");
cfgNode.getVendorFamily().getAws().setVpcId(_vpcId);
cfgNode.getVendorFamily().getAws().setRegion(region.getName());
origin: batfish/batfish

public Configuration toConfigurationNode(
  AwsConfiguration awsConfiguration, Region region, Warnings warnings) {
 Configuration cfgNode = Utils.newAwsConfiguration(_vpnGatewayId, "aws");
 cfgNode.getVendorFamily().getAws().setRegion(region.getName());
org.batfish.datamodel.vendor_family

Most used classes

  • VendorFamily
  • CiscoFamily
  • JuniperFamily
  • AwsFamily
  • Aaa
  • AaaAuthenticationLogin,
  • Logging,
  • Service,
  • VendorFamily$Type,
  • VendorFamilyMatchersImpl$HasCisco,
  • AaaAccounting,
  • AaaAccountingCommands,
  • AaaAccountingDefault,
  • Buffered,
  • Cable,
  • CiscoFamilyMatchersImpl$HasAaa,
  • CiscoFamilyMatchersImpl$HasLogging,
  • DocsisPolicy,
  • LoggingHost
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