use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension in project openflowplugin by opendaylight.
the class EncapEthDstConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxEncapEthDstGrouping> matchGrouping = MatchUtil.ENCAP_ETH_DST_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
MacAddress macAddress = matchGrouping.get().getNxmNxEncapEthDst().getMacAddress();
EncapEthDstCaseValueBuilder encapEthDstCaseValueBuilder = new EncapEthDstCaseValueBuilder();
encapEthDstCaseValueBuilder.setEncapEthDstValues(new EncapEthDstValuesBuilder().setMacAddress(macAddress).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxEncapEthDst.class, Nxm1Class.class, encapEthDstCaseValueBuilder.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension in project openflowplugin by opendaylight.
the class TunIPv4DstConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxTunIpv4DstGrouping> matchGrouping = MatchUtil.TUN_IPV4_DST_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Ipv4Address value = matchGrouping.get().getNxmNxTunIpv4Dst().getIpv4Address();
TunIpv4DstCaseValueBuilder tunIpv4DstCaseValueBuilder = new TunIpv4DstCaseValueBuilder();
tunIpv4DstCaseValueBuilder.setTunIpv4DstValues(new TunIpv4DstValuesBuilder().setValue(MatchUtil.ipv4ToLong(value)).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunIpv4Dst.class, Nxm1Class.class, tunIpv4DstCaseValueBuilder.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension in project openflowplugin by opendaylight.
the class TunIdConvertor method convert.
@Override
public MatchEntry convert(final Extension extension) {
Optional<NxmNxTunIdGrouping> matchGrouping = MatchUtil.TUN_ID_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
BigInteger value = matchGrouping.get().getNxmNxTunId().getValue();
TunIdCaseValueBuilder tunnelIdCaseBuilder = new TunIdCaseValueBuilder();
TunIdValuesBuilder tunnelIdBuilder = new TunIdValuesBuilder();
tunnelIdBuilder.setValue(value);
tunnelIdCaseBuilder.setTunIdValues(tunnelIdBuilder.build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunId.class, Nxm1Class.class, tunnelIdCaseBuilder.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension in project openflowplugin by opendaylight.
the class UdpSrcConvertor method convert.
@Override
public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
UdpSrcCaseValue udpSrcCaseValue = (UdpSrcCaseValue) input.getMatchEntryValue();
NxmOfUdpSrcBuilder udpSrcBuilder = new NxmOfUdpSrcBuilder();
udpSrcBuilder.setPort(udpSrcCaseValue.getUdpSrcValues().getPort());
udpSrcBuilder.setMask(udpSrcCaseValue.getUdpSrcValues().getMask());
return resolveAugmentation(udpSrcBuilder.build(), path, NxmOfUdpSrcKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension in project openflowplugin by opendaylight.
the class Nshc2Convertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxNshc2Grouping> matchGrouping = MatchUtil.NSC2_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
Long value = matchGrouping.get().getNxmNxNshc2().getValue();
Nshc2CaseValueBuilder nsc2CaseValueBuilder = new Nshc2CaseValueBuilder();
nsc2CaseValueBuilder.setNshc2Values(new Nshc2ValuesBuilder().setNshc(value).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc2.class, Nxm1Class.class, nsc2CaseValueBuilder.build()).build();
}
Aggregations