On Mon, Jan 27, 2014 at 2:17 PM, Nehal J Wani <nehaljw.kkd1(a)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:
[
{
"expiry-time": "1390775837",
"mac-address": "52:54:00:93:8c:63",
"iaid": "*",
"ip-address": "192.168.150.209",
"hostname": "iit-ad885e4aa1",
"client-id": "01:52:54:00:44:7c:d7"
},
{
"expiry-time": "1390775950",
"mac-address": "52:54:00:7b:6f:ba",
"iaid": "8089530",
"ip-address": "2001:db8:ca2:2:1::6d",
"hostname": "*",
"client-id":
"00:04:76:00:cf:ae:b3:0b:fc:cd:0e:22:2e:97:76:65:74:ec"
}
]
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/util/leaseshelper.c
* Helper program to create the custom lease file
---
v2:
* Changed format to JSON
v1:
* Refer:
https://www.redhat.com/archives/libvir-list/2014-January/msg00626.html
src/Makefile.am | 20 ++++
src/network/bridge_driver.c | 19 ++++
src/util/leaseshelper.c | 271 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 310 insertions(+)
create mode 100644 src/util/leaseshelper.c