| Net-Packet documentation | Contained in the Net-Packet distribution. |
Net::Packet::DescL2 - object for a link layer (layer 2) descriptor
require Net::Packet::DescL2;
# Usually, you use it to send ARP frames, that is crafted from ETH layer
my $d2 = Net::Packet::DescL2->new(
dev => 'eth0',
);
$d2->send($rawStringToNetwork);
See also Net::Packet::Desc for other attributes and methods.
Create the object, using default $Env object values for dev, ip, ip6 and mac (see Net::Packet::Env). When the object is created, the $Env global object has its desc attributes set to it. You can avoid this behaviour by setting noDescAutoSet in $Env object (see Net::Packet::Env).
Default values for attributes:
dev: $Env->dev
ip: $Env->ip
ip6: $Env->ip6
mac: $Env->mac
Patrice <GomoR> Auffret
Copyright (c) 2004-2009, Patrice <GomoR> Auffret
You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.
NetPacket, Net::RawIP, Net::RawSock
| Net-Packet documentation | Contained in the Net-Packet distribution. |
# # $Id: DescL2.pm 1640 2009-11-09 17:58:27Z gomor $ # package Net::Packet::DescL2; use strict; use warnings; require Net::Packet::Desc; our @ISA = qw(Net::Packet::Desc); __PACKAGE__->cgBuildIndices; no strict 'vars'; require Net::Write::Layer2; sub new { my $self = shift->SUPER::new(@_); my $nwrite = Net::Write::Layer2->new( dev => $self->[$__dev], ); $nwrite->open; $self->[$___io] = $nwrite; $self; } 1; __END__