Code

unified post event handling!
[gosa.git] / gosa-si / modules / ArpWatch.pm
index 1db2a78afe1006ed9dc0944c3370630276d9a738..e03bed4d0a30bd2635d57e7ef55bf04864a6a4ea 100644 (file)
@@ -2,13 +2,17 @@
 package POE::Component::ArpWatch;
 
 use strict;
+use warnings;
 
-use POE;
-
-use Pcap;
+BEGIN{
+       eval('use POE');
+       eval('use POE::Component::Pcap');
+       eval('use NetPacket::Ethernet qw( :types )');
+       eval('use NetPacket::ARP qw( :opcodes )');
+}
 
-use NetPacket::Ethernet qw( :types );
-use NetPacket::ARP qw( :opcodes );
+END{
+}
 
 ## Map arp opcode #'s to strings
 my %arp_opcodes = (
@@ -167,6 +171,7 @@ sub _process_packet {
 sub _ipaddr { join( ".", unpack( "C4", pack( "N", oct( "0x". shift ) ) ) ) }
 sub _phys { join( ":", grep {length} split( /(..)/, shift ) ) }
 
+# vim:ts=4:shiftwidth:expandtab
 1;
 
 __END__