The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
SOCK_RAW is the right idea. You can even use IO::Socket if you're into that sort of thing, as it's a lot easier than using straight POSIX-type socket calls. Either way, you're going to need to do something like this:
my $rv = socket ($s, AF_INET, SOCK_RAW, IPPROTO_RAW); To make a raw socket, you have to be "root" or equivalent. Not sure how this works on NT, but perhaps you have to be the Administrator. Since you are creating the socket successfully, this doesn't seem to be a problem. What I think your problem is likely to be is the use of syswrite where you should be using sendto. You can use something like syswrite if your socket is connected. A RAW socket is not. Don't assume that the kernel is going to open up your packet and see what you mean. So, this way you can treat the socket like any old socket, except that you have to make the headers yourself and send it like a regular UDP-type packet (connectionless). In reply to Re: Raw Sockets
by tadman
|
|