use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.tpa._case.ArpTpa in project openflowplugin by opendaylight.
the class OfToSalArpTpaCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull ArpTpaCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final ArpMatchBuilder arpMatchBuilder = data.getArpMatchBuilder();
ArpTpa arpTpa = source.getArpTpa();
if (arpTpa != null) {
int mask = 32;
if (null != arpTpa.getMask()) {
mask = IpConversionUtil.countBits(arpTpa.getMask());
}
Ipv4Prefix ipv4Prefix = IpConversionUtil.createPrefix(arpTpa.getIpv4Address(), mask);
arpMatchBuilder.setArpTargetTransportAddress(ipv4Prefix);
matchBuilder.setLayer3Match(arpMatchBuilder.build());
}
return Optional.of(matchBuilder);
}
Aggregations