]> git.ipfire.org Git - thirdparty/suricata.git/commit
suricatasc: Snug the processing of different commands
authorShivani Bhardwaj <shivanib134@gmail.com>
Thu, 7 Feb 2019 12:09:15 +0000 (17:39 +0530)
committerVictor Julien <victor@inliniac.net>
Fri, 15 Feb 2019 09:56:58 +0000 (10:56 +0100)
commitbf37e3f5da77137c3facfdc0e75a7a58dd15fbdb
tree6426d7202fe0b8be2b5f5c5503e13b9d6fb712b0
parent57285b54d5cf611cee78cef6f428320555cbe90d
suricatasc: Snug the processing of different commands

Since all of the commands were following the same procedure, namely,
split the input extract the arguments, throw the error if required
argument is missing else send the command over to suricata, put all of
this in one compact function alongwith a dictionary for specifications
for different commands, the name of the argument, the type and if it is
required or not.
Following fixups come with this commit:
- Code becomes really cozy
- Split errors on a few commands are well handled
- No redundant code
- More readability

References redmine ticket #2793
python/suricata/sc/specs.py [new file with mode: 0644]
python/suricata/sc/suricatasc.py