Help for this page

Select Code to Download


  1. or download this
    # extract the source IP addr into dotted quad form
    my($source) = sprintf("%d.%d.%d.%d",
    ...
            ord( substr($packet, $dst_ip+3, 1) ));
    #the above part is directly taken from "hacking linux exposed" (sorry 
    +but couldn't figure out this part)
    
  2. or download this
    use Socket;
    # extract the source IP addr into dotted quad form
    ...
    # extract the destination IP addr into dotted quad form
    my $destination = inet_ntoa substr $packet, $dst_ip, 4;