summaryrefslogtreecommitdiffstats
path: root/src/output/pcap.lua
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:11:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:11:12 +0000
commitb72837827d9290c7ec50b9e4b9e1a0f194ddccca (patch)
tree8df663325413d0f92086d740638555de6b779df7 /src/output/pcap.lua
parentAdding upstream version 1.1.0+debian. (diff)
downloaddnsjit-b72837827d9290c7ec50b9e4b9e1a0f194ddccca.tar.xz
dnsjit-b72837827d9290c7ec50b9e4b9e1a0f194ddccca.zip
Adding upstream version 1.2.1.upstream/1.2.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/output/pcap.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/output/pcap.lua b/src/output/pcap.lua
index 13f0c29..26ae8e7 100644
--- a/src/output/pcap.lua
+++ b/src/output/pcap.lua
@@ -60,6 +60,10 @@ end
-- .I linktype
-- and
-- .IR snaplen .
+-- Uses
+-- .B pcap_dump_open()
+-- so you can pass "-" to it to open stdout, see it's man-page for more
+-- information.
-- Returns 0 on success.
function Pcap:open(file, linktype, snaplen)
return C.output_pcap_open(self.obj, file, linktype, snaplen)
@@ -70,6 +74,16 @@ function Pcap:close()
C.output_pcap_close(self.obj)
end
+-- Return true if the underlying
+-- .I FILE*
+-- indicates that there's been an error.
+function Pcap:have_errors()
+ if C.output_pcap_have_errors(self.obj) == 0 then
+ return false
+ end
+ return true
+end
+
-- Return the C functions and context for receiving objects.
function Pcap:receive()
return C.output_pcap_receiver(self.obj), self.obj