[libvirt] [PATCH v5] Add helper program to create custom leases

Nehal J Wani nehaljw.kkd1 at gmail.com
Thu May 15 17:26:32 UTC 2014


On Sat, Apr 26, 2014 at 5:29 AM, Nehal J Wani <nehaljw.kkd1 at gmail.com> wrote:
> 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
>
> ---
>  v5:
>  * More comments added, for better explanation
>  * Use of virFileFindResource() to identify proper path to helper binary
>  * Use of VIR_ENUM_IMPL for handling action events added
>
>  v4:
>  * Addition of pidfile and a corresponding lock for it
>  * Make correction for dnsmasq < 2.52 (Only IPv4)
>  * Move helper file from src/util to src/network
>  * Increase limit on max size of leases file
>  * Refer: https://www.redhat.com/archives/libvir-list/2014-March/msg01038.html
>
>  v3:
>  * Improved file handling, removed redundant copying, introduced --help and --version
>  * Refer: https://www.redhat.com/archives/libvir-list/2014-February/msg01431.html
>
>  v2:
>  * Changed format to JSON
>  * Refer: https://www.redhat.com/archives/libvir-list/2014-January/msg01234.html
>
>  v1:
>  * Refer: https://www.redhat.com/archives/libvir-list/2014-January/msg00626.html
>
>  src/Makefile.am             |   22 +++
>  src/network/bridge_driver.c |   27 ++++
>  src/network/leaseshelper.c  |  360 +++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 409 insertions(+), 0 deletions(-)
>  create mode 100644 src/network/leaseshelper.c


Ping!




More information about the libvir-list mailing list