Help for this page

Select Code to Download


  1. or download this
    # creating the packet chunks
    my $packet_eth = $ethernet->encode();
    ...
    my $packet = $packet_eth 
       . (0 x (60 - length($packet_eth) - length($packet_ip)))
       . $packet_ip;
    
  2. or download this
    # creating the packet chunks
    my $packet_eth = $ethernet->encode();
    ...
    my $packet = $packet_eth 
       . (pack 'H*', ('00' x (60 - length($packet_eth) - length($packet_ip
    +)))) # Note 0 -> 00
       . $packet_ip;