diff --git a/output.cc b/output.cc index 29c294c79..3babe63fd 100644 --- a/output.cc +++ b/output.cc @@ -1320,6 +1320,15 @@ void write_xml_hosthint(const Target *currenths) { log_flush_all(); } +void log_bogus_target(const char *expr) { + xml_open_start_tag("target"); + xml_attribute("specification", "%s", expr); + xml_attribute("status", "skipped"); + xml_attribute("reason", "invalid"); + xml_close_empty_tag(); + xml_newline(); +} + static void write_xml_osclass(const OS_Classification *osclass, double accuracy) { xml_open_start_tag("osclass"); xml_attribute("type", "%s", osclass->Device_Type); diff --git a/output.h b/output.h index e4b7ea57f..61ace6401 100644 --- a/output.h +++ b/output.h @@ -199,6 +199,11 @@ void write_host_status(const Target *currenths); /* Writes host status info to the XML stream wrapped in a tag */ void write_xml_hosthint(const Target *currenths); +/* Add a element to the XML stating that a target specification was + ignored. This can be because of, for example, a DNS resolution failure, or a + syntax error. */ +void log_bogus_target(const char *expr); + /* Prints the formatted OS Scan output to stdout, logfiles, etc (but only if an OS Scan was performed */ void printosscanoutput(const Target *currenths); diff --git a/targets.cc b/targets.cc index afd2dc85f..3a4b33892 100644 --- a/targets.cc +++ b/targets.cc @@ -74,7 +74,7 @@ #include "nmap_dns.h" #include "utils.h" #include "nmap_error.h" -#include "xml.h" +#include "output.h" extern NmapOps o; #ifdef WIN32 @@ -349,18 +349,6 @@ const char *HostGroupState::next_expression() { return NULL; } -/* Add a element to the XML stating that a target specification was - ignored. This can be because of, for example, a DNS resolution failure, or a - syntax error. */ -static void log_bogus_target(const char *expr) { - xml_open_start_tag("target"); - xml_attribute("specification", "%s", expr); - xml_attribute("status", "skipped"); - xml_attribute("reason", "invalid"); - xml_close_empty_tag(); - xml_newline(); -} - /* Returns a newly allocated Target with the given address. Handles all the details like setting the Target's address and next hop. */ static Target *setup_target(const HostGroupState *hs,