Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Creating an ARP Packet

by Anonymous Monk
on Oct 03, 2003 at 19:50 UTC ( [id://296375]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to create an ARP network packet. Has anyone ever attempted to do this that could possibly point me in the right direction?

Replies are listed 'Best First'.
Re: Creating an ARP Packet
by athomason (Curate) on Oct 03, 2003 at 21:05 UTC
    If you need to use Perl, you'll probably get farthest by using the module hooks into libpcap, which implements raw socket functionality on *NIX and Windows. (A previous discussion of raw sockets in Perl is here).

    Glancing at CPAN, there's NetPacket::ARP, but apparently encoding isn't implemented. Still, it shouldn't be too hard to finish that yourself since the meat of the decoder is in a fairly self-documenting call to unpack, which I imagine could be inverted fairly easily. Once you have the encoded packet, one or more of NetPacket::Ethernet, Net::PcapUtils, and Net::RawIP should help you get it on the wire.

Re: Creating an ARP Packet
by hardburn (Abbot) on Oct 03, 2003 at 20:15 UTC

    Read RFC 826, then search Google for how to create a raw Ethernet packet. I don't know of any modules to help with this.

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    Note: All code is untested, unless otherwise stated

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://296375]
Approved by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 12:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found