use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EncapEthDstCaseValueBuilder 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.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EncapEthDstCaseValueBuilder in project openflowplugin by opendaylight.
the class EncapEthDstCodec method deserialize.
@Override
public MatchEntry deserialize(ByteBuf message) {
MatchEntryBuilder matchEntriesBuilder = deserializeHeaderToBuilder(message);
byte[] address = new byte[VALUE_LENGTH];
message.readBytes(address);
EncapEthDstCaseValueBuilder caseBuilder = new EncapEthDstCaseValueBuilder();
caseBuilder.setEncapEthDstValues(new EncapEthDstValuesBuilder().setMacAddress(new MacAddress(ByteBufUtils.macAddressToString(address))).build());
matchEntriesBuilder.setMatchEntryValue(caseBuilder.build());
matchEntriesBuilder.setHasMask(false);
return matchEntriesBuilder.build();
}
Aggregations