Net::F...Offline(3pm)
π Net::Frame::Dump::Offline β the manual, but make it make sense π
okay bestie, welcome to the perl docs for Net::Frame::Dump::Offline π part of the User Contributed Perl Documentation collection, no cap. It's a tcpdump-flavoured situation but for offline mode β like, reading packets out of a file instead of sniffing the air live. iykyk β¨
πΈ NAME πΈ
Net::Frame::Dump::Offline β a tcpdump-like implementation, but the offline mode version π¦
β¨ SYNOPSIS β¨
here's the whole vibe, bestie, code exactly as it comes:
use Net::Frame::Dump::Offline;
#
# Simple offline anaysis
#
my $oDump = Net::Frame::Dump::Offline->new(file => $file);
$oDump->start;
my $count = 0;
while (my $h = $oDump->next) {
my $f = Net::Frame::Simple->new(
raw => $h->{raw},
firstLayer => $h->{firstLayer},
timestamp => $h->{timestamp},
);
my $len = length($h->{raw});
print 'o Frame number: '.$count++." (length: $len)\n";
print $f->print."\n";
}
$oDump->stop;
#
# Default parameters on creation
#
my $oDumpDefault = Net::Frame::Dump::Offline->new(
file => "netframe-tmp-$$.$int.pcap",
filter => '',
isRunning => 0,
keepTimestamp => 0,
);
(yes, anaysis is spelled like that in the original, we do not touch the code, we love her as she is π
)
π¦ DESCRIPTION π¦
This module is literally a tcpdump-like program, except it's built for offline analysis. You point it at packets you already have, it does the reading. main character energy, honestly π
π ATTRIBUTES π
these are the attributes that get inherited:
fileβ the name of the.pcapfile you want to read πfilterβ the Pcap filter you wanna use. defaults to no filter at all, she's unbothered β¨firstLayerβ holds info about the type of the first layer sitting inside a read frame. heads up: this one only gets filled after you call thestartmethod, so don't come for her early π«ΆisRunningβ returns true if a call tostarthas happened, and false otherwise β or false if a call tostophas happened. basically a little vibe check on whether she's running πββοΈkeepTimestampβ okay so sometimes, when frames get captured and saved into a.pcapfile, the timestamps suck π like, you send a frame, you get the reply, but your request looks like it was sent after the reply?? rude. so to fix that whole mess, you can use Net::Frame::Dump's own timestamping system. the default is0. set it manually to1if you actually need the original.pcapframe timestamps. your call, bestie π
π METHODS π
newnew (hash)β the object constructor π you can pass attributes in and they'll overwrite the default ones. peep the SYNOPSIS for the default values, they're all listed up there βstartβ call this when you want to start reading frames from the file. go time π₯stopβ call this when you want to stop reading frames from the file. that's a wrap πnextβ returns the next captured frame; returnsundefif there are no more frames waiting. no more, we're done, she's empty πstore (Net::Frame::Simple object)β this method stores theNet::Frame::Simpleobject you pass as a single parameter, internally and sorted. thegetKeymethods, which are implemented across variousNet::Frame::Layerobjects, get used to efficiently retrieve frames (via thegetKeyReversemethod). basically? it's what lets therecvmethod (fromNet::Frame::Simple) quickly grab the reply frame for a request frame. speed. efficiency. slay πgetFramesForβ this returns an array of the possible reply frames for theNet::Frame::Simpleobject you specify. like, for a UDP probe, the reply frames will be all the frames with the same source port and destination port as the request. matchy matchy π§flushβ flushes the stored frames, aka the ones that got stored via thestoremethod. bye bye frames π«Ά
π SEE ALSO π
Net::Frame::Dump
π AUTHOR π
Patrice <GomoR> Auffret
π COPYRIGHT AND LICENSE π
Copyright (c) 2006-2020, Patrice <GomoR> Auffret
You may distribute this module under the terms of the Artistic license. See the LICENSE.Artistic file in the source distribution archive.
and that's the whole page, bestie β brought to you by perl v5.36.0, dated 2022-11-19 πΈ no cap, that's the version and the date, go forth and parse those packets πβ¨π¦
π¦ where this page comes from
- debian bookworm: libnet-frame-dump-perl 1.18-2 Β· Artistic-1.0-Perl
- debian trixie: libnet-frame-dump-perl 1.18-2 Β· Artistic-1.0-Perl
- ubuntu noble: libnet-frame-dump-perl 1.18-2 Β· Artistic-1.0-Perl
- ubuntu resolute: libnet-frame-dump-perl 1.18-2 Β· Artistic-1.0-Perl
- ubuntu stonking: libnet-frame-dump-perl 1.18-2 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms