summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-07-21 20:26:08 +0200
committerChristian Poessinger <christian@poessinger.com>2022-07-21 20:26:08 +0200
commit902586e248dd84883a097a3daca0b1129db25b38 (patch)
tree0242eddb47ada1e9d937cb87fe0786c7be7cfae1 /src/conf_mode
parenta06a2b58cac1559a35d60916628a234359d213d9 (diff)
downloadvyos-1x-902586e248dd84883a097a3daca0b1129db25b38.tar.gz
vyos-1x-902586e248dd84883a097a3daca0b1129db25b38.zip
fastnetmon: T4555: add IPv6 support
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/service_ids_fastnetmon.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/conf_mode/service_ids_fastnetmon.py b/src/conf_mode/service_ids_fastnetmon.py
index 57e12ddf2..8213d536e 100755
--- a/src/conf_mode/service_ids_fastnetmon.py
+++ b/src/conf_mode/service_ids_fastnetmon.py
@@ -49,22 +49,19 @@ def verify(fastnetmon):
if not fastnetmon:
return None
- if not "mode" in fastnetmon:
- raise ConfigError('ddos-protection mode is mandatory!')
+ if 'mode' not in fastnetmon:
+ raise ConfigError('Specify operating mode!')
- if not "network" in fastnetmon:
- raise ConfigError('Required define network!')
+ if 'listen_interface' not in fastnetmon:
+ raise ConfigError('Specify interface(s) for traffic capture')
- if not "listen_interface" in fastnetmon:
- raise ConfigError('Define listen-interface is mandatory!')
-
- if "alert_script" in fastnetmon:
- if os.path.isfile(fastnetmon["alert_script"]):
+ if 'alert_script' in fastnetmon:
+ if os.path.isfile(fastnetmon['alert_script']):
# Check script permissions
- if not os.access(fastnetmon["alert_script"], os.X_OK):
- raise ConfigError('Script {0} does not have permissions for execution'.format(fastnetmon["alert_script"]))
+ if not os.access(fastnetmon['alert_script'], os.X_OK):
+ raise ConfigError('Script "{alert_script}" is not executable!'.format(fastnetmon['alert_script']))
else:
- raise ConfigError('File {0} does not exists!'.format(fastnetmon["alert_script"]))
+ raise ConfigError('File "{alert_script}" does not exists!'.format(fastnetmon))
def generate(fastnetmon):
if not fastnetmon: