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