@Override protected VendorFamily featureValueOf(Configuration actual) { return actual.getVendorFamily(); } }
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; } }
@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; }
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; } }
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);
iface.setAllAddresses(ifaceAddresses); cfgNode.getVendorFamily().getAws().setVpcId(_vpcId); cfgNode.getVendorFamily().getAws().setSubnetId(_subnetId); cfgNode.getVendorFamily().getAws().setRegion(region.getName());
Configuration cfgNode = Utils.newAwsConfiguration(_domainName, "aws"); cfgNode.getVendorFamily().getAws().setVpcId(_vpcId); cfgNode.getVendorFamily().getAws().setRegion(region.getName());
Configuration cfgNode = Utils.newAwsConfiguration(_dbInstanceIdentifier, "aws"); cfgNode.getVendorFamily().getAws().setVpcId(_vpcId); cfgNode.getVendorFamily().getAws().setRegion(region.getName());
public Configuration toConfigurationNode(AwsConfiguration awsConfiguration, Region region) { Configuration cfgNode = Utils.newAwsConfiguration(_internetGatewayId, "aws"); cfgNode.getVendorFamily().getAws().setRegion(region.getName());
_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));
public Configuration toConfigurationNode( AwsConfiguration awsConfiguration, Region region, Warnings warnings) { Configuration cfgNode = Utils.newAwsConfiguration(_vpnGatewayId, "aws"); cfgNode.getVendorFamily().getAws().setRegion(region.getName());
subnetToVpc.setOutgoingFilter(outAcl); cfgNode.getVendorFamily().getAws().setVpcId(_vpcId); cfgNode.getVendorFamily().getAws().setSubnetId(_subnetId); cfgNode.getVendorFamily().getAws().setRegion(region.getName());
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; }
abstractConf.setTacacsServers(conf.getTacacsServers()); abstractConf.setTacacsSourceInterface(conf.getTacacsSourceInterface()); abstractConf.setVendorFamily(conf.getVendorFamily()); abstractConf.setZones(conf.getZones()); abstractConf.setCommunityLists(conf.getCommunityLists());
@Override public List<Configuration> toVendorIndependentConfigurations() { final Configuration c = new Configuration(_hostname, _vendor); c.getVendorFamily().setCisco(_cf); c.setDefaultInboundAction(LineAction.PERMIT); c.setDefaultCrossZoneAction(LineAction.PERMIT);