summaryrefslogtreecommitdiffstats
path: root/vpp-common
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-08-25 16:58:55 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-08-26 12:39:27 +0200
commit31c95db0e5a2dfeb3bcee7f8c6b9a40b7807ad2c (patch)
tree0a2e48a25a5e223db9c833a79dca51b8d743f584 /vpp-common
parent36d38b3eadccb2593188d9c7b830ba596143607a (diff)
HONEYCOMB-139: ietf-acl translation layer. IP4 L3 ACL support
Change-Id: I5e5af0d7609aa594790b35a387ec8701f1f6b6df Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'vpp-common')
-rw-r--r--vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/TranslateUtils.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/TranslateUtils.java b/vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/TranslateUtils.java
index 4ecf8ff91..0902064eb 100644
--- a/vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/TranslateUtils.java
+++ b/vpp-common/vpp-translate-utils/src/main/java/io/fd/honeycomb/translate/v3po/util/TranslateUtils.java
@@ -109,8 +109,12 @@ public final class TranslateUtils {
* @return byte array with address bytes
*/
public static byte[] ipv4AddressNoZoneToArray(final Ipv4AddressNoZone ipv4Addr) {
+ return ipv4AddressNoZoneToArray(ipv4Addr.getValue());
+ }
+
+ public static byte[] ipv4AddressNoZoneToArray(final String ipv4Addr) {
byte[] retval = new byte[4];
- String[] dots = ipv4Addr.getValue().split("\\.");
+ String[] dots = ipv4Addr.split("\\.");
for (int d = 0; d < 4; d++) {
retval[d] = (byte) (Short.parseShort(dots[d]) & 0xff);