From owner-freebsd-net@FreeBSD.ORG Mon Nov 10 11:14:58 2003 Return-Path: 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 B688116A4D5; Mon, 10 Nov 2003 11:14:58 -0800 (PST) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 720A843FB1; Mon, 10 Nov 2003 11:14:57 -0800 (PST) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id 44FD165478; Mon, 10 Nov 2003 19:14:56 +0000 (GMT) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 50213-06-5; Mon, 10 Nov 2003 19:14:55 +0000 (GMT) Received: from saboteur.dek.spc.org (unknown [82.147.19.91]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 7BFF865449; Mon, 10 Nov 2003 19:14:55 +0000 (GMT) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id A907C44; Mon, 10 Nov 2003 19:14:54 +0000 (GMT) Date: Mon, 10 Nov 2003 19:14:54 +0000 From: Bruce M Simpson To: Robert Watson Message-ID: <20031110191454.GC662@saboteur.dek.spc.org> Mail-Followup-To: Robert Watson , freebsd-net@freebsd.org References: <20031110073822.GA20611@saboteur.dek.spc.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: cc: freebsd-net@freebsd.org Subject: Re: Viewing multicast group membership? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2003 19:14:58 -0000 --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Nov 10, 2003 at 01:14:59PM -0500, Robert Watson wrote: > I can't speak to existing code for this, but I can say I have a preference > for having a sysctl version of the code available in the vague hopes that > someday we can drop the setgid kmem bit from netstat... During operation, the kernel routing socket will report multicast group joins/leaves using RTM_NEWMADDR/RTM_DELADDR messages. These contain an ifma_msghdr structure, which encapsulates multicast addresses in an address family independent manner. However, there is no mechanism to report currently existing associations. Maybe the way to go is to extend getifaddrs(), or create a new API a lot like it. Right now, it uses the NET_RT_IFLIST sysctl to retrieve the interface list; the kernel appends RTM_NEWADDR messages to the buffer contents returned by the sysctl to report each address family. The function sysctl_iflist() in net/rtsock.c is responsible for this. However, not all getifaddrs() consumers are likely to be interested in multicast associations, so this could end up adding bloat. The getifaddrs() libc function and sysctl_iflist() kernel code do not touch ifnet->if_multiaddrs at all. So my next question is: Do I create a new API function and sysctl, or integrate into the existing code path? BMS --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Comment: '' iD8DBQE/r+OtueUpAYYNtTsRAtVmAJ47SuDA9kUxnPSIYiPWY5RRPV+dHgCgrRJA uYDx/jIVpXksVWceB5DjvPc= =7AAL -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT--