diff options
author | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-03-24 18:14:49 +0000 |
---|---|---|
committer | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-03-24 18:14:49 +0000 |
commit | 8a4dd6c2816bf2289ad4af37ba301b31efdf30a8 (patch) | |
tree | 5974407307b60984e2b1c71ecf949b1ca182c0f2 /python/vyos/ifconfig/ethernet.py | |
parent | 09f8e57535849aab83df6947fbe94a0e7228ed40 (diff) | |
download | vyos-1x-8a4dd6c2816bf2289ad4af37ba301b31efdf30a8.tar.gz vyos-1x-8a4dd6c2816bf2289ad4af37ba301b31efdf30a8.zip |
ifconfig: T2057: add class Register
Diffstat (limited to 'python/vyos/ifconfig/ethernet.py')
-rw-r--r-- | python/vyos/ifconfig/ethernet.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py index 30e3a3bef..606161121 100644 --- a/python/vyos/ifconfig/ethernet.py +++ b/python/vyos/ifconfig/ethernet.py @@ -17,15 +17,31 @@ import os import re from vyos.ifconfig.vlan import VLANIf +from vyos.ifconfig.interface import Interface from vyos.validate import * +@Interface.register class EthernetIf(VLANIf): """ Abstraction of a Linux Ethernet Interface """ + default = { + 'type': 'ethernet', + } + definition = { + **Interface.definition, + **{ + 'section': 'ethernet', + 'prefixes': ['lan', 'eth', 'eno', 'ens', 'enp', 'enx'], + 'bondable': True, + 'broadcast': True, + 'bridgeable': True, + } + } + _command_set = {**VLANIf._command_set, **{ 'gro': { 'validate': lambda v: assert_list(v, ['on', 'off']), @@ -49,10 +65,6 @@ class EthernetIf(VLANIf): }, }} - default = { - 'type': 'ethernet', - } - def _delete(self): # Ethernet interfaces can not be removed pass |