[libvirt] [PATCH] nwfilter: Some fixes to XML parser

Daniel Veillard veillard at redhat.com
Thu Apr 1 09:01:10 UTC 2010

On Wed, Mar 31, 2010 at 04:45:04PM -0400, Stefan Berger wrote:
> While writing a couple of test cases for the nwfilter's XML parser I
> found some cases where the output ended up not looking as expected. So
> the following changes are in the patch below:
> - if the protocol ID in the MAC header is an integer, just write it into
> the datastructure without trying to find a corresponding string for it
> and if none is found failing
> - when writing the protocol ID as string, simply write it as integer if
> no corresponding string can be found
> - same changes for arpOpcode parsing and printing
> - same changes for protocol ID in an IP packet
> - DSCP value needs to be written into the data structure
> - IP protocol version number is redundant at this level, so remove it
> - parse the protocol ID found inside an IP packet not only as string but
> also as uint8
> - arrange the display of the src and destination masks to be shown after
> the src and destination ip address respectively in the XML
> - the existing libvirt IP address parser accepts for example '25' as an
> IP address. I want this to be parsed as a CIDR type netmask. So try to
> parse it as an integer first (CIDR netmask) and if that doesn't work as
> a dotted IP address style netmask.
> - instantiation of rules with MAC masks didn't work because they weren't
> printed into a buffer, yet.
> Signed-off-by: Stefan Berger <stefanb at us.ibm.com>



Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

More information about the libvir-list mailing list