diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-10-17 22:55:02 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-10-17 22:55:02 +0200 |
commit | 183130bcfa3c6bf5dbf73c38c1609c7b6bf21d3f (patch) | |
tree | c86c0fb198a3d560e6f6749cd803563f92165362 /python/vyos/ifconfig/stp.py | |
parent | 60109764cc18ae50802313716ce9197c9bd36e15 (diff) | |
parent | b90041af38c1d872210d3720c258721247d313a5 (diff) | |
download | vyos-1x-183130bcfa3c6bf5dbf73c38c1609c7b6bf21d3f.tar.gz vyos-1x-183130bcfa3c6bf5dbf73c38c1609c7b6bf21d3f.zip |
Merge branch 'bridge' of github.com:c-po/vyos-1x into current
* 'bridge' of github.com:c-po/vyos-1x:
smoketest: add IPv6 option tests to BasicInterfaceTest
ifconfig: T2985: support on demand bridge creation
geneve: T1799: add IPv6 CLI options
op-mode: add "show arp" command
Diffstat (limited to 'python/vyos/ifconfig/stp.py')
-rw-r--r-- | python/vyos/ifconfig/stp.py | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/python/vyos/ifconfig/stp.py b/python/vyos/ifconfig/stp.py deleted file mode 100644 index 5e83206c2..000000000 --- a/python/vyos/ifconfig/stp.py +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright 2019 VyOS maintainers and contributors <maintainers@vyos.io> -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library 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 -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library. If not, see <http://www.gnu.org/licenses/>. - - -from vyos.ifconfig.interface import Interface - -from vyos.validate import assert_positive - - -class STP: - """ - A spanning-tree capable interface. This applies only to bridge port member - interfaces! - """ - - @classmethod - def enable (cls, adaptee): - adaptee._sysfs_set = {**adaptee._sysfs_set, **cls._sysfs_set} - adaptee.set_path_cost = cls.set_path_cost - adaptee.set_path_priority = cls.set_path_priority - return adaptee - - _sysfs_set = { - 'path_cost': { - # XXX: we should set a maximum - 'validate': assert_positive, - 'location': '/sys/class/net/{ifname}/brport/path_cost', - 'errormsg': '{ifname} is not a bridge port member' - }, - 'path_priority': { - # XXX: we should set a maximum - 'validate': assert_positive, - 'location': '/sys/class/net/{ifname}/brport/priority', - 'errormsg': '{ifname} is not a bridge port member' - }, - } - - def set_path_cost(self, cost): - """ - Set interface path cost, only relevant for STP enabled interfaces - - Example: - - >>> from vyos.ifconfig import Interface - >>> Interface('eth0').set_path_cost(4) - """ - self.set_interface('path_cost', cost) - - def set_path_priority(self, priority): - """ - Set interface path priority, only relevant for STP enabled interfaces - - Example: - - >>> from vyos.ifconfig import Interface - >>> Interface('eth0').set_path_priority(4) - """ - self.set_interface('path_priority', priority) |