I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2008-05-06 17:52:58-07 by ggomez
patch including multiple VLAN levels and PPPoE support
This patch includes support for multiple VLANs tags and PPPoE inside VLAN
diff -rp Net-Packet-3.26/Packet/Consts.pm Net-Packet-3.26p/Packet/Consts.pm *** Net-Packet-3.26/Packet/Consts.pm Thu Nov 23 20:52:16 2006 --- Net-Packet-3.26p/Packet/Consts.pm Thu Apr 24 00:55:39 2008 *************** our %EXPORT_TAGS = ( *** 88,93 **** --- 88,94 ---- vlan => [qw( NP_VLAN_HDR_LEN NP_VLAN_TYPE_ARP + NP_VLAN_TYPE_PPPoE NP_VLAN_TYPE_IPv4 NP_VLAN_TYPE_IPv6 NP_VLAN_TYPE_VLAN *************** use constant NP_SLL_PROTOCOL_VLAN *** 333,338 **** --- 334,340 ---- use constant NP_VLAN_HDR_LEN => 4; use constant NP_VLAN_TYPE_ARP => NP_ETH_TYPE_ARP; + use constant NP_VLAN_TYPE_PPPoE => NP_ETH_TYPE_PPPoE; use constant NP_VLAN_TYPE_IPv4 => NP_ETH_TYPE_IPv4; use constant NP_VLAN_TYPE_IPv6 => NP_ETH_TYPE_IPv6; use constant NP_VLAN_TYPE_VLAN => NP_ETH_TYPE_VLAN; diff -rp Net-Packet-3.26/Packet/VLAN.pm Net-Packet-3.26p/Packet/VLAN.pm *** Net-Packet-3.26/Packet/VLAN.pm Thu Nov 23 20:52:17 2006 --- Net-Packet-3.26p/Packet/VLAN.pm Thu Apr 24 06:05:25 2008 *************** sub encapsulate { *** 105,110 **** --- 105,111 ---- NP_VLAN_TYPE_IPv4() => NP_LAYER_IPv4(), NP_VLAN_TYPE_IPv6() => NP_LAYER_IPv6(), NP_VLAN_TYPE_ARP() => NP_LAYER_ARP(), + NP_VLAN_TYPE_PPPoE() => NP_LAYER_PPPoE(), NP_VLAN_TYPE_VLAN() => NP_LAYER_VLAN(), }; *************** sub print { *** 135,140 **** --- 136,142 ---- sub _isType { shift->[$__type] == shift() } sub isTypeArp { shift->_isType(NP_VLAN_TYPE_ARP) } + sub isTypePppoe { shift->_isType(NP_VLAN_TYPE_PPPoE) } sub isTypeVlan { shift->_isType(NP_VLAN_TYPE_VLAN) } sub isTypeIpv4 { shift->_isType(NP_VLAN_TYPE_IPv4) } sub isTypeIpv6 { shift->_isType(NP_VLAN_TYPE_IPv6) } *************** Unpacks raw data from network and stores *** 231,236 **** --- 233,240 ---- =item B<isTypeArp> + =item B<isTypePppoe> + =item B<isTypeIpv4> =item B<isTypeIpv6> *************** Load them: use Net::Packet::Consts qw(:v *** 250,255 **** --- 254,261 ---- =over 4 =item B<NP_VLAN_TYPE_ARP> + + =item B<NP_VLAN_TYPE_PPPoE> =item B<NP_VLAN_TYPE_IPv4>
Direct Responses: Write a response