GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::PACKET::VLAN (3)

.ds Aq ’

NAME

Net::Packet::VLAN - 802.1Q layer 3 object

CONTENTS

SYNOPSIS



   use Net::Packet::Consts qw(:vlan);
   require Net::Packet::VLAN;

   # Build a layer
   my $layer = Net::Packet::VLAN->new(
      priority => 0,
      cfi      => 0,
      id       => 0,
      type     => NP_VLAN_TYPE_IPv4,
   );
   $layer->pack;

   print RAW: .unpack(H*, $layer->raw)."\n";

   # Read a raw layer
   my $layer = Net::Packet::VLAN->new(raw => $raw);

   print $layer->print."\n";
   print PAYLOAD: .unpack(H*, $layer->payload)."\n"
      if $layer->payload;



DESCRIPTION

This modules implements the encoding and decoding of the Virtual LAN/802.1Q layer.

Details: http://standards.ieee.org/getieee802/802.1.html

See also <B>Net::Packet::LayerB> and <B>Net::Packet::Layer3B> for other attributes and methods.

ATTRIBUTES

<B>priorityB> The priority field.
<B>cfiB> The cfi field. It is only one bit long, so set it to 0 or 1.
<B>idB> VLAN tag id. You’ll love it.
<B>typeB> Which type the next encapsulated layer is.
<B>frameB> This is a <B>Net::Packet::FrameB> object, built it like any other such frame. Just to mention that you should use <B>dnoFexLienB> attribute if you put in a <B>Net::Packet::IPv4B> layer.

METHODS

<B>newB> Object constructor. You can pass attributes that will overwrite default ones. Default values:

priority: 0

cfi: 0

id: 0

type: NP_VLAN_TYPE_IPv4

<B>packB> Packs all attributes into a raw format, in order to inject to network. Returns 1 on success, undef otherwise.
<B>unpackB> Unpacks raw data from network and stores attributes into the object. Returns 1 on success, undef otherwise.
<B>isTypeArpB>
<B>isTypeIpv4B>
<B>isTypeIpv6B>
<B>isTypeIpB> - is type IPv4 or IPv6
<B>isTypeVlanB> Helper methods. Return true is the encapsulated layer is of specified type, false otherwise.

CONSTANTS

Load them: use Net::Packet::Consts qw(:vlan);
<B>NP_VLAN_TYPE_ARPB>
<B>NP_VLAN_TYPE_IPv4B>
<B>NP_VLAN_TYPE_IPv6B>
<B>NP_VLAN_TYPE_VLANB> Various supported encapsulated frame types.

AUTHOR

Patrice <GomoR> Auffret

COPYRIGHT AND LICENSE

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.

RELATED MODULES

NetPacket, Net::RawIP, Net::RawSock
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::PACKET::VLAN (3) 2009-11-09

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.