summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/validate.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/vyos/validate.py b/python/vyos/validate.py
index 97a401423..258f7f76a 100644
--- a/python/vyos/validate.py
+++ b/python/vyos/validate.py
@@ -16,6 +16,12 @@
import netifaces
import ipaddress
+def is_ip(addr):
+ """
+ Check addr if it is an IPv4 or IPv6 address
+ """
+ return is_ipv4(addr) or is_ipv6(addr)
+
def is_ipv4(addr):
"""
Check addr if it is an IPv4 address/network. Returns True/False