From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yy6iq-0000lK-QI for qemu-devel@nongnu.org; Thu, 28 May 2015 18:56:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yy6in-0004ml-In for qemu-devel@nongnu.org; Thu, 28 May 2015 18:56:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yy6in-0004mR-AU for qemu-devel@nongnu.org; Thu, 28 May 2015 18:56:17 -0400 Message-ID: <55679D0F.8090804@redhat.com> Date: Thu, 28 May 2015 16:56:15 -0600 From: Eric Blake MIME-Version: 1.0 References: <1432838461-2637-1-git-send-email-kallan@suse.com> <1432838461-2637-3-git-send-email-kallan@suse.com> In-Reply-To: <1432838461-2637-3-git-send-email-kallan@suse.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mccGbUsMdaiHHN4RO7WcVfJpC4LCAvL1Q" Subject: Re: [Qemu-devel] [PATCH v3 2/2] qga: win32 implementation of qmp_guest_network_get_interfaces List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirk Allan , qemu-devel@nongnu.org Cc: okrishtal@parallels.com, mdroth@linux.vnet.ibm.com, sw@weilnetz.de This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mccGbUsMdaiHHN4RO7WcVfJpC4LCAvL1Q Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/28/2015 12:41 PM, Kirk Allan wrote: > By default, IP addresses and prefixes will be derived from information > obtained by various calls and structures. IPv4 prefixes can be found > by matching the address to those returned by GetAdaptersInfo. IPv6 > prefixes can not be matched this way due to the unpredictable order of > entries. >=20 > In Windows Visa/2008 guests and newer, it is possible to use inet_ntop(= ) s/Visa/Vista/ > and OnLinkPrefixLength to get IPv4 and IPv6 addresses and prefixes. Why the double spacing? > Setting =E2=80=93extra-cflags in the build configuration to Again, Unicode mdash looks odd. > =E2=80=9D- D_WIN32_WINNT-0x600 -DWINVER=3D0x600=E2=80=9D or greater ena= bles this functionality > for those guests. Setting =E2=80=93ectra-cflags is not required and if= not used, s/ectra/extra/ > the default approach will be taken. >=20 > Signed-off-by: Kirk Allan > --- > qga/commands-win32.c | 292 +++++++++++++++++++++++++++++++++++++++++++= +++++++- > 1 file changed, 290 insertions(+), 2 deletions(-) > + > +static char *guest_inet_ntop(int af, void *cp, char *buf, size_t len) > +{ > +#if (_WIN32_WINNT >=3D 0x0600) && defined(ARCH_x86_64) > + /* If built for 64 bit Windows Vista/2008 or newer, inet_ntop() is= > + * available for use. Otherwise, do our best to derive it. > + */ > + return (char *)InetNtop(af, cp, buf, len); > +#else Are you sure glib doesn't provide some sort of inet_ntop wrapper that you could crib, instead of rolling your own? And if you must roll your own, do it as a separate patch from the rest of this work, possibly by copying from glibc or other existing implementation (with proper credits to the upstream source), rather than writing it from scratch. > + u_char *p; u_char is not a standard typedef; uint8_t is more common. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --mccGbUsMdaiHHN4RO7WcVfJpC4LCAvL1Q Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVZ50PAAoJEKeha0olJ0NqPMoH/is+Hzxfr9vAyh/4PkXymt7E EiI4IBcAwmqk2nYazwhwJBLTnYV9xlqhnB/0tgWwtlpRqnsCUNhWNdSYfhDVxUN9 j5R/5ud1YHmz1uNM8YYBcbq8khLOfpJZ0UUVWXHtNNJq28juh6M2JOvjULck3iXi XMzQgCH6/vBhBEIDKjwpY44pmsiNVjRM/PjJ6lSutyTbPtRvgipgexq+ILfG8VDF Q3T/gap5ItYlG9UDBXL/Vj8JUgaOrpVHnEj4Alpe9grybCYoCduFAq2bZePX7yhv YbC7WxKpkapI9KtQQ0hv8NHu/+gXNO/MGZhh4ro9T1W72NVh8mBVRg4BgMS7ZLU= =6nDY -----END PGP SIGNATURE----- --mccGbUsMdaiHHN4RO7WcVfJpC4LCAvL1Q--