summaryrefslogtreecommitdiff
path: root/python/vyos/configdict.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2020-11-12 08:34:01 -0600
committerGitHub <noreply@github.com>2020-11-12 08:34:01 -0600
commitbf31936562e4e827373ac56661a9e1a48ee0a0a6 (patch)
tree1d9a2a72366fde7ec757264bbab08a483cb72596 /python/vyos/configdict.py
parent2e498164218851f1b958c43a7b903849a80b8304 (diff)
parent3466941316a70ac840ebdcc7576230158be8a0fb (diff)
downloadvyos-1x-bf31936562e4e827373ac56661a9e1a48ee0a0a6.tar.gz
vyos-1x-bf31936562e4e827373ac56661a9e1a48ee0a0a6.zip
Merge pull request #594 from jack9603301/T3042
bridge: T3042: Support VLAN filter and VLAN sub-interface on the bridge
Diffstat (limited to 'python/vyos/configdict.py')
-rw-r--r--python/vyos/configdict.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index e43b68f6f..0b03dfc7d 100644
--- a/python/vyos/configdict.py
+++ b/python/vyos/configdict.py
@@ -219,6 +219,28 @@ def is_member(conf, interface, intftype=None):
old_level = conf.set_level(old_level)
return ret_val
+def has_vlan_subinterface_configured(conf, intf):
+ """
+ Checks if interface has an VLAN subinterface configured.
+ Checks the following config nodes:
+ 'vif', 'vif-s'
+
+ Returns True if interface has VLAN subinterface configured, False if it doesn't.
+ """
+ from vyos.ifconfig import Section
+ ret = False
+
+ old_level = conf.get_level()
+ conf.set_level([])
+
+ intfpath = 'interfaces ' + Section.get_config_path(intf)
+ if ( conf.exists(f'{intfpath} vif') or
+ conf.exists(f'{intfpath} vif-s')):
+ ret = True
+
+ conf.set_level(old_level)
+ return ret
+
def is_source_interface(conf, interface, intftype=None):
"""
Checks if passed interface is configured as source-interface of other