The xml output does not use output file as all other outputs, it
has sections here and there while everything is supposed to be in
output.c, and finally the unnecessary field analysis loop made
program about 20% slower when xml was not asked.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
shared_net_names + strlen(shared_net_names) + 1,
shared_networks);
shared_net_names + strlen(shared_net_names) + 1,
shared_networks);
+ /* FIXME: move to output.c and use FILE *outfile */
if ((config.output_format[0] == 'x')
|| (config.output_format[0] == 'X')) {
printf("<dhcpstatus>\n");
if ((config.output_format[0] == 'x')
|| (config.output_format[0] == 'X')) {
printf("<dhcpstatus>\n");
if (errno == 25)
errno = 0;
if (errno == 25)
errno = 0;
+ /* FIXME: move to output.c and use FILE *outfile */
if ((config.output_format[0] == 'x')
|| (config.output_format[0] == 'X')) {
printf("</dhcpstatus>\n");
if ((config.output_format[0] == 'x')
|| (config.output_format[0] == 'X')) {
printf("</dhcpstatus>\n");
- if ((sw_active_lease == 1)
+ /* FIXME: move to output.c and use FILE *outfile */
+ if ((config.output_format[0] == 'X')
+ && (sw_active_lease == 1)
&& (strstr(line, "hardware ethernet"))) {
nth_field(3, macstring, line);
macstring[strlen(macstring) - 1] = '\0';
&& (strstr(line, "hardware ethernet"))) {
nth_field(3, macstring, line);
macstring[strlen(macstring) - 1] = '\0';
- if (config.output_format[0] == 'X') {
- printf
- ("<active_lease>\n\t<ip>%s</ip>\n\t<macaddress>%s</macaddress>\n</active_lease>\n",
- ipstring, macstring);
- };
+ printf
+ ("<active_lease>\n\t<ip>%s</ip>\n\t<macaddress>%s</macaddress>\n</active_lease>\n",
+ ipstring, macstring);
}
if ((leasesmallocsize < num_leases) ||
}
if ((leasesmallocsize < num_leases) ||