summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interface-definitions/protocols-bfd.xml8
-rw-r--r--op-mode-definitions/show-protocols-bfd.xml6
-rwxr-xr-xsrc/conf_mode/protocols_bfd.py4
3 files changed, 15 insertions, 3 deletions
diff --git a/interface-definitions/protocols-bfd.xml b/interface-definitions/protocols-bfd.xml
index f2d7d7d2f..62e2c87b9 100644
--- a/interface-definitions/protocols-bfd.xml
+++ b/interface-definitions/protocols-bfd.xml
@@ -20,6 +20,10 @@
<format>ipv6</format>
<description>BFD peer IPv6 address</description>
</valueHelp>
+ <constraint>
+ <validator name="ipv4-address"/>
+ <validator name="ipv6-address"/>
+ </constraint>
</properties>
<children>
<node name="source">
@@ -46,6 +50,10 @@
<format>ipv6</format>
<description>Local IPv6 address used to connect to the peer</description>
</valueHelp>
+ <constraint>
+ <validator name="ipv4-address"/>
+ <validator name="ipv6-address"/>
+ </constraint>
</properties>
</leafNode>
</children>
diff --git a/op-mode-definitions/show-protocols-bfd.xml b/op-mode-definitions/show-protocols-bfd.xml
index 2a94d0497..398a81d1b 100644
--- a/op-mode-definitions/show-protocols-bfd.xml
+++ b/op-mode-definitions/show-protocols-bfd.xml
@@ -24,16 +24,16 @@
<properties>
<help>Show Bidirectional Forwarding Detection (BFD) peer status</help>
<completionHelp>
- <script>/usr/bin/vtysh -c "show bfd peer" | grep peer | awk '{print $2}'</script>
+ <script>/usr/bin/vtysh -c "show bfd peers" | awk '/[:blank:]*peer/ { printf "%s\n", $2 }'</script>
</completionHelp>
</properties>
- <command>/usr/bin/vtysh -c "show bfd peer $5"</command>
+ <command>/usr/bin/vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 '($0 ~ peer BFD_PEER) { system("/usr/bin/vtysh -c \"show bfd " $0 "\"") }'</command>
<children>
<leafNode name="counters">
<properties>
<help>Show Bidirectional Forwarding Detection (BFD) peer counters</help>
</properties>
- <command>/usr/bin/vtysh -c "show bfd peer $5 counters"</command>
+ <command>/usr/bin/vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 '($0 ~ peer BFD_PEER) { system("/usr/bin/vtysh -c \"show bfd " $0 " counters\"") }'</command>
</leafNode>
</children>
</tagNode>
diff --git a/src/conf_mode/protocols_bfd.py b/src/conf_mode/protocols_bfd.py
index 98f38035a..9ca194edd 100755
--- a/src/conf_mode/protocols_bfd.py
+++ b/src/conf_mode/protocols_bfd.py
@@ -176,6 +176,10 @@ def verify(bfd):
if peer['multihop'] and peer['echo_mode']:
raise ConfigError('Multihop and echo-mode cannot be used together')
+ # multihop doesn't accept interface names
+ if peer['multihop'] and peer['src_if']:
+ raise ConfigError('Multihop and source interface cannot be used together')
+
# echo interval can be configured only with enabled echo-mode
if peer['echo_interval'] != '' and not peer['echo_mode']:
raise ConfigError('echo-interval can be configured only with enabled echo-mode')