Net::F...Writer(3pm)
π NAME π
Net::Frame::Dump::Writer β a tcpdump-flavored implementation, but make it writer mode. You're not reading packets, bestie, you're making them. β¨
So this lives in the User Contributed Perl Documentation corner of the manual pages, and honestly? It ate. π
πΈ SYNOPSIS πΈ
use Net::Frame::Dump::Writer;
my $oDump = Net::Frame::Dump::Writer->new(
file => 'new-file.pcap',
firstLayer => 'ETH',
);
$oDump->start;
$oDump->write({ timestamp => '10.10', raw => ('A' x 14) });
$oDump->stop;
See how clean that is?? Constructor, start, write, stop. It's giving main character energy and I'm obsessed. π¦
π DESCRIPTION π
Okay so here's the vibe: this module is a pcap file builder. You create frames, and then you write them out to a file in the pcap file format. That's it, that's the whole thing. Frame goes in, pcap file comes out. Periodt. π
β¨ ATTRIBUTES β¨
These following ones are inherited attributes, iykyk:
fileβ the name of the.pcapfile you want to generate. Name it something cute. πoverwriteβ overwrites a.pcapfile that already exists. Defaults to not doing that (so, lowkey, it won't clobber your stuff unless you ask).appendβ appends new frames onto an existing pcap file. And if it doesn't exist yet? It just creates it. Bestie is nothing if not flexible. πfirstLayerβ stores info about the first layer type. This is what gets used to write the.pcapfile header information. Don't skip it, it's load-bearing fr fr.isRunningβ returns true if a call tostarthas been done, and false otherwise β or if a call tostophas been done. It's literally just keeping receipts on whether you're running or not. π«Ά
π METHODS π
newnew (hash)β the object constructor. You can pass attributes in and they'll overwrite the default ones. Peep the SYNOPSIS above for the default values. πstartβ call this when you want to start writing frames to the file. Go time. β¨stopβ call this when you want to stop writing frames to the file. Nap time. πwrite ({ timestamp => $value, raw => $rawFrame })β takes a hashref as its parameter. This hashref MUST havetimestampandrawkeys, and they MUST have values. The raw data is what gets stored to the.pcapfile.
β οΈ Not kidding about the MUST, bestie.timestampandraw, both present, both with values. No keys, no values, no write. π«
π¦ SEE ALSO π¦
Net::Frame::Dump
π AUTHOR π
Patrice <GomoR> Auffret β an actual icon. π
π 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, babes π β this one was documented with perl v5.36.0 and dated 2022-11-19, so shoutout to that era of the docs for giving us this little pcap-making gem. Slay, go build some frames. π§π
π¦ 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