.\" 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.mmpcap 3 "1.2.3" "dnsjit" .SH NAME dnsjit.input.mmpcap \- Read input from a PCAP file using mmap() .SH SYNOPSIS local input = require("dnsjit.input.fpcap").new() input:open("file.pcap") input:receiver(filter_or_output) input:run() .SH DESCRIPTION Read input from a PCAP file by mapping the whole file to memory using .B mmap() and parse the PCAP without libpcap. After opening a file and reading the PCAP header, the attributes are populated. .SS Attributes .TP is_swapped Indicate if the byte order in the PCAP is in reverse order of the host. .TP is_nanosec Indicate if the time stamps are in nanoseconds or not. .TP magic_number Magic number. .TP version_major Major version number. .TP version_minor Minor version number. .TP thiszone GMT to local correction. .TP sigfigs Accuracy of timestamps. .TP snaplen Max length of captured packets, in octets. .TP network The link type found in the PCAP header, see https://www.tcpdump.org/linktypes.html . .TP linktype The data link type, mapped from .IR network . .SS Functions .TP .BR Mmpcap.new "()" Create a new Mmpcap input. .TP .BR Mmpcap:log "()" Return the Log object to control logging of this instance or module. .TP .BR Mmpcap:receiver "(o)" Set the receiver to pass objects to. .TP .BR Mmpcap:produce "()" Return the C functions and context for producing objects. .TP .BR Mmpcap:open "(file)" Open a PCAP file for processing and read the PCAP header. Returns 0 on success. .TP .BR Mmpcap:run "()" Start processing packets and send each packet read to the receiver. Returns 0 if all packets was read successfully. .TP .BR Mmpcap:packets "()" Return the number of packets seen. .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