mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-18 08:47:00 +00:00
output: use range_output_helper() value in output_xml()
Earlier commit started to use range_output_helper() in output_xml() so
remove the unnecessary calls to get_range_size().
Reference: c55c823753
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
1182ec4cc9
commit
fe847bb9b1
1 changed files with 2 additions and 5 deletions
|
|
@ -321,7 +321,6 @@ static int output_xml(const int print_mac_addreses)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
struct range_t *range_p;
|
struct range_t *range_p;
|
||||||
double range_size;
|
|
||||||
struct shared_network_t *shared_p;
|
struct shared_network_t *shared_p;
|
||||||
struct output_helper_t oh;
|
struct output_helper_t oh;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
@ -337,7 +336,6 @@ static int output_xml(const int print_mac_addreses)
|
||||||
}
|
}
|
||||||
|
|
||||||
range_p = ranges;
|
range_p = ranges;
|
||||||
range_size = get_range_size(range_p);
|
|
||||||
shared_p = shared_networks;
|
shared_p = shared_networks;
|
||||||
|
|
||||||
fprintf(outfile, "<dhcpstatus>\n");
|
fprintf(outfile, "<dhcpstatus>\n");
|
||||||
|
|
@ -374,12 +372,11 @@ static int output_xml(const int print_mac_addreses)
|
||||||
}
|
}
|
||||||
fprintf(outfile, "\t<range>%s ", ntop_ipaddr(&range_p->first_ip));
|
fprintf(outfile, "\t<range>%s ", ntop_ipaddr(&range_p->first_ip));
|
||||||
fprintf(outfile, "- %s</range>\n", ntop_ipaddr(&range_p->last_ip));
|
fprintf(outfile, "- %s</range>\n", ntop_ipaddr(&range_p->last_ip));
|
||||||
fprintf(outfile, "\t<defined>%g</defined>\n", range_size);
|
fprintf(outfile, "\t<defined>%g</defined>\n", oh.range_size);
|
||||||
fprintf(outfile, "\t<used>%g</used>\n", range_p->count);
|
fprintf(outfile, "\t<used>%g</used>\n", range_p->count);
|
||||||
fprintf(outfile, "\t<touched>%g</touched>\n", range_p->touched);
|
fprintf(outfile, "\t<touched>%g</touched>\n", range_p->touched);
|
||||||
fprintf(outfile, "\t<free>%g</free>\n", range_size - range_p->count);
|
fprintf(outfile, "\t<free>%g</free>\n", oh.range_size - range_p->count);
|
||||||
range_p++;
|
range_p++;
|
||||||
range_size = get_range_size(range_p);
|
|
||||||
fprintf(outfile, "</subnet>\n");
|
fprintf(outfile, "</subnet>\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue