@Override public BgpProcess build() { BgpProcess bgpProcess = new BgpProcess(); if (_vrf != null) { _vrf.setBgpProcess(bgpProcess); } if (_routerId != null) { bgpProcess.setRouterId(_routerId); } return bgpProcess; }
BgpProcess abstractBgp = new BgpProcess(); abstractBgp.setMultipathEbgp(bgp.getMultipathEbgp()); abstractBgp.setMultipathIbgp(bgp.getMultipathIbgp());
CiscoNxBgpVrfConfiguration nxBgpVrf, String vrfName) { org.batfish.datamodel.BgpProcess newBgpProcess = new org.batfish.datamodel.BgpProcess(); org.batfish.datamodel.Vrf v = c.getVrfs().get(vrfName);
private org.batfish.datamodel.BgpProcess toBgpProcess( final Configuration c, BgpProcess proc, String vrfName) { org.batfish.datamodel.BgpProcess newBgpProcess = new org.batfish.datamodel.BgpProcess(); org.batfish.datamodel.Vrf v = c.getVrfs().get(vrfName); BgpTieBreaker tieBreaker = proc.getTieBreaker();
String vrfName = routingInstance.getName(); Vrf vrf = _c.getVrfs().get(vrfName); BgpProcess proc = new BgpProcess(); Ip routerId = routingInstance.getRouterId(); if (routerId == null) {
@Test public void testIsRouteReflector() { BgpProcess emptyProcess = new BgpProcess(); assertFalse("no rr clients", isRouteReflector(emptyProcess)); BgpProcess hasActiveNeighbor = new BgpProcess(); hasActiveNeighbor.setNeighbors(ImmutableSortedMap.of(p32a, activePeerWithRRC)); assertTrue("has active rr client", isRouteReflector(hasActiveNeighbor)); BgpProcess hasPassiveNeighbor = new BgpProcess(); hasPassiveNeighbor.setPassiveNeighbors(ImmutableSortedMap.of(p30a, passivePeerWithRRC)); assertTrue("has passive rr client", isRouteReflector(hasPassiveNeighbor)); BgpProcess hasNeighborMix = new BgpProcess(); hasNeighborMix.setNeighbors( ImmutableSortedMap.of(p32a, activePeerWithoutRRC, p32b, activePeerWithRRC)); BgpProcess hasAllInactive = new BgpProcess(); hasAllInactive.setNeighbors(ImmutableSortedMap.of(p32a, activePeerWithoutRRC)); hasAllInactive.setPassiveNeighbors(ImmutableSortedMap.of(p30a, passivePeerWithoutRRC));
@Test public void testGetBgpEdges() { BgpProcess bgp1 = new BgpProcess(); bgp1.setRouterId(Ip.parse("1.1.1.1")); BgpActivePeerConfig peer1 = new BgpPeerConfigId("host1", "vrf1", Prefix.create(Ip.parse("2.2.2.2"), 24), false); BgpProcess bgp2 = new BgpProcess(); bgp2.setRouterId(Ip.parse("2.2.2.2")); BgpActivePeerConfig peer2 =
private static Configuration createConfigurationWithDynamicSession( Configuration.Builder cb, Ip localIp, Prefix remotePrefix, List<Long> remoteAsList) { Configuration node = cb.setHostname("node4").build(); Interface iface = new Interface("iface", node, InterfaceType.PHYSICAL); iface.setAllAddresses( ImmutableList.of(new InterfaceAddress(localIp, Ip.numSubnetBitsToSubnetMask(32)))); BgpPassivePeerConfig peerConfig = BgpPassivePeerConfig.builder() .setLocalAs(3L) .setRemoteAs(remoteAsList) .setLocalIp(localIp) .setPeerPrefix(remotePrefix) .build(); BgpProcess bgpProcess = new BgpProcess(); bgpProcess.setPassiveNeighbors(ImmutableSortedMap.of(remotePrefix, peerConfig)); Vrf vrf1 = new Vrf("vrf"); vrf1.setBgpProcess(bgpProcess); node.setVrfs(ImmutableMap.of("vrf", vrf1)); node.setInterfaces(ImmutableSortedMap.of("iface", iface)); return node; }
BgpProcess proc = vpnGatewayCfgNode.getDefaultVrf().getBgpProcess(); if (proc == null) { proc = new BgpProcess(); proc.setRouterId(ipsecTunnel.getVgwInsideAddress()); proc.setMultipathEquivalentAsPathMatchMode(MultipathEquivalentAsPathMatchMode.EXACT_PATH); BgpProcess vpcProc = new BgpProcess(); vpcNode.getDefaultVrf().setBgpProcess(vpcProc); vpcProc.setMultipathEquivalentAsPathMatchMode(
@Test public void getProperties() { BgpProcess bgp1 = new BgpProcess(); bgp1.setRouterId(Ip.parse("1.1.1.1")); bgp1.setMultipathEbgp(true);
private static Configuration createConfiguration( Configuration.Builder cb, String nodeName, Ip localIp, Ip remoteIp, Long localAs, Long remoteAs) { Configuration node = cb.setHostname(nodeName).build(); Interface iface = new Interface("iface", node, InterfaceType.PHYSICAL); iface.setAllAddresses( ImmutableList.of(new InterfaceAddress(localIp, Ip.numSubnetBitsToSubnetMask(32)))); BgpActivePeerConfig peerConfig = BgpActivePeerConfig.builder() .setLocalAs(localAs) .setRemoteAs(remoteAs) .setLocalIp(localIp) .setPeerAddress(remoteIp) .build(); BgpProcess bgpProcess = new BgpProcess(); bgpProcess.setNeighbors(ImmutableSortedMap.of(Prefix.create(remoteIp, 32), peerConfig)); Vrf vrf1 = new Vrf("vrf"); vrf1.setBgpProcess(bgpProcess); node.setVrfs(ImmutableMap.of("vrf", vrf1)); node.setInterfaces(ImmutableSortedMap.of("iface", iface)); return node; }
BgpProcess bgpProcess = new BgpProcess(); vrf.setBgpProcess(bgpProcess); BgpPeerConfig neighbor =
.build(); BgpProcess process = new BgpProcess(); process.setNeighbors(ImmutableSortedMap.of(Prefix.create(Ip.parse("1.1.1.0"), 24), activePeer)); process.setPassiveNeighbors(