summaryrefslogtreecommitdiffstats
path: root/test/vpp_interface.py
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-04-19 05:24:40 -0700
committerFlorin Coras <florin.coras@gmail.com>2017-04-19 20:23:34 +0000
commit2a3ea49d5cc224ffb2cf02bacaf0c02ddae12b86 (patch)
tree8b6a6176a3129c14c70308fdc5ab338ddc06523d /test/vpp_interface.py
parentc06eeb0e3c9c1a9fa8f913e2d785b03220bfdabd (diff)
Learn IP6 link-local ND entries from NSs sourced from link-local address
Change-Id: I4c3ce4d58df7977490fc94991291422ea1e31ee3 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test/vpp_interface.py')
-rw-r--r--test/vpp_interface.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/test/vpp_interface.py b/test/vpp_interface.py
index 5dba0978cb9..662015eacf7 100644
--- a/test/vpp_interface.py
+++ b/test/vpp_interface.py
@@ -1,7 +1,7 @@
from abc import abstractmethod, ABCMeta
import socket
-from util import Host
+from util import Host, mk_ll_addr
from vpp_neighbor import VppNeighbor
@@ -55,6 +55,16 @@ class VppInterface(object):
return socket.inet_pton(socket.AF_INET6, self.local_ip6)
@property
+ def local_ip6_ll(self):
+ """Local IPv6 linnk-local address on VPP interface (string)."""
+ return self._local_ip6_ll
+
+ @property
+ def local_ip6n_ll(self):
+ """Local IPv6 link-local address - raw, suitable as API parameter."""
+ return self.local_ip6n_ll
+
+ @property
def remote_ip6(self):
"""IPv6 address of remote peer "connected" to this interface."""
return self._remote_hosts[0].ip6
@@ -133,7 +143,8 @@ class VppInterface(object):
mac = "02:%02x:00:00:ff:%02x" % (self.sw_if_index, i)
ip4 = "172.16.%u.%u" % (self.sw_if_index, i)
ip6 = "fd01:%x::%x" % (self.sw_if_index, i)
- host = Host(mac, ip4, ip6)
+ ip6_ll = mk_ll_addr(mac)
+ host = Host(mac, ip4, ip6, ip6_ll)
self._remote_hosts.append(host)
self._hosts_by_mac[mac] = host
self._hosts_by_ip4[ip4] = host
@@ -176,6 +187,9 @@ class VppInterface(object):
"Could not find interface with sw_if_index %d "
"in interface dump %s" %
(self.sw_if_index, 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)
def config_ip4(self):
"""Configure IPv4 address on the VPP interface."""