]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: Add virSocketAddrSetIPv[46]AddrNetOrder and use it
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 18 Mar 2016 15:34:10 +0000 (16:34 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 21 Mar 2016 10:28:33 +0000 (11:28 +0100)
commit573c41a275263d6dbe1eda542f5a2aa00ea2f7be
tree19d4c64cb113cd21a7b573c438da6c734d68f41f
parent6d28ef912c3cc9ca53ee00d82fc8ed75dc33ed9d
util: Add virSocketAddrSetIPv[46]AddrNetOrder and use it

This allows setting the address in host and/or network order and makes
the naming consistent.  Now you don't need to call [hn]to[nh]l()
functions as that is taken care of by these functions.  Also, now
the *NetOrder take the address in network order, the other functions in
host order so the naming and usage is consistent.  Some places were
having the address in network order and calling ntohl() just so the
original function can call htonl() again.  This makes it nicer to read.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/libvirt_private.syms
src/nwfilter/nwfilter_dhcpsnoop.c
src/util/virsocketaddr.c
src/util/virsocketaddr.h
tests/nsstest.c