summaryrefslogtreecommitdiffstats
path: root/cli/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'cli/utils.py')
-rw-r--r--cli/utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/utils.py b/cli/utils.py
index 88c15a4..185e7ee 100644
--- a/cli/utils.py
+++ b/cli/utils.py
@@ -7,6 +7,7 @@
import json
import ipaddress
+import re
def scope_lookup(scope_id, scope_type, d):
if scope_id == d.get('id') and scope_type == d.get('type'):
@@ -39,3 +40,11 @@ def check_address(addr):
return True
except:
return False
+
+def check_mac_address(addr):
+ if re.match("[a-f0-9]{2}(:[a-f0-9]{2}){5}$", addr.lower()):
+ return True
+ else:
+ print(addr.lower())
+ return False
+