Added code to display fcdn-name in DHCPv4 lease table.
(based on code in DHCPv6 lease table)
Signed-off-by: Max S Kash <asukms@ya.ru>
Indentation adjused and wrapped commit message
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
else
exp = '%t'.format(lease.expires);
+ var hint = lease.macaddr ? hosts[lease.macaddr] : null,
+ name = hint ? hint.name : null,
+ host = null;
+
+ if (name && lease.hostname && lease.hostname != name)
+ host = '%s (%s)'.format(lease.hostname, name);
+ else if (lease.hostname)
+ host = lease.hostname;
+
return [
- lease.hostname || '?',
+ host || '-',
lease.ipaddr,
lease.macaddr,
exp
else
exp = '%t'.format(lease.expires);
+ var hint = lease.macaddr ? machints.filter(function(h) { return h[0] == lease.macaddr })[0] : null,
+ host = null;
+
+ if (hint && lease.hostname && lease.hostname != hint[1])
+ host = '%s (%s)'.format(lease.hostname, hint[1]);
+ else if (lease.hostname)
+ host = lease.hostname;
+
rows = [
- lease.hostname || '-',
+ host || '-',
lease.ipaddr,
lease.macaddr,
exp