summaryrefslogtreecommitdiffstats
path: root/framework/src/suricata/qa/coccinelle/direct-packet.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/suricata/qa/coccinelle/direct-packet.cocci')
-rw-r--r--framework/src/suricata/qa/coccinelle/direct-packet.cocci15
1 files changed, 15 insertions, 0 deletions
diff --git a/framework/src/suricata/qa/coccinelle/direct-packet.cocci b/framework/src/suricata/qa/coccinelle/direct-packet.cocci
new file mode 100644
index 00000000..dbe1f98b
--- /dev/null
+++ b/framework/src/suricata/qa/coccinelle/direct-packet.cocci
@@ -0,0 +1,15 @@
+@directpacket@
+identifier p;
+typedef Packet;
+position p1;
+@@
+
+Packet p@p1;
+
+@ script:python @
+p1 << directpacket.p1;
+@@
+
+print "Invalid Packet definition, explicit allocation must be used at %s:%s" % (p1[0].file, p1[0].line)
+import sys
+sys.exit(1)