use of org.opendaylight.yangtools.yang.binding.InstanceIdentifier in project netvirt by opendaylight.
the class BgpConfigurationManager method addAddressFamily.
public void addAddressFamily(String nbrIp, int afi, int safi) {
Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
InstanceIdentifier.InstanceIdentifierBuilder<AddressFamilies> iib = InstanceIdentifier.builder(Bgp.class).child(Neighbors.class, new NeighborsKey(nbrAddr)).child(AddressFamilies.class, new AddressFamiliesKey((long) afi, (long) safi));
InstanceIdentifier<AddressFamilies> iid = iib.build();
AddressFamilies dto = new AddressFamiliesBuilder().setPeerIp(nbrAddr).setAfi((long) afi).setSafi((long) safi).build();
update(iid, dto);
}
use of org.opendaylight.yangtools.yang.binding.InstanceIdentifier in project netvirt by opendaylight.
the class BgpConfigurationManager method startBgp.
public void startBgp(long as, String routerId, int spt, boolean fbit) {
IpAddress rid = routerId == null ? null : new IpAddress(routerId.toCharArray());
Long staleTime = (long) spt;
InstanceIdentifier.InstanceIdentifierBuilder<AsId> iib = InstanceIdentifier.builder(Bgp.class).child(AsId.class);
InstanceIdentifier<AsId> iid = iib.build();
AsId dto = new AsIdBuilder().setLocalAs(as).setRouterId(rid).setStalepathTime(staleTime).setAnnounceFbit(fbit).build();
update(iid, dto);
}
use of org.opendaylight.yangtools.yang.binding.InstanceIdentifier in project netvirt by opendaylight.
the class BgpConfigurationManager method delPrefix.
public void delPrefix(String rd, String pfx) {
InstanceIdentifier.InstanceIdentifierBuilder<Networks> iib = InstanceIdentifier.builder(Bgp.class).child(Networks.class, new NetworksKey(pfx, rd));
InstanceIdentifier<Networks> iid = iib.build();
delete(iid);
}
use of org.opendaylight.yangtools.yang.binding.InstanceIdentifier in project netvirt by opendaylight.
the class BgpConfigurationManager method delEbgpMultihop.
public void delEbgpMultihop(String nbrIp) {
Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
InstanceIdentifier.InstanceIdentifierBuilder<EbgpMultihop> iib = InstanceIdentifier.builder(Bgp.class).child(Neighbors.class, new NeighborsKey(nbrAddr)).child(EbgpMultihop.class);
InstanceIdentifier<EbgpMultihop> iid = iib.build();
delete(iid);
}
use of org.opendaylight.yangtools.yang.binding.InstanceIdentifier in project netvirt by opendaylight.
the class BgpConfigurationManager method addNeighbor.
public void addNeighbor(String nbrIp, long remoteAs, @Nullable final TcpMd5SignaturePasswordType md5Secret) {
Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
InstanceIdentifier.InstanceIdentifierBuilder<Neighbors> iib = InstanceIdentifier.builder(Bgp.class).child(Neighbors.class, new NeighborsKey(nbrAddr));
InstanceIdentifier<Neighbors> iid = iib.build();
TcpSecurityOption tcpSecOption = null;
if (md5Secret != null) {
tcpSecOption = new TcpMd5SignatureOptionBuilder().setTcpMd5SignaturePassword(md5Secret).build();
}
// else let tcpSecOption be null
Neighbors dto = new NeighborsBuilder().setAddress(nbrAddr).setRemoteAs(remoteAs).setTcpSecurityOption(tcpSecOption).build();
update(iid, dto);
}
Aggregations