X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=doc%2Fsphinx%2F_build%2Fhtml%2F_modules%2Fnepi%2Fresources%2Fnetns%2Fnetnsswitch.html;fp=doc%2Fsphinx%2F_build%2Fhtml%2F_modules%2Fnepi%2Fresources%2Fnetns%2Fnetnsswitch.html;h=eabd651ce6792273cd5660b57f900efd95e90e6c;hb=590481ab47520f9bfdfda34630408a09a770f5a1;hp=0000000000000000000000000000000000000000;hpb=206ba8e9c3a5fd5842e9b1a0d678293da6670d3b;p=nepi.git diff --git a/doc/sphinx/_build/html/_modules/nepi/resources/netns/netnsswitch.html b/doc/sphinx/_build/html/_modules/nepi/resources/netns/netnsswitch.html new file mode 100644 index 00000000..eabd651c --- /dev/null +++ b/doc/sphinx/_build/html/_modules/nepi/resources/netns/netnsswitch.html @@ -0,0 +1,153 @@ + + + + +
+ + +
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2014 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation;
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
+
+from nepi.execution.attribute import Attribute, Flags, Types
+from nepi.execution.resource import clsinit_copy
+from nepi.resources.netns.netnsbase import NetNSBase
+
+@clsinit_copy
+[docs]class NetNSSwitch(NetNSBase):
+ _rtype = "netns::Switch"
+
+ @classmethod
+ def _register_attributes(cls):
+ up = Attribute("up", "Switch up",
+ default = True,
+ type = Types.Bool)
+
+ cls._register_attribute(up)
+
+ @property
+
+ @property
+
+ @property
+[docs] def interface(self):
+ from nepi.resources.netns.netnsinterface import NetNSInterface
+ interface = self.get_connected(NetNSInterface.get_rtype())
+
+ if not interface:
+ msg = "Switch not connected to any Interface!!"
+ self.error(msg)
+ raise RuntimeError, msg
+
+ return interface[0]
+
+ @property
+ def _rms_to_wait(self):
+ return [self.emulation]
+
+ def _instantiate_object(self):
+ self._uuid = self.emulation.create("Switch")
+ self.emulation.emu_set(self.uuid, "up", self.get("up"))
+