Search in sources :

Example 1 with ArpTha

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);
}
Also used : ArpTargetHardwareAddressBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder) ArpTha(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.tha._case.ArpTha) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder) ArpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder) ArpMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder)

Aggregations

MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)1 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)1 ArpTargetHardwareAddressBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder)1 ArpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder)1 ArpTha (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.tha._case.ArpTha)1