# # $Id: DescL2.pm,v 1.3.2.2 2006/10/29 14:26:05 gomor Exp $ # 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__ =head1 NAME Net::Packet::DescL2 - object for a link layer (layer 2) descriptor =head1 SYNOPSIS 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); =head1 DESCRIPTION See also B for other attributes and methods. =head1 METHODS =over 4 =item B Create the object, using default B<$Env> object values for B, B, B and B (see B). When the object is created, the B<$Env> global object has its B attributes set to it. You can avoid this behaviour by setting B in B<$Env> object (see B). Default values for attributes: dev: $Env->dev ip: $Env->ip ip6: $Env->ip6 mac: $Env->mac =back =head1 AUTHOR Patrice EGomoRE Auffret =head1 COPYRIGHT AND LICENSE Copyright (c) 2004-2006, Patrice EGomoRE Auffret You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive. =head1 RELATED MODULES L, L, L =cut