]> xenbits.xensource.com Git - libvirt.git/commit
Add helper program to create custom leases
authorNehal J Wani <nehaljw.kkd1@gmail.com>
Mon, 2 Jun 2014 10:19:26 +0000 (11:19 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 2 Jun 2014 10:45:10 +0000 (11:45 +0100)
commitbaafe668fa56767c031468ccd5df3e62eaa11370
tree40b9eecf159c4925429be3b281c16e230b603808
parent6ef0b03483281659f2e1e321da9c56c97e05a305
Add helper program to create custom leases

Introduce helper program to catch events from dnsmasq and maintain a custom
lease file per network. It supports dhcpv4 and dhcpv6. The file is saved as
"<interface-name>.status".

Each lease contains the following info:
<expiry-time (epoch time)> <mac> <iaid> <ip-address> <hostname> <clientid>

Example of custom leases file content:
[
    {
        "iaid": "1221229",
        "ip-address": "2001:db8:ca2:2:1::95",
        "mac-address": "52:54:00:12:a2:6d",
        "hostname": "Fedora20",
        "client-id": "00:04:1a:c1:d9:6b:5a:0a:e2:bc:f8:4b:1e:37:2e:38:22:55",
        "expiry-time": 1393244216
    },
    {
        "ip-address": "192.168.150.208",
        "mac-address": "52:54:00:11:56:b3",
        "hostname": "Wani-PC",
        "client-id": "01:52:54:00:11:56:b3",
        "expiry-time": 1393244248
    }
]

src/Makefile.am:
   * Add options to compile the helper program

src/network/bridge_driver.c:
   * Introduce networkDnsmasqLeaseFileNameCustom()
   * Invoke helper program along with dnsmasq
   * Delete the .status file when corresponding n/w is destroyed.

src/network/leaseshelper.c
   * Helper program to create the custom lease file
libvirt.spec.in
po/POTFILES.in
src/Makefile.am
src/network/bridge_driver.c
src/network/leaseshelper.c [new file with mode: 0644]