Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
NetRawIP dont got this possibility because the SO_BROADCAST flag must be set on the socket, otherwise it is not possible to send it to the broadcast. I did then start doing a normal perl socket program. It looks now like this:
it sends icmp ...wow thats working :-) but not corectly, because the $magic, this must be a correct icmpheader etc. i can find anything bout that in perl. Please, can you try to help me.use Socket; socket (S,PF_INET,SOCK_RAW,getprotobyname('icmp')) or die "socket: $!\ +n"; setsockopt (S, SOL_SOCKET, SO_BROADCAST,1) or die "setsocket: $!\n"; $magic = '17'; defined(send(S,$magic,0,sockaddr_in(0x2ffff,INADDR_BROADCAST))) or print "send: $!\n"; close (S);
Greetings
Max
mmo@phase1.ch
Edit kudra, 2001-10-25 Added some markup; removed extra newlines in code
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl ICMP Sockets icmphrd
by wcn (Initiate) on Oct 25, 2001 at 08:48 UTC |