output = io.StringIO()
with open("src/Makefile.am") as infile:
for line in infile:
- if line.startswith("app-layer-template.c"):
+ if line.lstrip().startswith("app-layer-template."):
output.write(line.replace("template", protoname.lower()))
output.write(line)
open("src/Makefile.am", "w").write(output.getvalue())
output = io.StringIO()
with open(filename) as infile:
for line in infile:
- if line.startswith("output-json-template.c"):
+ if line.lstrip().startswith("output-json-template."):
output.write(line.replace("template", protoname.lower()))
output.write(line)
open(filename, "w").write(output.getvalue())
output = io.StringIO()
with open(filename) as infile:
for line in infile:
- if line.startswith("detect-template-buffer.c"):
+ if line.lstrip().startswith("detect-template-buffer."):
new = line.replace("template-buffer", "%s-%s" % (
protoname.lower(), buffername.lower()))
output.write(new)
Examples:
- %(progname)s DNP3
- %(progname)s Gopher
+ %(progname)s --logger DNP3
+ %(progname)s --parser Gopher
This script can also setup a detect buffer. This is a separate
operation that must be done after creating the parser.
if parser or logger:
print("""
-Suricata should now build cleanly. Try running "make".
+Suricata should now build cleanly. Try running "./configure" and "make".
""")
if __name__ == "__main__":