Date: Thu, 14 Oct 2004 08:01:49 -0700 From: Brooks Davis <brooks@one-eyed-alien.net> To: Grigory Klyuchnikov <grn@ispras.ru> Cc: snap-users@kame.net Subject: Re: Get multicast addresses from interface Message-ID: <20041014150149.GB26684@odin.ac.hmc.edu> In-Reply-To: <416E82D9.80002@ispras.ru> References: <416E82D9.80002@ispras.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041014150149.GB26684>