From owner-freebsd-net@FreeBSD.ORG Thu Oct 14 15:00:50 2004 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 BBB9216A4D2; Thu, 14 Oct 2004 15:00:50 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 749E543D31; Thu, 14 Oct 2004 15:00:50 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id i9EF1n2F029926; Thu, 14 Oct 2004 08:01:49 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id i9EF1noi029925; Thu, 14 Oct 2004 08:01:49 -0700 Date: Thu, 14 Oct 2004 08:01:49 -0700 From: Brooks Davis To: Grigory Klyuchnikov Message-ID: <20041014150149.GB26684@odin.ac.hmc.edu> References: <416E82D9.80002@ispras.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mojUlQ0s9EVzWg2t" Content-Disposition: inline In-Reply-To: <416E82D9.80002@ispras.ru> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu cc: freebsd-net@freebsd.org cc: freebsd-questions@freebsd.org cc: snap-users@kame.net Subject: Re: Get multicast addresses from interface 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: Thu, 14 Oct 2004 15:00:50 -0000 --mojUlQ0s9EVzWg2t Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 14, 2004 at 05:44:57PM +0400, Grigory Klyuchnikov wrote: > Hello, >=20 > How can a user process get IPv6 multicast addresses of ethernet > interfaces? I have FreeBSD 5.2.1 and get interface addresses > via ioctl(SIOCGIFCONF) or sysctl(witch NET_RT_IFLIST), > but all returned addresses are unicast. getifaddrs(3) and getifmaddrs(3) may do what you want. > In net/if.h there is a struct ifma_msghdr: >=20 > /* > * Message format for use in obtaining information about multicast addres= ses > * from the routing socket > */ > struct ifma_msghdr { > u_short ifmam_msglen; /* to skip over non-understood messages */ > u_char ifmam_version; /* future binary compatibility */ > u_char ifmam_type; /* message type */ > int ifmam_addrs; /* like rtm_addrs */ > int ifmam_flags; /* value of ifa_flags */ > u_short ifmam_index; /* index for associated ifp */ > }; >=20 >=20 > How it may be used? In addition to the functions above, you can directly access these structures via sysctl (see src/lib/libc/net/getifmaddrs.c for an example). -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --mojUlQ0s9EVzWg2t Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBbpTcXY6L6fI4GtQRAosDAJ9Scc51+oighy/HWGOLptR35Rwi8QCfXjqK vW1K/ZbbywzJFmAm3BDLjv0= =3tne -----END PGP SIGNATURE----- --mojUlQ0s9EVzWg2t--