Tom wrote:
Hi all,
Hello,
Is there anyway to extract the Destination address from a UDP package. I've looked at 3 perl modules IO::Socket::Inet and Net::UDP and Net::Inet but can not make any head way with this task. I am working on an Ubuntu box with perl version 5.8.8 installed. Unfortunately I'm not using BSD as the only information I could find on the web was here at this link: http://www.gsp.com/cgi-bin/man.cgi?section=4&topic=ip The important line being: If the IP_RECVDSTADDR option is enabled on a SOCK_DGRAM socket, the recvmsg(2) call will return the destination IP address for a UDP datagram. I have searched the perl modules mentioned above for IP_RECVDSTADDR in the hope that something similar can be done outside BSD systems. And I did find it under Net::Inet but am not sure how to enable it. Does anyone know how to get the destination address from a UDP datagram without resorting to the RAW packet format.
According to _TCP/IP Illustrated_ by W. Richard Stevens only BSD and AIX support the IP_RECVDSTADDR macro.
http://books.google.ca/books?id=-btNds68w84C&pg=PA163&dq=IP_RECVDSTADDR&sig=ACfU3U30ANu0-zoT0GlWeCfp0QFibjVdfw John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
