diff options
author | Ashlee Young <ashlee@wildernessvoice.com> | 2016-01-20 01:10:01 +0000 |
---|---|---|
committer | Ashlee Young <ashlee@wildernessvoice.com> | 2016-01-20 01:10:11 +0000 |
commit | 19d701ddf07d855128ded0cf2b573ce468e3bdd6 (patch) | |
tree | 0edcd3461ca903c76e431bb7c6348c42a0f12488 /framework/src/suricata/qa/coccinelle/struct-flags.py | |
parent | fac6fbefbfad1cf837ddd88bc0d330559c8eb6f9 (diff) |
Removing Suricata and Audit from source repo, and updated build.sh to avoid building suricata. Will re-address this in C release via tar balls.
Change-Id: I3710076f8b7f3313cb3cb5260c4eb0a6834d4f6e
Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/suricata/qa/coccinelle/struct-flags.py')
-rwxr-xr-x | framework/src/suricata/qa/coccinelle/struct-flags.py | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/framework/src/suricata/qa/coccinelle/struct-flags.py b/framework/src/suricata/qa/coccinelle/struct-flags.py deleted file mode 100755 index 3a91157b..00000000 --- a/framework/src/suricata/qa/coccinelle/struct-flags.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python -import re -from os import listdir - -SRC_DIR="../../src/" - -class Structure: - def __init__(self, string): - (self.struct, self.flags, self.values) = string.split(":") - -cmd = "grep -h coccinelle ../../src/*[ch] | sed -e 's/.*coccinelle: \(.*\) \*\//\1/'" - -struct_list = [] - -dirList = listdir(SRC_DIR) -for fname in dirList: - if re.search("\.[ch]$", fname): - for line in open(SRC_DIR + fname): - if "coccinelle:" in line: - m = re.search("coccinelle: (.*) \*\/", line) - struct = Structure(m.group(1)) - struct_list.append(struct) - -header = "@flags@" -body = [] - -i = 0 -for struct in struct_list: - header += """ -%s *struct%d; -identifier struct_flags%d =~ "^(?!%s).+";""" % ( struct.struct, i, i, struct.values) - - body.append(""" -struct%d->%s@p1 |= struct_flags%d -| -struct%d->%s@p1 & struct_flags%d -| -struct%d->%s@p1 &= ~struct_flags%d -""" % (i, struct.flags, i, i, struct.flags, i, i, struct.flags, i)) - - i+=1 - -print header -print "position p1;" -print "@@" -print "" -print "(" + "|".join(body) + ")" -print "" -print """@script:python@ -p1 << flags.p1; -@@ - -print "Invalid usage of flags field at %s:%s, flags value is incorrect (wrong family)." % (p1[0].file, p1[0].line) -import sys -sys.exit(1)""" |