.\" Copyright (c) 2018-2022, OARC, Inc. .\" All rights reserved. .\" .\" This file is part of dnsjit. .\" .\" dnsjit is free software: you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation, either version 3 of the License, or .\" (at your option) any later version. .\" .\" dnsjit is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with dnsjit. If not, see . .\" .TH dnsjit.input.pcap 3 "1.2.3" "dnsjit" .SH NAME dnsjit.input.pcap \- Read input from an interface or PCAP file using libpcap .SH SYNOPSIS local input = require("dnsjit.input.pcap").new() input:open_offline("file.pcap") input:receiver(filter_or_output) input:run() .SH DESCRIPTION Input module for reading packets from interfaces and PCAP files. .SS Functions .TP .BR Pcap.new "()" Create a new Pcap input. .TP .BR Pcap:log "()" Return the Log object to control logging of this instance or module. .TP .BR Pcap:receiver "(o)" Set the receiver to pass objects to. .TP .BR Pcap:produce "()" Return the C functions and context for producing objects. .TP .BR Pcap:create "(source)" Open a live packet capture on .IR source , which is an interface name or "any" (Linux) / "all" (BSD). Must be activated before use. .TP .BR Pcap:activate "()" Activate a live packet capture, see .BR pcap_activate (3pcap) for more information and possible return values. .TP .BR Pcap:open_offline "(file)" Open a PCAP file for processing, see .BR pcap_open_offline (3pcap) for more information. Returns 0 on success. .TP .BR Pcap:loop "(cnt)" Process packets from a live capture or savefile until .I cnt packets are processed, see .BR pcap_loop (3pcap) for more information and possible return values. .TP .BR Pcap:dispatch "(cnt)" Process packets from a live capture or savefile until .I cnt packets are processed, see .BR pcap_dispatch (3pcap) for more information and possible return values. .TP .BR Pcap:packets "()" Return the number of packets seen. .TP .BR Pcap:linktype "()" Return the linktype of the opened PCAP. .TP .BR Pcap:snaplen "()" Return the snaplen of the opened PCAP. .SH SEE ALSO .BR dnsjit.output.pcap (3) .SH AUTHORS and CONTRIBUTORS Jerry Lundström (DNS-OARC), Tomáš Křížek (CZ.NIC), Petr Špaček (ISC) .LP Maintained by DNS-OARC .LP .RS .I https://www.dns-oarc.net/ .RE .LP .SH BUGS For issues and feature requests please use: .LP .RS \fIhttps://github.com/DNS-OARC/dnsjit/issues\fP .RE .LP For question and help please use: .LP .RS \fIadmin@dns-oarc.net\fP .RE .LP