Merging upstream version 1.4.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
711bd629f8
commit
7a39e7587d
394 changed files with 2067 additions and 1324 deletions
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2018-2023, OARC, Inc.
|
||||
# Copyright (c) 2018-2024 OARC, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This file is part of dnsjit.
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
@SET_MAKE@
|
||||
|
||||
# Copyright (c) 2018-2023, OARC, Inc.
|
||||
# Copyright (c) 2018-2024 OARC, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This file is part of dnsjit.
|
||||
|
@ -297,6 +297,8 @@ libdir = @libdir@
|
|||
libexecdir = @libexecdir@
|
||||
liblz4_CFLAGS = @liblz4_CFLAGS@
|
||||
liblz4_LIBS = @liblz4_LIBS@
|
||||
liblzma_CFLAGS = @liblzma_CFLAGS@
|
||||
liblzma_LIBS = @liblzma_LIBS@
|
||||
libpcap_CFLAGS = @libpcap_CFLAGS@
|
||||
libpcap_LIBS = @libpcap_LIBS@
|
||||
libzstd_CFLAGS = @libzstd_CFLAGS@
|
||||
|
|
|
@ -1,28 +1,61 @@
|
|||
#!/usr/bin/env dnsjit
|
||||
local pcap = arg[2]
|
||||
local compression = arg[3]
|
||||
local mmap = arg[4]
|
||||
|
||||
if pcap == nil then
|
||||
print("usage: "..arg[1].." <pcap> [compression]")
|
||||
print("usage: "..arg[1].." <pcap | '-' for stdin> [compression] [mmap]")
|
||||
return
|
||||
end
|
||||
|
||||
local object = require("dnsjit.core.objects")
|
||||
local input = require("dnsjit.input.pcap").new()
|
||||
local zinput = require("dnsjit.input.zpcap").new()
|
||||
if mmap then
|
||||
zinput = require("dnsjit.input.zmmpcap").new()
|
||||
end
|
||||
local layer = require("dnsjit.filter.layer").new()
|
||||
local dns = require("dnsjit.core.object.dns").new()
|
||||
|
||||
if string.lower(string.sub(pcap, -4)) == ".zst" or compression == "zstd" then
|
||||
zinput:zstd()
|
||||
zinput:open(pcap)
|
||||
if pcap == "-" then
|
||||
zinput:openfp(io.stdin)
|
||||
else
|
||||
zinput:open(pcap)
|
||||
end
|
||||
layer:producer(zinput)
|
||||
elseif string.lower(string.sub(pcap, -4)) == ".lz4" or compression == "lz4" then
|
||||
zinput:lz4()
|
||||
zinput:open(pcap)
|
||||
if pcap == "-" then
|
||||
zinput:openfp(io.stdin)
|
||||
else
|
||||
zinput:open(pcap)
|
||||
end
|
||||
layer:producer(zinput)
|
||||
elseif string.lower(string.sub(pcap, -3)) == ".xz" or compression == "xz" then
|
||||
zinput:lzma()
|
||||
if pcap == "-" then
|
||||
zinput:openfp(io.stdin)
|
||||
else
|
||||
zinput:open(pcap)
|
||||
end
|
||||
layer:producer(zinput)
|
||||
elseif string.lower(string.sub(pcap, -3)) == ".gz" or compression == "gz" then
|
||||
zinput:gzip()
|
||||
if pcap == "-" then
|
||||
zinput:openfp(io.stdin)
|
||||
else
|
||||
zinput:open(pcap)
|
||||
end
|
||||
layer:producer(zinput)
|
||||
else
|
||||
input:open_offline(pcap)
|
||||
if mmap then
|
||||
input = require("dnsjit.input.mmpcap").new()
|
||||
input:open(pcap)
|
||||
else
|
||||
input:open_offline(pcap)
|
||||
end
|
||||
layer:producer(input)
|
||||
end
|
||||
local producer, ctx = layer:produce()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue