I installed NetPacket and used it to decode in icmp_recv like this:
sub icmp_recv {
my $icmp = shift;
# Listen for ICMP response
my $icmpbuffer;
if( my $icmpr = $icmp->recv( $icmpbuffer, 1024, 0 ) ) {
my $obj = NetPacket::ICMP->decode( $icmpbuffer );
print Dumper( $obj );
}
return $icmpbuffer;
}
which returns this:
$VAR1 = bless( {
'_parent' => undef,
'data' => 'r@
¿ßEr@
Ìäà',
'cksum' => 9216,
'type' => 69,
'_frame' => 'E$r@
¿ßEr@
Ìäà',
'code' => 0
}, 'NetPacket::ICMP' );
|