use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey in project netvirt by opendaylight.
the class FibEntriesListener method remove.
@Override
protected void remove(InstanceIdentifier<VrfEntry> identifier, VrfEntry del) {
LOG.trace("Remove Fib event - Key : {}, value : {} ", identifier, del);
final VrfTablesKey key = identifier.firstKeyOf(VrfTables.class, VrfTablesKey.class);
String rd = key.getRouteDistinguisher();
List<RoutePaths> routePaths = del.getRoutePaths();
removeLabelFromVpnInstance(rd, routePaths);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey in project netvirt by opendaylight.
the class BgpUtil method removeVrfEntry.
public void removeVrfEntry(String rd, VrfEntry vrfEntry) {
LOG.debug("removeVrfEntry : vrf {} prefix {}", rd, vrfEntry.getDestPrefix());
InstanceIdentifier<VrfEntry> vrfEntryId = InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)).child(VrfEntry.class, new VrfEntryKey(vrfEntry.getDestPrefix())).build();
delete(vrfEntryId);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey in project netvirt by opendaylight.
the class FibDSWriter method removeVrfFromDS.
public synchronized void removeVrfFromDS(String rd) {
LOG.debug("Removing vrf table for rd {}", rd);
InstanceIdentifierBuilder<VrfTables> idBuilder = InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd));
InstanceIdentifier<VrfTables> vrfTableId = idBuilder.build();
bgpUtil.delete(vrfTableId);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey in project netvirt by opendaylight.
the class FibDSWriter method addFibEntryToDS.
public synchronized void addFibEntryToDS(String rd, String prefix, List<String> nextHopList, VrfEntry.EncapType encapType, int label, long l3vni, String gatewayMacAddress, RouteOrigin origin) {
if (rd == null || rd.isEmpty()) {
LOG.error("Prefix {} not associated with vpn", prefix);
return;
}
Preconditions.checkNotNull(nextHopList, "NextHopList can't be null");
for (String nextHop : nextHopList) {
if (nextHop == null || nextHop.isEmpty()) {
LOG.error("nextHop list contains null element");
return;
}
LOG.debug("Created vrfEntry for {} nexthop {} label {}", prefix, nextHop, label);
}
// Looking for existing prefix in MDSAL database
InstanceIdentifier<VrfEntry> vrfEntryId = InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)).child(VrfEntry.class, new VrfEntryKey(prefix)).build();
VrfEntryBuilder vrfEntryBuilder = new VrfEntryBuilder().setDestPrefix(prefix).setOrigin(origin.getValue());
buildVpnEncapSpecificInfo(vrfEntryBuilder, encapType, label, l3vni, gatewayMacAddress, nextHopList);
bgpUtil.update(vrfEntryId, vrfEntryBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey in project netvirt by opendaylight.
the class FibDSWriter method removeMacEntryFromDS.
public void removeMacEntryFromDS(String rd, String macAddress) {
if (StringUtils.isEmpty(rd)) {
LOG.error("Mac {} not associated with vpn", macAddress);
return;
}
LOG.debug("Removing Mac fib entry with Mac {} from vrf table for rd {}", macAddress, rd);
InstanceIdentifierBuilder<MacVrfEntry> idBuilder = InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)).child(MacVrfEntry.class, new MacVrfEntryKey(macAddress));
InstanceIdentifier<MacVrfEntry> macEntryId = idBuilder.build();
bgpUtil.delete(macEntryId);
}
Aggregations