Search in sources :

Example 6 with MacEntryBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.forwarding.entries.MacEntryBuilder in project netvirt by opendaylight.

the class FibDSWriter method addMacEntryToDS.

public void addMacEntryToDS(String rd, String macAddress, String prefix, List<String> nextHopList, VrfEntry.EncapType encapType, long l2vni, String gatewayMacAddress, RouteOrigin origin) {
    if (StringUtils.isEmpty(rd)) {
        LOG.error("Mac {} not associated with vpn", macAddress);
        return;
    }
    Preconditions.checkNotNull(nextHopList, "NextHopList can't be null");
    for (String nextHop : nextHopList) {
        if (StringUtils.isEmpty(nextHop)) {
            LOG.error("nextHop list contains null element for macVrf");
            return;
        }
    }
    MacVrfEntryBuilder macEntryBuilder = new MacVrfEntryBuilder().setOrigin(origin.getValue());
    buildVpnEncapSpecificInfo(macEntryBuilder, encapType, l2vni, gatewayMacAddress, nextHopList);
    macEntryBuilder.setMac(macAddress);
    macEntryBuilder.setDestPrefix(prefix);
    InstanceIdentifier<MacVrfEntry> macEntryId = InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)).child(MacVrfEntry.class, new MacVrfEntryKey(macAddress)).build();
    bgpUtil.update(macEntryId, macEntryBuilder.build());
}
Also used : VrfTablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey) MacVrfEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryBuilder) MacVrfEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryKey) FibEntries(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.FibEntries) MacVrfEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntry)

Example 7 with MacEntryBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.forwarding.entries.MacEntryBuilder in project netvirt by opendaylight.

the class EvpnTestHelper method addMacVrfEntryToDS.

public void addMacVrfEntryToDS(String rd, String macAddress, String prefix, List<String> nextHopList, VrfEntry.EncapType encapType, long l2vni, String gatewayMacAddress, RouteOrigin origin) throws TransactionCommitFailedException {
    MacVrfEntryBuilder macEntryBuilder = new MacVrfEntryBuilder().setOrigin(origin.getValue());
    buildVpnEncapSpecificInfo(macEntryBuilder, encapType, l2vni, macAddress, gatewayMacAddress, nextHopList);
    macEntryBuilder.setMac(macAddress);
    macEntryBuilder.setDestPrefix(prefix);
    InstanceIdentifier<MacVrfEntry> macEntryId = InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)).child(MacVrfEntry.class, new MacVrfEntryKey(macAddress)).build();
    singleTxdataBroker.syncWrite(LogicalDatastoreType.CONFIGURATION, macEntryId, macEntryBuilder.build());
}
Also used : VrfTablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey) MacVrfEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryBuilder) MacVrfEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryKey) FibEntries(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.FibEntries) MacVrfEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntry)

Aggregations

MacEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.forwarding.entries.MacEntry)5 MacEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.forwarding.entries.MacEntryBuilder)5 MacEntryKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.forwarding.entries.MacEntryKey)5 InterfaceInfo (org.opendaylight.genius.interfacemanager.globals.InterfaceInfo)2 FibEntries (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.FibEntries)2 VrfTablesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey)2 MacVrfEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntry)2 MacVrfEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryBuilder)2 MacVrfEntryKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.macvrfentries.MacVrfEntryKey)2 BigInteger (java.math.BigInteger)1 Ethernet (org.opendaylight.genius.mdsalutil.packet.Ethernet)1 PacketException (org.opendaylight.openflowplugin.libraries.liblldp.PacketException)1 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)1 PhysAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress)1 IfIndexInterface (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406._if.indexes._interface.map.IfIndexInterface)1 ElanInterfaceMac (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan._interface.forwarding.entries.ElanInterfaceMac)1 ElanInstance (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance)1 ElanTagName (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.tag.name.map.ElanTagName)1 NoMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.NoMatch)1