aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_ip.py
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2018-11-22 12:53:00 +0100
committerOle Troan <ot@cisco.com>2018-11-22 21:28:33 +0100
commitffba3c377c679a69fd9507bc8f8bc3acf8258d1e (patch)
treeafb66dc7250eb2597c5bb0075ca303a7cd12c32f /test/vpp_ip.py
parentfccd1b2b694146506e0efdeee6c23674550fc5d5 (diff)
MAP: Use explicit address/prefix types in API
Change-Id: Ic751fecc4a060eedcdb9eaf5d02e1416c838fd63 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'test/vpp_ip.py')
-rw-r--r--test/vpp_ip.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/vpp_ip.py b/test/vpp_ip.py
index 6d22c16ff60..2083e03b5e5 100644
--- a/test/vpp_ip.py
+++ b/test/vpp_ip.py
@@ -200,6 +200,20 @@ class VppIpPrefix():
return False
+class VppIp6Prefix():
+ def __init__(self, prefix, prefixlen):
+ self.ip_prefix = ip_address(unicode(prefix))
+ self.prefixlen = prefixlen
+
+ def encode(self):
+ return {'prefix': {'address': self.ip_prefix.packed},
+ 'len': self.prefixlen}
+
+
+class VppIp4Prefix(VppIp6Prefix):
+ pass
+
+
class VppIpMPrefix():
def __init__(self, saddr, gaddr, len):
self.saddr = saddr