summaryrefslogtreecommitdiffstats
path: root/vpp-common/vpp-translate-utils/src
diff options
context:
space:
mode:
Diffstat (limited to 'vpp-common/vpp-translate-utils/src')
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/MacTranslator.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/MacTranslator.java b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/MacTranslator.java
index b31dc30b2..71b8a15e6 100644
--- a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/MacTranslator.java
+++ b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/MacTranslator.java
@@ -26,6 +26,7 @@ import java.util.function.BiConsumer;
import javax.annotation.Nonnull;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress;
/**
* Trait providing logic for translation of MAC address data
@@ -89,6 +90,10 @@ public interface MacTranslator {
return separated;
}
+ default PhysAddress toPhysAddress(final byte[] macAddress) {
+ return new PhysAddress(byteArrayToMacSeparated(macAddress));
+ }
+
/**
* Converts MAC string to byte array
*/