aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/IPv6Util.py
diff options
context:
space:
mode:
authorMiroslav Miklus <mmiklus@cisco.com>2016-05-08 14:11:51 +0200
committerJan Gelety <jgelety@cisco.com>2016-06-28 00:15:03 +0000
commitcbd47fbe97945e9dc6584d08cd2266e3a7536a68 (patch)
tree9344a863606381b2ce8069d82f0731440c31b295 /resources/libraries/python/IPv6Util.py
parent1689b0781206d874fd2b664cdd7d770f1e3932c8 (diff)
Use interface key instead of interface name.
JIRA: CSIT-141 Change-Id: I75cef6d570ab45ea9c4af838b6bf68cefc7c1a91 Signed-off-by: Miroslav Miklus <mmiklus@cisco.com>
Diffstat (limited to 'resources/libraries/python/IPv6Util.py')
-rw-r--r--resources/libraries/python/IPv6Util.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/resources/libraries/python/IPv6Util.py b/resources/libraries/python/IPv6Util.py
index 35ec8d5258..437a7c0cbb 100644
--- a/resources/libraries/python/IPv6Util.py
+++ b/resources/libraries/python/IPv6Util.py
@@ -81,18 +81,19 @@ class IPv6Util(object):
return IPv6Util.ipv6_ping(src_node, dst_ip, cnt, size, timeout)
@staticmethod
- def get_node_port_ipv6_address(node, interface, nodes_addr):
+ def get_node_port_ipv6_address(node, iface_key, nodes_addr):
"""Return IPv6 address of the node port.
:param node: Node in the topology.
- :param interface: Interface name of the node.
+ :param iface_key: Interface key of the node.
:param nodes_addr: Nodes IPv6 addresses.
:type node: dict
- :type interface: str
+ :type iface_key: str
:type nodes_addr: dict
:return: IPv6 address string.
:rtype: str
"""
+ interface = Topology.get_interface_name(node, iface_key)
for net in nodes_addr.values():
for port in net['ports'].values():
host = port.get('node')
class="cm"> * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * misc.c: vnet misc * * Copyright (c) 2012 Eliot Dresselhaus * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <vnet/vnet.h> #include <vnet/ip/ip.h> vnet_main_t vnet_main; vnet_main_t * vnet_get_main (void) { return &vnet_main; } static uword vnet_local_interface_tx (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * f) { ASSERT (0); return f->n_vectors; } /* *INDENT-OFF* */ VNET_DEVICE_CLASS (vnet_local_interface_device_class) = { .name = "local", .tx_function = vnet_local_interface_tx, }; /* *INDENT-ON* */ /* *INDENT-OFF* */ VNET_HW_INTERFACE_CLASS (vnet_local_interface_hw_class,static) = { .name = "local", }; /* *INDENT-ON* */ clib_error_t * vnet_main_init (vlib_main_t * vm) { vnet_main_t *vnm = vnet_get_main (); u32 hw_if_index; vnet_hw_interface_t *hw; vnm->vlib_main = vm; hw_if_index = vnet_register_interface (vnm, vnet_local_interface_device_class.index, /* instance */ 0, vnet_local_interface_hw_class.index, /* instance */ 0); hw = vnet_get_hw_interface (vnm, hw_if_index); vnm->local_interface_hw_if_index = hw_if_index; vnm->local_interface_sw_if_index = hw->sw_if_index; /* the local interface is used as an input interface when decapping from * an IPSEC tunnel. so it needs to be IP enabled */ ip4_sw_interface_enable_disable (hw->sw_if_index, 1); ip6_sw_interface_enable_disable (hw->sw_if_index, 1); return 0; } /* *INDENT-OFF* */ VLIB_INIT_FUNCTION (vnet_main_init)= { .init_order = VLIB_INITS("vnet_interface_init", "ethernet_init", "fib_module_init", "mfib_module_init", "ip_main_init", "ip4_lookup_init", "ip6_lookup_init", "mpls_init", "vnet_main_init"), }; /* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */