David,

Tuan is right. I don't know whether it could help or not, but if all the
traffic goes thru one gateway than you can also use IPCHAINS (on the
gateway) to REDIRECT all UDP traffic destined to host A.B.C.D to yours
using one ipchains rule.

        Imed


Tuan Hoang wrote:
> 
> Hi David,
> 
> The kernel will only pass IP packets that it doesn't recognize to the
> transport layer protocol to raw sockets.  I believe the exception is ICMP
> and IGMP. (ex: how ping works)  For what you're trying to do, you'll
> want to use a packet capture library like libpcap.  It's a portable
> way of doing packet captures on various platforms.  For an example,
> look for the source of tcpdump.  (see freshmeat.net and search for
> tcpdump)
> 
> hope this helps,
> Tuan
> 
> On Tue, 18 Jan 2000, David Chen wrote:
> 
> > Hi,
> >
> > I am working on an application that needs to receive all UDP packets (regardless of
> > port.) How do I do this? Is it by using:
> >
> > socket(AF_INET, SOCK_RAW, IPPROTO_UDP)
> >
> > Do I need to bind() before I recv() ?
> >
> > Very confused and unsure,
> >
> > David
> >
> >
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-net" in
> the body of a message to [EMAIL PROTECTED]

-- 
Imed Chihi
Lucent Technologies Systel
http://www.linuxfreak.com/~chihi
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to