Date: Tue, 18 May 1999 04:44:04 -0400 From: Youngsu Chae <yschae@cc.gatech.edu> To: net@freebsd.org Subject: RAW IP socket for IGMP packet.. Message-ID: <37412853.439D35A5@cc.gatech.edu>
next in thread | raw e-mail | index | archive | help
Hi all,
I've been struggling with raw ip socket to pick up IP/IGMP packet.
As I understand from the 'raw_ip.c' source code, if the following three
conditions are satisfied
1) open a raw ip socket with protocol value as IPPROTO_IGMP,
2) do not bind local address,
3) do not specify foreign address,
then, the socket should get all the IP/IGMP packets with whatever
destination group addresses.
But, I couldn't get any IGMP packets..
The only way I can get the IP/IGMP packet is to subscribe to a specific
group.
That gives me only the IGMP packets destined to the group.
How can I get all IGMP packets with raw ip socket?
I've also tested with protocol value IPPROTO_IP(0).
In this case it should pick up all IP packets except TCP/UDP (those
packets are handled only in kernel).
It picks up ICMP packets but not IGMPs.
The following is the code for opening raw IP socket for IGMP..
/* get an IGMP socket */
if ((igmp_socket = socket(AF_INET,SOCK_RAW,IPPROTO_IGMP)) < 0){
panic ("socket() failed!");
}
k_hdr_include(TRUE); /* turn on header include option */
k_set_rcvbuf(256*1024,48*1024); /* lots of input buffering */
k_set_ttl(1); /* restrict multicasts to one hop */
k_set_loop(FALSE); /* disable multicast loopback */
Thanks,
Y.Chae
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37412853.439D35A5>
