diff --git a/test/ext/vapi_c_test.c b/test/ext/vapi_c_test.c
index 0b22fff..725f5c3 100644
--- a/test/ext/vapi_c_test.c
+++ b/test/ext/vapi_c_test.c
@@ -514,7 +514,7 @@
     {
       ck_assert (NULL != reply);
       printf ("Interface dump entry: [%u]: %s\n", reply->sw_if_index,
-	      reply->interface_name);
+	      reply->interface_name.buf);
       size_t i = 0;
       for (i = 0; i < dctx->num_ifs; ++i)
 	{
@@ -577,8 +577,8 @@
       clib_memset (&seen, 0, sizeof (seen));
       dump = vapi_alloc_sw_interface_dump (ctx);
       dump->payload.name_filter_valid = 0;
-      clib_memset (dump->payload.name_filter, 0,
-		   sizeof (dump->payload.name_filter));
+      clib_memset (dump->payload.name_filter.buf, 0,
+		   dump->payload.name_filter.length);
       while (VAPI_EAGAIN ==
 	     (rv =
 	      vapi_sw_interface_dump (ctx, dump, sw_interface_dump_cb,
@@ -609,8 +609,8 @@
   clib_memset (&seen, 0, sizeof (seen));
   dump = vapi_alloc_sw_interface_dump (ctx);
   dump->payload.name_filter_valid = 0;
-  clib_memset (dump->payload.name_filter, 0,
-	       sizeof (dump->payload.name_filter));
+  clib_memset (dump->payload.name_filter.buf, 0,
+	       dump->payload.name_filter.length);
   while (VAPI_EAGAIN ==
 	 (rv =
 	  vapi_sw_interface_dump (ctx, dump, sw_interface_dump_cb, &dctx)))
@@ -734,8 +734,8 @@
   sw_interface_dump_ctx dctx = { false, num_ifs, sw_if_indexes, seen, 0 };
   vapi_msg_sw_interface_dump *dump = vapi_alloc_sw_interface_dump (ctx);
   dump->payload.name_filter_valid = 0;
-  clib_memset (dump->payload.name_filter, 0,
-	       sizeof (dump->payload.name_filter));
+  clib_memset (dump->payload.name_filter.buf, 0,
+	       dump->payload.name_filter.length);
   while (VAPI_EAGAIN ==
 	 (rv =
 	  vapi_sw_interface_dump (ctx, dump, sw_interface_dump_cb, &dctx)))
@@ -775,8 +775,8 @@
   dctx.last_called = false;
   dump = vapi_alloc_sw_interface_dump (ctx);
   dump->payload.name_filter_valid = 0;
-  clib_memset (dump->payload.name_filter, 0,
-	       sizeof (dump->payload.name_filter));
+  clib_memset (dump->payload.name_filter.buf, 0,
+	       dump->payload.name_filter.length);
   while (VAPI_EAGAIN ==
 	 (rv =
 	  vapi_sw_interface_dump (ctx, dump, sw_interface_dump_cb, &dctx)))
diff --git a/test/ext/vapi_cpp_test.cpp b/test/ext/vapi_cpp_test.cpp
index 68366af..46a2c0e 100644
--- a/test/ext/vapi_cpp_test.cpp
+++ b/test/ext/vapi_cpp_test.cpp
@@ -151,7 +151,7 @@
     Sw_interface_dump d (con);
     auto &p = d.get_request ().get_payload ();
     p.name_filter_valid = 0;
-    memset (p.name_filter, 0, sizeof (p.name_filter));
+    memset (p.name_filter.buf, 0, p.name_filter.length);
     auto rv = d.execute ();
     ck_assert_int_eq (VAPI_OK, rv);
     WAIT_FOR_RESPONSE (d, rv);
@@ -193,7 +193,7 @@
     Sw_interface_dump d (con);
     auto &p = d.get_request ().get_payload ();
     p.name_filter_valid = 0;
-    memset (p.name_filter, 0, sizeof (p.name_filter));
+    memset (p.name_filter.buf, 0, p.name_filter.length);
     auto rv = d.execute ();
     ck_assert_int_eq (VAPI_OK, rv);
     WAIT_FOR_RESPONSE (d, rv);
@@ -311,7 +311,7 @@
   Sw_interface_dump d (con, std::ref (swdcb));
   auto &p = d.get_request ().get_payload ();
   p.name_filter_valid = 0;
-  memset (p.name_filter, 0, sizeof (p.name_filter));
+  memset (p.name_filter.buf, 0, p.name_filter.length);
   auto rv = d.execute ();
   ck_assert_int_eq (VAPI_OK, rv);
   WAIT_FOR_RESPONSE (d, rv);
@@ -340,7 +340,7 @@
     Sw_interface_dump d (con);
     auto &p = d.get_request ().get_payload ();
     p.name_filter_valid = 0;
-    memset (p.name_filter, 0, sizeof (p.name_filter));
+    memset (p.name_filter.buf, 0, p.name_filter.length);
     auto rv = d.execute ();
     ck_assert_int_eq (VAPI_OK, rv);
     WAIT_FOR_RESPONSE (d, rv);
diff --git a/test/remote_test.py b/test/remote_test.py
index bc6d707..f5b3c62 100644
--- a/test/remote_test.py
+++ b/test/remote_test.py
@@ -3,14 +3,21 @@
 import inspect
 import os
 import unittest
+from framework import VppTestCase
 from multiprocessing import Process, Pipe
 from pickle import dumps
-
 import six
 from six import moves
+import sys
+if sys.version_info <= (3, 4):
+    from aenum import IntEnum
+else:
+    from enum import IntEnum
 
-from framework import VppTestCase
-from enum import Enum
+if sys.version_info <= (3, 6):
+    from aenum import IntFlag
+else:
+    from enum import IntFlag
 
 
 class SerializableClassCopy(object):
@@ -266,7 +273,7 @@
             if type(obj) is tuple:
                 rv = tuple(rv)
             return rv
-        elif (isinstance(obj, Enum)):
+        elif (isinstance(obj, IntEnum) or isinstance(obj, IntFlag)):
             return obj.value
         else:
             return self._make_obj_serializable(obj)
diff --git a/test/test_bond.py b/test/test_bond.py
index 533038e..eb43281 100644
--- a/test/test_bond.py
+++ b/test/test_bond.py
@@ -9,6 +9,7 @@
 from scapy.layers.inet import IP, UDP
 from vpp_bond_interface import VppBondInterface
 from vpp_papi import MACAddress
+from vpp_ip import VppIpPrefix
 
 
 class TestBondInterface(VppTestCase):
@@ -64,10 +65,9 @@
                                  mac_address=mac)
         bond0.add_vpp_config()
         bond0.admin_up()
-        bond0_addr = socket.inet_pton(socket.AF_INET, "10.10.10.1")
-        self.vapi.sw_interface_add_del_address(sw_if_index=bond0.sw_if_index,
-                                               address=bond0_addr,
-                                               address_length=24)
+        self.vapi.sw_interface_add_del_address(
+            sw_if_index=bond0.sw_if_index,
+            prefix=VppIpPrefix("10.10.10.1", 24).encode())
 
         self.pg2.config_ip4()
         self.pg2.resolve_arp()
diff --git a/test/test_interface_crud.py b/test/test_interface_crud.py
index d78cb58..b845c6b 100644
--- a/test/test_interface_crud.py
+++ b/test/test_interface_crud.py
@@ -81,7 +81,7 @@
         # create
         loopbacks = self.create_loopback_interfaces(20)
         for i in loopbacks:
-            i.local_ip4_prefix_len = 32
+            i.local_ip4_prefix.len = 32
             i.config_ip4()
             i.admin_up()
 
@@ -123,7 +123,7 @@
         # create
         loopbacks = self.create_loopback_interfaces(20)
         for i in loopbacks:
-            i.local_ip4_prefix_len = 32
+            i.local_ip4_prefix.len = 32
             i.config_ip4()
             i.admin_up()
 
diff --git a/test/test_ip4.py b/test/test_ip4.py
index c8c0a71..8282d13 100644
--- a/test/test_ip4.py
+++ b/test/test_ip4.py
@@ -17,6 +17,7 @@
     VppMRoutePath, MRouteItfFlags, MRouteEntryFlags, VppMplsIpBind, \
     VppMplsTable, VppIpTable
 from vpp_sub_interface import VppSubInterface, VppDot1QSubint, VppDot1ADSubint
+from vpp_ip import VppIpPrefix
 
 
 class TestIPv4(VppTestCase):
@@ -810,8 +811,8 @@
         ip_addr_n = socket.inet_pton(socket.AF_INET, "10.10.10.10")
 
         self.vapi.sw_interface_add_del_address(
-            sw_if_index=self.pg0.sw_if_index, address=ip_addr_n,
-            address_length=16)
+            sw_if_index=self.pg0.sw_if_index,
+            prefix=VppIpPrefix("10.10.10.10", 16).encode())
 
         pn = (Ether(src=self.pg1.remote_mac,
                     dst=self.pg1.local_mac) /
@@ -829,8 +830,9 @@
 
         # remove the sub-net and we are forwarding via the cover again
         self.vapi.sw_interface_add_del_address(
-            sw_if_index=self.pg0.sw_if_index, address=ip_addr_n,
-            address_length=16, is_add=0)
+            sw_if_index=self.pg0.sw_if_index,
+            prefix=VppIpPrefix("10.10.10.10", 16).encode(), is_add=0)
+
         self.pg1.add_stream(pn)
         self.pg_enable_capture(self.pg_interfaces)
         self.pg_start()
@@ -847,8 +849,8 @@
         ip_addr_n = socket.inet_pton(socket.AF_INET, "10.10.10.10")
 
         self.vapi.sw_interface_add_del_address(
-            sw_if_index=self.pg0.sw_if_index, address=ip_addr_n,
-            address_length=31)
+            sw_if_index=self.pg0.sw_if_index,
+            prefix=VppIpPrefix("10.10.10.10", 31).encode())
 
         pn = (Ether(src=self.pg1.remote_mac,
                     dst=self.pg1.local_mac) /
@@ -864,8 +866,9 @@
 
         # remove the sub-net and we are forwarding via the cover again
         self.vapi.sw_interface_add_del_address(
-            sw_if_index=self.pg0.sw_if_index, address=ip_addr_n,
-            address_length=31, is_add=0)
+            sw_if_index=self.pg0.sw_if_index,
+            prefix=VppIpPrefix("10.10.10.10", 31).encode(), is_add=0)
+
         self.pg1.add_stream(pn)
         self.pg_enable_capture(self.pg_interfaces)
         self.pg_start()
diff --git a/test/test_memif.py b/test/test_memif.py
index d89e06b..e5ff181 100644
--- a/test/test_memif.py
+++ b/test/test_memif.py
@@ -208,14 +208,14 @@
         pkts = []
         for i in range(num):
             pkt = (Ether(dst=pg.local_mac, src=pg.remote_mac) /
-                   IP(src=pg.remote_ip4, dst=memif.ip4_addr) /
+                   IP(src=pg.remote_ip4, dst=memif.ip_prefix.address) /
                    ICMP(id=memif.if_id, type='echo-request', seq=i))
             pkts.append(pkt)
         return pkts
 
     def _verify_icmp(self, pg, memif, rx, seq):
         ip = rx[IP]
-        self.assertEqual(ip.src, memif.ip4_addr)
+        self.assertEqual(ip.src, memif.ip_prefix.address)
         self.assertEqual(ip.dst, pg.remote_ip4)
         self.assertEqual(ip.proto, 1)
         icmp = rx[ICMP]
@@ -249,10 +249,11 @@
         # add routing to remote vpp
         dst_addr = socket.inet_pton(socket.AF_INET, self.pg0._local_ip4_subnet)
         dst_addr_len = 24
-        next_hop_addr = socket.inet_pton(socket.AF_INET, memif.ip4_addr)
-        self.remote_test.vapi.ip_add_del_route(dst_address=dst_addr,
-                                               dst_address_length=dst_addr_len,
-                                               next_hop_address=next_hop_addr)
+        next_hop_addr = socket.inet_pton(socket.AF_INET,
+                                         memif.ip_prefix.address)
+        self.remote_test.vapi.ip_add_del_route(
+            dst_address=dst_addr, dst_address_length=dst_addr_len,
+            next_hop_address=next_hop_addr)
 
         # create ICMP echo-request from local pg to remote memif
         packet_num = 10
diff --git a/test/test_nat.py b/test/test_nat.py
index b2c442f..69a18f8 100644
--- a/test/test_nat.py
+++ b/test/test_nat.py
@@ -26,6 +26,7 @@
 from vpp_papi_provider import SYSLOG_SEVERITY
 from io import BytesIO
 from vpp_papi import VppEnum
+from vpp_ip import VppIpAddress, VppIpPrefix
 from scapy.all import bind_layers, Packet, ByteEnumField, ShortField, \
     IPField, IntField, LongField, XByteField, FlagsField, FieldLenField, \
     PacketListField
@@ -1526,16 +1527,16 @@
             cls.vapi.ip_table_add_del(is_add=1, table_id=10)
             cls.vapi.ip_table_add_del(is_add=1, table_id=20)
 
-            cls.pg4._local_ip4 = "172.16.255.1"
-            cls.pg4._local_ip4n = socket.inet_pton(socket.AF_INET, i.local_ip4)
+            cls.pg4._local_ip4 = VppIpPrefix("172.16.255.1",
+                                             cls.pg4.local_ip4_prefix.len)
             cls.pg4._remote_hosts[0]._ip4 = "172.16.255.2"
             cls.pg4.set_table_ip4(10)
-            cls.pg5._local_ip4 = "172.17.255.3"
-            cls.pg5._local_ip4n = socket.inet_pton(socket.AF_INET, i.local_ip4)
+            cls.pg5._local_ip4 = VppIpPrefix("172.17.255.3",
+                                             cls.pg5.local_ip4_prefix.len)
             cls.pg5._remote_hosts[0]._ip4 = "172.17.255.4"
             cls.pg5.set_table_ip4(10)
-            cls.pg6._local_ip4 = "172.16.255.1"
-            cls.pg6._local_ip4n = socket.inet_pton(socket.AF_INET, i.local_ip4)
+            cls.pg6._local_ip4 = VppIpPrefix("172.16.255.1",
+                                             cls.pg6.local_ip4_prefix.len)
             cls.pg6._remote_hosts[0]._ip4 = "172.16.255.2"
             cls.pg6.set_table_ip4(20)
             for i in cls.overlapping_interfaces:
@@ -1548,10 +1549,10 @@
 
             cls.pg9.generate_remote_hosts(2)
             cls.pg9.config_ip4()
-            ip_addr_n = socket.inet_pton(socket.AF_INET, "10.0.0.1")
             cls.vapi.sw_interface_add_del_address(
-                sw_if_index=cls.pg9.sw_if_index, address=ip_addr_n,
-                address_length=24)
+                sw_if_index=cls.pg9.sw_if_index,
+                prefix=VppIpPrefix("10.0.0.1", 24).encode())
+
             cls.pg9.admin_up()
             cls.pg9.resolve_arp()
             cls.pg9._remote_hosts[1]._ip4 = cls.pg9._remote_hosts[0]._ip4
@@ -4213,10 +4214,10 @@
 
             cls.pg4.generate_remote_hosts(2)
             cls.pg4.config_ip4()
-            ip_addr_n = socket.inet_pton(socket.AF_INET, "10.0.0.1")
             cls.vapi.sw_interface_add_del_address(
-                sw_if_index=cls.pg4.sw_if_index, address=ip_addr_n,
-                address_length=24)
+                sw_if_index=cls.pg4.sw_if_index,
+                prefix=VppIpPrefix("10.0.0.1", 24).encode())
+
             cls.pg4.admin_up()
             cls.pg4.resolve_arp()
             cls.pg4._remote_hosts[1]._ip4 = cls.pg4._remote_hosts[0]._ip4
@@ -4225,9 +4226,8 @@
             zero_ip4n = socket.inet_pton(socket.AF_INET, "0.0.0.0")
             cls.vapi.ip_table_add_del(is_add=1, table_id=1)
 
-            cls.pg5._local_ip4 = "10.1.1.1"
-            cls.pg5._local_ip4n = socket.inet_pton(socket.AF_INET,
-                                                   cls.pg5.local_ip4)
+            cls.pg5._local_ip4 = VppIpPrefix("10.1.1.1",
+                                             cls.pg5.local_ip4_prefix.len)
             cls.pg5._remote_hosts[0]._ip4 = "10.1.1.2"
             cls.pg5._remote_hosts[0]._ip4n = socket.inet_pton(
                 socket.AF_INET, cls.pg5.remote_ip4)
@@ -4240,9 +4240,8 @@
                                       next_hop_sw_if_index=cls.pg5.sw_if_index,
                                       table_id=1)
 
-            cls.pg6._local_ip4 = "10.1.2.1"
-            cls.pg6._local_ip4n = socket.inet_pton(socket.AF_INET,
-                                                   cls.pg6.local_ip4)
+            cls.pg6._local_ip4 = VppIpPrefix("10.1.2.1",
+                                             cls.pg6.local_ip4_prefix.len)
             cls.pg6._remote_hosts[0]._ip4 = "10.1.2.2"
             cls.pg6._remote_hosts[0]._ip4n = socket.inet_pton(
                 socket.AF_INET, cls.pg6.remote_ip4)
diff --git a/test/test_span.py b/test/test_span.py
index b6f816e..dddd57f 100644
--- a/test/test_span.py
+++ b/test/test_span.py
@@ -233,7 +233,7 @@
 
         self.sub_if.admin_up()
         self.vapi.sw_interface_set_flags(self.vxlan.sw_if_index,
-                                         admin_up_down=1)
+                                         flags=1)
 
         self.bridge(self.vxlan.sw_if_index, is_add=1)
         # Create bi-directional cross-connects between pg0 subif and pg1
diff --git a/test/vpp_interface.py b/test/vpp_interface.py
index d586c84..4c4e413 100644
--- a/test/vpp_interface.py
+++ b/test/vpp_interface.py
@@ -6,7 +6,8 @@
 from six import moves
 
 from util import Host, mk_ll_addr
-from vpp_papi import mac_ntop
+from vpp_papi import mac_ntop, VppEnum
+from vpp_ip import VppIpAddress, VppIpPrefix
 
 
 @six.add_metaclass(abc.ABCMeta)
@@ -37,22 +38,25 @@
         return self._remote_addr
 
     @property
-    def local_addr_n(self):
-        return self._local_addr_n
-
-    @property
-    def remote_addr_n(self):
-        return self._remote_addr_n
-
-    @property
     def local_ip4(self):
         """Local IPv4 address on VPP interface (string)."""
+        return self._local_ip4.address
+
+    @property
+    def local_ip4_prefix_len(self):
+        """Local IPv4 prefix length """
+        return self._local_ip4.len
+
+    @property
+    def local_ip4_prefix(self):
+        """Local IPv4 prefix """
         return self._local_ip4
 
     @property
     def local_ip4n(self):
+        """DEPRECATED """
         """Local IPv4 address - raw, suitable as API parameter."""
-        return socket.inet_pton(socket.AF_INET, self._local_ip4)
+        return socket.inet_pton(socket.AF_INET, self._local_ip4.address)
 
     @property
     def remote_ip4(self):
@@ -61,18 +65,30 @@
 
     @property
     def remote_ip4n(self):
-        """IPv4 address of remote peer - raw, suitable as API parameter."""
-        return socket.inet_pton(socket.AF_INET, self.remote_ip4)
+        """DEPRECATED """
+        """Local IPv6 address - raw, suitable as API parameter."""
+        return socket.inet_pton(socket.AF_INET, self._remote_hosts[0].ip4)
 
     @property
     def local_ip6(self):
         """Local IPv6 address on VPP interface (string)."""
+        return self._local_ip6.address
+
+    @property
+    def local_ip6_prefix_len(self):
+        """Local IPv6 prefix length """
+        return self._local_ip6.len
+
+    @property
+    def local_ip6_prefix(self):
+        """Local IPv6 prefix """
         return self._local_ip6
 
     @property
     def local_ip6n(self):
+        """DEPRECATED """
         """Local IPv6 address - raw, suitable as API parameter."""
-        return socket.inet_pton(socket.AF_INET6, self.local_ip6)
+        return socket.inet_pton(socket.AF_INET6, self._local_ip6.address)
 
     @property
     def remote_ip6(self):
@@ -81,18 +97,20 @@
 
     @property
     def remote_ip6n(self):
-        """IPv6 address of remote peer - raw, suitable as API parameter"""
-        return socket.inet_pton(socket.AF_INET6, self.remote_ip6)
+        """DEPRECATED """
+        """Local IPv6 address - raw, suitable as API parameter."""
+        return socket.inet_pton(socket.AF_INET6, self._remote_hosts[0].ip6)
 
     @property
     def local_ip6_ll(self):
         """Local IPv6 link-local address on VPP interface (string)."""
-        return self._local_ip6_ll
+        return self._local_ip6_ll.address
 
     @property
     def local_ip6n_ll(self):
-        """Local IPv6 link-local address - raw, suitable as API parameter."""
-        return self._local_ip6n_ll
+        """DEPRECATED """
+        """Local IPv6 link-local address on VPP interface (string)."""
+        return socket.inet_pton(socket.AF_INET6, self._local_ip6_ll.address)
 
     @property
     def remote_ip6_ll(self):
@@ -102,9 +120,9 @@
 
     @property
     def remote_ip6n_ll(self):
-        """Link-local IPv6 address of remote peer
-        - raw, suitable as API parameter"""
-        return self._remote_ip6n_ll
+        """DEPRECATED """
+        """Local IPv6 link-local address on VPP interface (string)."""
+        return socket.inet_pton(socket.AF_INET6, self._remote_ip6_ll)
 
     @property
     def name(self):
@@ -193,7 +211,7 @@
 
     def set_mac(self, mac):
         self._local_mac = str(mac)
-        self._local_ip6_ll = mk_ll_addr(self._local_mac)
+        self._local_ip6_ll = VppIpAddress(mk_ll_addr(self._local_mac))
         self.test.vapi.sw_interface_set_mac_address(
             self.sw_if_index, mac.packed)
 
@@ -202,39 +220,27 @@
 
         self.generate_remote_hosts()
 
-        self._local_ip4 = "172.16.%u.1" % self.sw_if_index
-        self._local_ip4n = socket.inet_pton(socket.AF_INET, self.local_ip4)
+        self._local_ip4 = VppIpPrefix("172.16.%u.1" % self.sw_if_index, 24)
         self._local_ip4_subnet = "172.16.%u.0" % self.sw_if_index
-        self._local_ip4n_subnet = socket.inet_pton(socket.AF_INET,
-                                                   self._local_ip4_subnet)
         self._local_ip4_bcast = "172.16.%u.255" % self.sw_if_index
-        self._local_ip4n_bcast = socket.inet_pton(socket.AF_INET,
-                                                  self._local_ip4_bcast)
-        self.local_ip4_prefix_len = 24
         self.has_ip4_config = False
         self.ip4_table_id = 0
 
-        self._local_ip6 = "fd01:%x::1" % self.sw_if_index
-        self._local_ip6n = socket.inet_pton(socket.AF_INET6, self.local_ip6)
-        self.local_ip6_prefix_len = 64
+        self._local_ip6 = VppIpPrefix("fd01:%x::1" % self.sw_if_index, 64)
         self.has_ip6_config = False
         self.ip6_table_id = 0
 
         self._local_addr = {socket.AF_INET: self.local_ip4,
                             socket.AF_INET6: self.local_ip6}
-        self._local_addr_n = {socket.AF_INET: self.local_ip4n,
-                              socket.AF_INET6: self.local_ip6n}
         self._remote_addr = {socket.AF_INET: self.remote_ip4,
                              socket.AF_INET6: self.remote_ip6}
-        self._remote_addr_n = {socket.AF_INET: self.remote_ip4n,
-                               socket.AF_INET6: self.remote_ip6n}
 
         r = self.test.vapi.sw_interface_dump()
         for intf in r:
             if intf.sw_if_index == self.sw_if_index:
                 self._name = intf.interface_name.split(b'\0',
                                                        1)[0].decode('utf8')
-                self._local_mac = mac_ntop(intf.l2_address)
+                self._local_mac = bytes(intf.l2_address)
                 self._dump = intf
                 break
         else:
@@ -242,18 +248,13 @@
                 "Could not find interface with sw_if_index %d "
                 "in interface dump %s" %
                 (self.sw_if_index, moves.reprlib.repr(r)))
-        self._local_ip6_ll = mk_ll_addr(self.local_mac)
-        self._local_ip6n_ll = socket.inet_pton(socket.AF_INET6,
-                                               self.local_ip6_ll)
+        self._local_ip6_ll = VppIpAddress(mk_ll_addr(self.local_mac))
         self._remote_ip6_ll = mk_ll_addr(self.remote_mac)
-        self._remote_ip6n_ll = socket.inet_pton(socket.AF_INET6,
-                                                self.remote_ip6_ll)
 
     def config_ip4(self):
         """Configure IPv4 address on the VPP interface."""
         self.test.vapi.sw_interface_add_del_address(
-            sw_if_index=self.sw_if_index, address=self.local_ip4n,
-            address_length=self.local_ip4_prefix_len)
+            sw_if_index=self.sw_if_index, prefix=self._local_ip4.encode())
         self.has_ip4_config = True
 
     def unconfig_ip4(self):
@@ -261,8 +262,8 @@
         try:
             if self.has_ip4_config:
                 self.test.vapi.sw_interface_add_del_address(
-                    sw_if_index=self.sw_if_index, address=self.local_ip4n,
-                    address_length=self.local_ip4_prefix_len, is_add=0)
+                    sw_if_index=self.sw_if_index,
+                    prefix=self._local_ip4.encode(), is_add=0)
         except AttributeError:
             self.has_ip4_config = False
         self.has_ip4_config = False
@@ -280,8 +281,7 @@
     def config_ip6(self):
         """Configure IPv6 address on the VPP interface."""
         self.test.vapi.sw_interface_add_del_address(
-            sw_if_index=self.sw_if_index, address=self._local_ip6n,
-            address_length=self.local_ip6_prefix_len, is_ipv6=1)
+            sw_if_index=self.sw_if_index, prefix=self._local_ip6.encode())
         self.has_ip6_config = True
 
     def unconfig_ip6(self):
@@ -289,9 +289,8 @@
         try:
             if self.has_ip6_config:
                 self.test.vapi.sw_interface_add_del_address(
-                    sw_if_index=self.sw_if_index, address=self.local_ip6n,
-                    address_length=self.local_ip6_prefix_len, is_ipv6=1,
-                    is_add=0)
+                    sw_if_index=self.sw_if_index,
+                    prefix=self._local_ip6.encode(), is_add=0)
         except AttributeError:
             self.has_ip6_config = False
         self.has_ip6_config = False
@@ -357,13 +356,14 @@
 
     def admin_up(self):
         """Put interface ADMIN-UP."""
-        self.test.vapi.sw_interface_set_flags(self.sw_if_index,
-                                              admin_up_down=1)
+        self.test.vapi.sw_interface_set_flags(
+            self.sw_if_index,
+            flags=VppEnum.vl_api_if_status_flags_t.IF_STATUS_API_FLAG_ADMIN_UP)
 
     def admin_down(self):
         """Put interface ADMIN-down."""
         self.test.vapi.sw_interface_set_flags(self.sw_if_index,
-                                              admin_up_down=0)
+                                              flags=0)
 
     def link_up(self):
         """Put interface link-state-UP."""
@@ -450,15 +450,15 @@
                                                   name='sw_interface_event')
             self.test.assert_equal(event.sw_if_index, self.sw_if_index,
                                    "sw_if_index")
-            self.test.assert_equal(event.admin_up_down, admin_up_down,
+            self.test.assert_equal((event.flags & 1), admin_up_down,
                                    "admin state")
-            self.test.assert_equal(event.link_up_down, link_up_down,
+            self.test.assert_equal((event.flags & 2), link_up_down,
                                    "link state")
         dump = self.test.vapi.sw_interface_dump()
         if_state = self.get_interface_config_from_dump(dump)
-        self.test.assert_equal(if_state.admin_up_down, admin_up_down,
+        self.test.assert_equal((if_state.flags & 1), admin_up_down,
                                "admin state")
-        self.test.assert_equal(if_state.link_up_down, link_up_down,
+        self.test.assert_equal((if_state.flags & 2), link_up_down,
                                "link state")
 
     def __str__(self):
diff --git a/test/vpp_ip_route.py b/test/vpp_ip_route.py
index b7ceb34..fbc00d3 100644
--- a/test/vpp_ip_route.py
+++ b/test/vpp_ip_route.py
@@ -161,15 +161,13 @@
 
     def add_vpp_config(self):
         self._test.vapi.sw_interface_add_del_address(
-            sw_if_index=self.intf.sw_if_index, address=self.prefix.bytes,
-            address_length=self.prefix.length, is_ipv6=self.prefix.is_ip6,
+            sw_if_index=self.intf.sw_if_index, prefix=self.prefix.encode(),
             is_add=1)
         self._test.registry.register(self, self._test.logger)
 
     def remove_vpp_config(self):
         self._test.vapi.sw_interface_add_del_address(
-            sw_if_index=self.intf.sw_if_index, address=self.prefix.bytes,
-            address_length=self.prefix.length, is_ipv6=self.prefix.is_ip6,
+            sw_if_index=self.intf.sw_if_index, prefix=self.prefix.encode(),
             is_add=0)
 
     def query_vpp_config(self):
diff --git a/test/vpp_memif.py b/test/vpp_memif.py
index 4ad9ffd..88b9189 100644
--- a/test/vpp_memif.py
+++ b/test/vpp_memif.py
@@ -3,6 +3,8 @@
 import six
 
 from vpp_object import VppObject
+from vpp_ip import VppIpPrefix
+from vpp_papi import VppEnum
 
 
 class MEMIF_ROLE:
@@ -87,8 +89,8 @@
         self.buffer_size = buffer_size
         self.hw_addr = hw_addr
         self.sw_if_index = None
-        self.ip4_addr = "192.168.%d.%d" % (self.if_id + 1, self.role + 1)
-        self.ip4_addr_len = 24
+        self.ip_prefix = VppIpPrefix("192.168.%d.%d" %
+                                     (self.if_id + 1, self.role + 1), 24)
 
     def add_vpp_config(self):
         rv = self._test.vapi.memif_create(self.role, self.mode, self.rx_queues,
@@ -101,11 +103,13 @@
 
     def admin_up(self):
         if self.sw_if_index:
-            return self._test.vapi.sw_interface_set_flags(self.sw_if_index, 1)
+            return self._test.vapi.sw_interface_set_flags(
+                sw_if_index=self.sw_if_index, flags=1)
 
     def admin_down(self):
         if self.sw_if_index:
-            return self._test.vapi.sw_interface_set_flags(self.sw_if_index, 0)
+            return self._test.vapi.sw_interface_set_flags(
+                sw_if_index=self.sw_if_index, flags=0)
 
     def wait_for_link_up(self, timeout, step=1):
         if not self.sw_if_index:
@@ -121,9 +125,7 @@
 
     def config_ip4(self):
         return self._test.vapi.sw_interface_add_del_address(
-            sw_if_index=self.sw_if_index, address=socket.inet_pton(
-                socket.AF_INET, self.ip4_addr),
-            address_length=self.ip4_addr_len)
+            sw_if_index=self.sw_if_index, prefix=self.ip_prefix.encode())
 
     def remove_vpp_config(self):
         self._test.vapi.memif_delete(self.sw_if_index)
diff --git a/test/vpp_sub_interface.py b/test/vpp_sub_interface.py
index 15cd6ed..9098929 100644
--- a/test/vpp_sub_interface.py
+++ b/test/vpp_sub_interface.py
@@ -4,6 +4,7 @@
 from vpp_pg_interface import VppPGInterface
 from vpp_papi_provider import L2_VTR_OP
 from vpp_interface import VppInterface
+from vpp_papi import VppEnum
 
 
 @six.add_metaclass(abc.ABCMeta)
@@ -171,10 +172,13 @@
 
     def __init__(self, test, parent, sub_id, outer_vlan, inner_vlan):
         super(VppDot1ADSubint, self).__init__(test, parent, sub_id)
+        flags = (VppEnum.vl_api_sub_if_flags_t.SUB_IF_API_FLAG_DOT1AD |
+                 VppEnum.vl_api_sub_if_flags_t.SUB_IF_API_FLAG_TWO_TAGS |
+                 VppEnum.vl_api_sub_if_flags_t.SUB_IF_API_FLAG_EXACT_MATCH)
         r = test.vapi.create_subif(sw_if_index=parent.sw_if_index,
                                    sub_id=sub_id, outer_vlan_id=outer_vlan,
-                                   inner_vlan_id=inner_vlan, two_tags=1,
-                                   dot1ad=1, exact_match=1)
+                                   inner_vlan_id=inner_vlan,
+                                   sub_if_flags=flags)
         self.set_sw_if_index(r.sw_if_index)
         self._outer_vlan = outer_vlan
         self._inner_vlan = inner_vlan
