use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfTcpSrcGrouping in project openflowplugin by opendaylight.
the class TcpSrcConvertor method convert.
@Override
public MatchEntry convert(Extension extension) {
Optional<NxmOfTcpSrcGrouping> matchGrouping = MatchUtil.TCP_SRC_RESOLVER.getExtension(extension);
if (!matchGrouping.isPresent()) {
throw new CodecPreconditionException(extension);
}
TcpSrcCaseValueBuilder tcpSrcCaseValueBuilder = new TcpSrcCaseValueBuilder();
TcpSrcValuesBuilder tcpSrcValuesBuilder = new TcpSrcValuesBuilder();
tcpSrcValuesBuilder.setPort(matchGrouping.get().getNxmOfTcpSrc().getPort());
tcpSrcValuesBuilder.setMask(matchGrouping.get().getNxmOfTcpSrc().getMask());
tcpSrcCaseValueBuilder.setTcpSrcValues(tcpSrcValuesBuilder.build());
MatchEntryBuilder ofMatch = MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfTcpSrc.class, Nxm0Class.class, tcpSrcCaseValueBuilder.build());
ofMatch.setHasMask(true);
return ofMatch.build();
}
Aggregations