use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.encap.eth.src.grouping.EncapEthSrcValuesBuilder in project openflowplugin by opendaylight.
the class EncapEthSrcConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmNxEncapEthSrcGrouping> matchGrouping = MatchUtil.ENCAP_ETH_SRC_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
MacAddress macAddress = matchGrouping.get().getNxmNxEncapEthSrc().getMacAddress();
EncapEthSrcCaseValueBuilder encapEthSrcCaseValueBuilder = new EncapEthSrcCaseValueBuilder();
encapEthSrcCaseValueBuilder.setEncapEthSrcValues(new EncapEthSrcValuesBuilder().setMacAddress(macAddress).build());
return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxEncapEthSrc.class, Nxm1Class.class, encapEthSrcCaseValueBuilder.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.encap.eth.src.grouping.EncapEthSrcValuesBuilder in project openflowplugin by opendaylight.
the class EncapEthSrcCodec method deserialize.
@Override
public MatchEntry deserialize(ByteBuf message) {
MatchEntryBuilder matchEntriesBuilder = deserializeHeaderToBuilder(message);
byte[] address = new byte[VALUE_LENGTH];
message.readBytes(address);
EncapEthSrcCaseValueBuilder caseBuilder = new EncapEthSrcCaseValueBuilder();
caseBuilder.setEncapEthSrcValues(new EncapEthSrcValuesBuilder().setMacAddress(new MacAddress(ByteBufUtils.macAddressToString(address))).build());
matchEntriesBuilder.setMatchEntryValue(caseBuilder.build());
matchEntriesBuilder.setHasMask(false);
return matchEntriesBuilder.build();
}
Aggregations