
On Wed, Dec 01, 2010 at 12:30:25PM -0700, Eric Blake wrote:
On 12/01/2010 10:26 AM, Daniel P. Berrange wrote:
Introduces a set of generic objects which are to be used in building RPC servers/clients based on XDR.
- virNetMessageHeader - standardize the XDR format for any RPC program. Copied from remote protocol for back compat
- virNetMessage - Provides a buffer for (de-)serializing messages, and a copy of the decoded virNetMessageHeader. Provides APIs for encoding/decoding message headers and payloads, thus isolating all the XDR api calls in one file. Callers no longer need to use XDR themselves.
- virNetSocket - a wrapper around a socket file descriptor, to simplify creation of new sockets, both for clients and services. Encapsulates all the hairy getaddrinfo code and sockaddr manipulation. Will eventually include transparent support for TLS and SASL encoding of data
- virNetTLSContext - encapsulates the credentials required to setup TLS sessions. eg the set of x509 certificates and keys, optional DH parameters and x509 DName whitelist Provides APIs for easily validating certificates from a TLS session
- virNetTLSSession - encapsulates the TLS session handling, so that callers no longer have a direct dependancy on gnutls. This will facilitate adding alternate TLS impls. Makes the read/write TLS functions work with same semantics as the native socket read/write functions. ie they set errno, instead of a gnutls specific error code.
Is it worth introducing these in separate patches, instead of all in one go? At any rate, this is big enough that I haven't reviewed it in detail yet, but the concept of factoring out the common code seems nice.
Yep, I could probably split this into 3 patches, without too much pain Daniel