Search in sources :

Example 26 with VrfTablesKey

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);
}
Also used : VrfTablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey) RoutePaths(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentrybase.RoutePaths)

Example 27 with VrfTablesKey

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);
}
Also used : VrfEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentries.VrfEntry) VrfTablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey) FibEntries(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.FibEntries) VrfEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentries.VrfEntryKey)

Example 28 with VrfTablesKey

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);
}
Also used : VrfTablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey) VrfTables(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTables) FibEntries(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.FibEntries)

Example 29 with VrfTablesKey

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());
}
Also used : MacVrfEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntry) VrfEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentries.VrfEntry) VrfTablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey) FibEntries(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.FibEntries) MacVrfEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryKey) VrfEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentries.VrfEntryKey) MacVrfEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryBuilder) VrfEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentries.VrfEntryBuilder)

Example 30 with VrfTablesKey

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);
}
Also used : VrfTablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey) MacVrfEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryKey) VrfTables(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTables) MacVrfEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntry)

Aggregations

VrfTablesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey)40 VrfEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentries.VrfEntry)22 FibEntries (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.FibEntries)21 VrfTables (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTables)19 VrfEntryKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentries.VrfEntryKey)16 ArrayList (java.util.ArrayList)11 BigInteger (java.math.BigInteger)10 MacVrfEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntry)9 VpnInstanceOpDataEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.VpnInstanceOpDataEntry)9 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)8 MacVrfEntryKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryKey)7 VpnToDpnList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.VpnToDpnList)7 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)6 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)5 SubnetRoute (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.SubnetRoute)5 RoutePaths (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentrybase.RoutePaths)5 Routes (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.to.extraroutes.vpn.extra.routes.Routes)5 RouteOrigin (org.opendaylight.netvirt.fibmanager.api.RouteOrigin)4 ExecutionException (java.util.concurrent.ExecutionException)3 VrfTablesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesBuilder)3