From owner-freebsd-net@FreeBSD.ORG Wed Jul 19 11:35:18 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8C7D716A4DE for ; Wed, 19 Jul 2006 11:35:18 +0000 (UTC) (envelope-from freebsd_nettest@yahoo.co.in) Received: from web7803.mail.in.yahoo.com (web7803.mail.in.yahoo.com [202.86.4.60]) by mx1.FreeBSD.org (Postfix) with SMTP id 68E8B43D49 for ; Wed, 19 Jul 2006 11:35:17 +0000 (GMT) (envelope-from freebsd_nettest@yahoo.co.in) Received: (qmail 62164 invoked by uid 60001); 19 Jul 2006 11:35:15 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Z7bQS7sFwWnPMy52DiGcxk+t8aVqAeo2/D1BjqM1iDfxK3kiehAAy/YlPzluKE7YZ1mYchH4gbJmyl11bnvv/Uqlj5MMlmj1fv10xSq8Xse01sRiof6kcgL00Ics5wVdTUaoJHS4z9r7SB6fj5UlcdeK/Km1oJ1gCIeOx3Ug8AE= ; Message-ID: <20060719113515.62162.qmail@web7803.mail.in.yahoo.com> Received: from [66.93.138.34] by web7803.mail.in.yahoo.com via HTTP; Wed, 19 Jul 2006 12:35:15 BST Date: Wed, 19 Jul 2006 12:35:15 +0100 (BST) From: freebsd nettest To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Supporting Multicast in Network driver X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2006 11:35:18 -0000 Hi, I would like to support MULTICAST in my network driver. I have define a function set_multi which will extract the Ethernet multicast address and update the corresponding hardware register. This function is called in the SIOCADDMULTI and SIOCDELMULTI ioctl case. I used following user level program to test the multicast functionality of the driver. When I run the user level program, I could see that the control comes to SIOCADDMULTI ioctl and the correct Ethernet Multicast Mac address is added. After that when I try to ping the Multicast IP address from remote machine, the ping is not responding. Do I need to do any thing extra apart from update the Ethernet Multicast address? User level program: #include #include #include #include #include //#include #include //#include #include int main(int argc, char *argv[]) { struct ip_mreq mreqn; int s; struct in_addr ip; if (argc != 3) { fprintf(stderr, "usage: %s \n", argv[0]); exit(1); } if((s = socket(PF_INET, SOCK_DGRAM, 0)) < 0) { perror("socket"); exit(1); } memset(&mreqn, 0, sizeof(mreqn)); inet_aton(argv[1], &(mreqn.imr_interface)); /* mreqn.imr_interface = ip; */ if (inet_pton(AF_INET, argv[2], &mreqn.imr_multiaddr) <= 0) { fprintf(stderr, "%s: \"%s\" invalid group address\n", argv[0],argv[2]); exit(1); } if (setsockopt(s, 0, IP_ADD_MEMBERSHIP,&mreqn,sizeof mreqn) < 0) { perror("IP_ADD_MEMBERSHIP"); exit(1); } printf("joined group %s on %s (pausing...)\n", argv[2], argv[1]); fflush(stdout); pause(); } Thanks --------------------------------- Find out what India is talking about on Yahoo! Answers India. Send FREE SMS from New Yahoo! Messenger to Mobile: Download NOW!