X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fserialization%2Fmatch%2FAbstractOxmMacAddressSerializer.java;h=51b62df958af2c9bc86d08993b7f5ec9204aefe3;hb=519a86d1ddcfb8f0fe264174e62e5424e1efba1f;hp=847a04091c0ef1500c79c69ce88fef436afcadcd;hpb=37cf2e565f6ec0f86f65b35898091fcf279753a5;p=openflowjava.git diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/AbstractOxmMacAddressSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/AbstractOxmMacAddressSerializer.java index 847a0409..51b62df9 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/AbstractOxmMacAddressSerializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/AbstractOxmMacAddressSerializer.java @@ -1,29 +1,29 @@ -/* - * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.openflowjava.protocol.impl.serialization.match; - -import io.netty.buffer.ByteBuf; - -import org.opendaylight.openflowjava.util.ByteBufUtils; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntry; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries; - -/** - * Parent for MAC address based match entry serializers - * @author michal.polkorab - */ -public abstract class AbstractOxmMacAddressSerializer extends AbstractOxmMatchEntrySerializer { - - @Override - public void serialize(MatchEntries entry, ByteBuf outBuffer) { - super.serialize(entry, outBuffer); - String macAddress = entry.getAugmentation(MacAddressMatchEntry.class).getMacAddress().getValue(); - outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(macAddress)); // 48 b + mask [OF 1.3.2 spec] - writeMask(entry, outBuffer, getValueLength()); - } -} +/* + * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.openflowjava.protocol.impl.serialization.match; + +import io.netty.buffer.ByteBuf; + +import org.opendaylight.openflowjava.util.ByteBufUtils; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntry; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries; + +/** + * Parent for MAC address based match entry serializers + * @author michal.polkorab + */ +public abstract class AbstractOxmMacAddressSerializer extends AbstractOxmMatchEntrySerializer { + + @Override + public void serialize(MatchEntries entry, ByteBuf outBuffer) { + super.serialize(entry, outBuffer); + String macAddress = entry.getAugmentation(MacAddressMatchEntry.class).getMacAddress().getValue(); + outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(macAddress)); // 48 b + mask [OF 1.3.2 spec] + writeMask(entry, outBuffer, getValueLength()); + } +}