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:
Sami Kerola 2017-11-08 23:04:28 +00:00
parent 1182ec4cc9
commit fe847bb9b1
No known key found for this signature in database
GPG key ID: A9553245FDE9B739

View file

@ -321,7 +321,6 @@ static int output_xml(const int print_mac_addreses)
{
unsigned int i;
struct range_t *range_p;
double range_size;
struct shared_network_t *shared_p;
struct output_helper_t oh;
int ret;
@ -337,7 +336,6 @@ static int output_xml(const int print_mac_addreses)
}
range_p = ranges;
range_size = get_range_size(range_p);
shared_p = shared_networks;
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, "- %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<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_size = get_range_size(range_p);
fprintf(outfile, "</subnet>\n");
}
}