> Hallo, > I have a problem with my DHCPSniffer. > Following is my script: > > <script> ></script> > > 2.It displays something ;-( > Hello, For those interested in the solution, here is the working script:
<script> #!/usr/bin/perl -w use strict; use Net::PcapUtils; use Net::DHCP::Packet; use NetPacket::Ethernet qw(:strip); use NetPacket::IP; use NetPacket::UDP; sub process_pkt { my($user, $hdr, $pkt) = @_; my $ip_obj = NetPacket::IP->decode(eth_strip($pkt)); my $udp_obj = NetPacket::UDP->decode($ip_obj->{data}); my $packet = Net::DHCP::Packet->new($udp_obj->{data}); print STDERR $packet->toString(); } Net::PcapUtils::loop(\&process_pkt, SNAPLEN => 1500, FILTER => 'udp port 67 or 68'); </script> Next time i try a little harder before posting (promised ;-) ) cu Holger -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>