summaryrefslogtreecommitdiffstats
path: root/examples/readme.lua
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2023-12-10 09:45:27 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2023-12-10 09:45:27 +0000
commit38b6c8c8ca8294c87bce5325fbba50fba1a40465 (patch)
tree14f869a6270a904547a6abcb113c5425554d8331 /examples/readme.lua
parentAdding upstream version 1.2.3. (diff)
downloaddnsjit-upstream/1.3.0.tar.xz
dnsjit-upstream/1.3.0.zip
Adding upstream version 1.3.0.upstream/1.3.0
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'examples/readme.lua')
-rwxr-xr-xexamples/readme.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/readme.lua b/examples/readme.lua
index dc6de89..a62ec99 100755
--- a/examples/readme.lua
+++ b/examples/readme.lua
@@ -1,4 +1,8 @@
#!/usr/bin/env dnsjit
+
+-- Disclaimer, to keep this example short it only works on pre-prepared
+-- PCAPs with only UDP DNS traffic in them.
+
require("dnsjit.core.objects")
local input = require("dnsjit.input.pcap").new()
local layer = require("dnsjit.filter.layer").new()
@@ -12,6 +16,7 @@ while true do
local object = producer(ctx)
if object == nil then break end
if object:type() == "payload" then
+ dns:reset()
dns.obj_prev = object
if dns:parse_header() == 0 then
print(dns.id)