From c6f2ab6e83fdd24cba092eb36e417921077addb5 Mon Sep 17 00:00:00 2001 From: fyodor Date: Sat, 11 Aug 2007 03:32:26 +0000 Subject: [PATCH] merge soc07 r4804 - misc. NSE improvements --- NmapOps.h | 2 ++ Target.h | 7 +++++++ nmap.cc | 4 ++++ output.cc | 19 ++++++++++++++++--- portlist.h | 5 +++++ scripts/showHTMLTitle.nse | 4 ++++ 6 files changed, 38 insertions(+), 3 deletions(-) diff --git a/NmapOps.h b/NmapOps.h index cb9ef08de..98cdb8ca6 100644 --- a/NmapOps.h +++ b/NmapOps.h @@ -99,6 +99,8 @@ /* $Id$ */ +#include + class NmapOps { public: NmapOps(); diff --git a/Target.h b/Target.h index c2fb2394f..f9142a242 100644 --- a/Target.h +++ b/Target.h @@ -105,7 +105,11 @@ #include "nmap.h" #include "FingerPrintResults.h" + +#ifndef NOLUA #include "nse_main.h" +#endif + #include "reason.h" #ifndef INET6_ADDRSTRLEN @@ -240,7 +244,10 @@ class Target { struct timeout_info to; char *hostname; // Null if unable to resolve or unset +#ifndef NOLUA ScriptResults scriptResults; +#endif + state_reason_t reason; private: diff --git a/nmap.cc b/nmap.cc index 404bbf403..98c2f1f3f 100644 --- a/nmap.cc +++ b/nmap.cc @@ -110,7 +110,11 @@ #include "traceroute.h" #include "nmap_tty.h" #include "nmap_dns.h" + +#ifndef NOLUA #include "nse_main.h" +#endif + #ifdef WIN32 #include "winfix.h" #endif diff --git a/output.cc b/output.cc index 5864bd18f..5c2f885b8 100644 --- a/output.cc +++ b/output.cc @@ -680,8 +680,12 @@ void printportoutput(Target *currenths, PortList *plist) { for( ssr_iter = current->scriptResults.begin(); ssr_iter != current->scriptResults.end(); ssr_iter++) { + char* xml_id= xml_convert((*ssr_iter).id); + char* xml_scriptoutput= xml_convert((*ssr_iter).output); log_write(LOG_XML, "