use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpTha in project openflowplugin by opendaylight.
the class OfToSalArpThaCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull ArpThaCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final ArpMatchBuilder arpMatchBuilder = data.getArpMatchBuilder();
ArpTha arpTha = source.getArpTha();
MacAddress macAddress = arpTha.getMacAddress();
if (macAddress != null) {
ArpTargetHardwareAddressBuilder arpTargetHardwareAddressBuilder = new ArpTargetHardwareAddressBuilder();
arpTargetHardwareAddressBuilder.setAddress(macAddress);
byte[] mask = arpTha.getMask();
if (mask != null) {
arpTargetHardwareAddressBuilder.setMask(new MacAddress(ByteBufUtils.macAddressToString(mask)));
}
arpMatchBuilder.setArpTargetHardwareAddress(arpTargetHardwareAddressBuilder.build());
matchBuilder.setLayer3Match(arpMatchBuilder.build());
}
return Optional.of(matchBuilder);
}
Aggregations