From c3b2e9af3f58712d26bdafffe4dc6fc674071f9a Mon Sep 17 00:00:00 2001 From: kris Date: Sat, 15 Sep 2007 01:04:53 +0000 Subject: [PATCH] Adding nmap.verbosity() and nmap.debugging() for scripts so they can get the o.verbose and o.debugging values --- nse_nmaplib.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nse_nmaplib.cc b/nse_nmaplib.cc index 2da095651..27f422d38 100644 --- a/nse_nmaplib.cc +++ b/nse_nmaplib.cc @@ -36,6 +36,8 @@ static int l_print_debug_unformatted(lua_State *l); static int l_get_port_state(lua_State* l, Target* target, Port* port); static int l_set_port_state(lua_State* l, Target* target, Port* port); static int l_set_port_version(lua_State* l, Target* target, Port* port); +static int l_get_verbosity(lua_State *); +static int l_get_debugging(lua_State *); int l_clock_ms(lua_State* l); @@ -53,6 +55,8 @@ int set_nmaplib(lua_State* l) { {"clock_ms", l_clock_ms}, {"print_debug_unformatted", l_print_debug_unformatted}, {"new_try", l_exc_newtry}, + {"verbosity", l_get_verbosity}, + {"debugging", l_get_debugging}, {NULL, NULL} }; @@ -486,3 +490,15 @@ static int l_exc_newtry(lua_State *l) { return 1; } +static int l_get_verbosity(lua_State *l) +{ + lua_pushnumber(l, o.verbose); + return 1; +} + +static int l_get_debugging(lua_State *l) +{ + lua_pushnumber(l, o.debugging); + return 1; +} +