[libvirt] [PATCH] network utilities: Properly convert port numbers to/from network byte order

2009-11-04 Thread Matthew Booth
* src/util/network.c: Add htons and ntohs in virSocket(Get|Set)Port --- src/util/network.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/network.c b/src/util/network.c index d67340a..56426e7 100644 --- a/src/util/network.c +++ b/src/util/network.c @@

[libvirt] [PATCH] network utilities: Allocate space for terminating NUL in virSocketFormatAddr

2009-11-04 Thread Matthew Booth
* src/util/network.c: Allocate an additional byte for virSocketFormatAddr's return buffer --- src/util/network.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/network.c b/src/util/network.c index 56426e7..f6588c7 100644 --- a/src/util/network.c +++

Re: [libvirt] [PATCH] network utilities: Allocate space for terminating NUL in virSocketFormatAddr

2009-11-04 Thread Richard W.M. Jones
On Wed, Nov 04, 2009 at 11:00:14AM +, Matthew Booth wrote: * src/util/network.c: Allocate an additional byte for virSocketFormatAddr's return buffer --- src/util/network.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/network.c

Re: [libvirt] [PATCH] network utilities: Allocate space for terminating NUL in virSocketFormatAddr

2009-11-04 Thread Matthew Booth
On 04/11/09 11:06, Richard W.M. Jones wrote: Are you sure about this? According to the man page for inet_ntop the INET*_ADDRSTRLEN macro should be long enough already: AF_INET src points to a struct in_addr (in network byte order) which is converted to

Re: [libvirt] [PATCH] network utilities: Add functions for address-text and get/set port number

2009-11-03 Thread Daniel Veillard
On Mon, Nov 02, 2009 at 03:46:12PM -0500, Laine Stump wrote: I'm a bit behind the curve, but... On 11/02/2009 05:57 AM, Matthew Booth wrote: --- src/libvirt_private.syms |3 ++ src/util/network.c | 88 +- src/util/network.h

[libvirt] [PATCH] network utilities: Add functions for address-text and get/set port number

2009-11-02 Thread Matthew Booth
--- src/libvirt_private.syms |3 ++ src/util/network.c | 88 +- src/util/network.h |6 +++ 3 files changed, 96 insertions(+), 1 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 8525dbd..15d75fd

Re: [libvirt] [PATCH] network utilities: Add functions for address-text and get/set port number

2009-11-02 Thread Daniel Veillard
On Mon, Nov 02, 2009 at 10:57:11AM +, Matthew Booth wrote: --- src/libvirt_private.syms |3 ++ src/util/network.c | 88 +- src/util/network.h |6 +++ 3 files changed, 96 insertions(+), 1 deletions(-) diff --git

[libvirt] [PATCH] network utilities: Add functions for address-text and get/set port number

2009-11-02 Thread Matthew Booth
--- src/libvirt_private.syms |3 + src/util/network.c | 97 +- src/util/network.h |6 +++ 3 files changed, 105 insertions(+), 1 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 8525dbd..15d75fd

Re: [libvirt] [PATCH] network utilities: Add functions for address-text and get/set port number

2009-11-02 Thread Laine Stump
I'm a bit behind the curve, but... On 11/02/2009 05:57 AM, Matthew Booth wrote: --- src/libvirt_private.syms |3 ++ src/util/network.c | 88 +- src/util/network.h |6 +++ 3 files changed, 96 insertions(+), 1 deletions(-)

Re: [libvirt] [PATCH] network utilities

2009-10-30 Thread Daniel Veillard
On Thu, Oct 22, 2009 at 04:46:51PM +0200, Daniel Veillard wrote: Revamping my previous patches to parse IPv4/6 numeric addresses, adding range computation and netmask checking entries too. As suggested I used an union for the socket address type: typedef union { struct

Re: [libvirt] [PATCH] network utilities

2009-10-28 Thread Daniel Veillard
On Thu, Oct 22, 2009 at 04:42:20PM -0400, Laine Stump wrote: +/* + * Helpers to extract the IP arrays from the virSocketAddrPtr + * That part is the less portable of the module + */ +typedef unsigned char virIPv4Addr[4]; +typedef virIPv4Addr *virIPv4AddrPtr; +typedef unsigned short

Re: [libvirt] [PATCH] network utilities

2009-10-28 Thread Laine Stump
On 10/28/2009 10:35 AM, Daniel Veillard wrote: On Thu, Oct 22, 2009 at 04:42:20PM -0400, Laine Stump wrote: +/* + * Helpers to extract the IP arrays from the virSocketAddrPtr + * That part is the less portable of the module + */ +typedef unsigned char virIPv4Addr[4]; +typedef virIPv4Addr

[libvirt] [PATCH] network utilities

2009-10-22 Thread Daniel Veillard
Revamping my previous patches to parse IPv4/6 numeric addresses, adding range computation and netmask checking entries too. As suggested I used an union for the socket address type: typedef union { struct sockaddr_storage stor; struct sockaddr_in inet4; struct sockaddr_in6 inet6; }

Re: [libvirt] [PATCH] network utilities

2009-10-22 Thread Laine Stump
(AHA! Just figured out how to get a patch sent as an attached file into the reply when using Thunderbird - 1) make sure Thunderbird is configured to display text attachments inline, 2) select everything in the original message (with ctrl-A), *then* 3) hit the reply button) On 10/22/2009 10:46