Commit 47dac15d authored by Martín Ferrari's avatar Martín Ferrari

Massive changes to interface module. Link class

parent fd099ed9
...@@ -53,7 +53,7 @@ link0.connect(if1) ...@@ -53,7 +53,7 @@ link0.connect(if1)
# Add and connect a tap device (as if a external router were plugged into a # Add and connect a tap device (as if a external router were plugged into a
# switch) # switch)
if2 = netns.ExternalInterface('tap0') if2 = netns.ForeignInterface('tap0')
link0.connect(if2) link0.connect(if2)
link0.up = True link0.up = True
......
...@@ -46,8 +46,4 @@ config = __Config() ...@@ -46,8 +46,4 @@ config = __Config()
def set_cleanup_hooks(on_exit = False, on_signals = []): def set_cleanup_hooks(on_exit = False, on_signals = []):
pass pass
class Link(object):
def connect(self, iface):
pass
This diff is collapsed.
...@@ -93,7 +93,7 @@ class Node(object): ...@@ -93,7 +93,7 @@ class Node(object):
ret = [] ret = []
for i in ifaces: for i in ifaces:
if i not in self._interfaces: if i not in self._interfaces:
ret.append(netns.interface.ExternalNodeInterface(self, i)) ret.append(netns.interface.ForeignNodeInterface(self, i))
else: else:
ret.append(self._interfaces[i]) ret.append(self._interfaces[i])
# by the way, clean up _interfaces # by the way, clean up _interfaces
......
...@@ -40,7 +40,7 @@ class TestInterfaces(unittest.TestCase): ...@@ -40,7 +40,7 @@ class TestInterfaces(unittest.TestCase):
devs = get_devs() devs = get_devs()
for i in range(5): for i in range(5):
peer_name = netns.iproute.get_if(ifaces[i].control_index).name peer_name = netns.iproute.get_if(ifaces[i].control.index).name
self.assertTrue(peer_name in devs) self.assertTrue(peer_name in devs)
@test_util.skipUnless(os.getuid() == 0, "Test requires root privileges") @test_util.skipUnless(os.getuid() == 0, "Test requires root privileges")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment