]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
net-dhcp-leases: Implement the public APIs
authorNehal J Wani <nehaljw.kkd1@gmail.com>
Mon, 23 Jun 2014 21:01:49 +0000 (02:31 +0530)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 24 Jun 2014 11:26:31 +0000 (12:26 +0100)
commit03e0e79e07622496522609741734c2fdcacb5bf2
tree0c0d9776cbe1e76e48e2784d9d7b71194af9ecf7
parentebd05fd562fba8257f61a4561ce54553357d5914
net-dhcp-leases: Implement the public APIs

Introduce 3 new APIs, virNetworkGetDHCPLeases, virNetworkGetDHCPLeasesForMAC
and virNetworkDHCPLeaseFree.

* virNetworkGetDHCPLeases: returns the dhcp leases information for a given
     virtual network.

  For DHCPv4, the information returned:
  - Network Interface Name
  - Expiry Time
  - MAC address
  - IAID (NULL)
  - IPv4 address (with type and prefix)
  - Hostname (can be NULL)
  - Client ID (can be NULL)

  For DHCPv6, the information returned:
  - Network Interface Name
  - Expiry Time
  - MAC address
  - IAID (can be NULL, only in rare cases)
  - IPv6 address (with type and prefix)
  - Hostname (can be NULL)
  - Client DUID

  Note: @mac, @iaid, @ipaddr, @clientid are in ASCII form, not raw bytes.
  Note: @expirytime can 0, in case the lease is for infinite time.

* virNetworkGetDHCPLeasesForMAC: returns the dhcp leases information for a
     given virtual network and specified MAC Address.

* virNetworkDHCPLeaseFree: allows the upper layer application to free the
     network interface object conveniently.

There is no support for flags, so user is expected to pass 0 for
both the APIs.

include/libvirt/libvirt.h.in:
  * Define virNetworkGetDHCPLeases
  * Define virNetworkGetDHCPLeasesForMAC
  * Define virNetworkDHCPLeaseFree

src/driver.h:
  * Define networkGetDHCPLeases
  * Define networkGetDHCPLeasesForMAC

src/libvirt.c:
  * Implement virNetworkGetDHCPLeases
  * Implement virNetworkGetDHCPLeasesForMAC
  * Implement virNetworkDHCPLeaseFree

src/libvirt_public.syms:
  * Export the new symbols
include/libvirt/libvirt.h.in
src/driver.h
src/libvirt.c
src/libvirt_public.syms