diff options
Diffstat (limited to '')
-rw-r--r-- | src/output/pcap.lua | 14 |
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 |