1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-25 08:59:01 +00:00

Adding nmap.verbosity() and nmap.debugging() for scripts so they can get the o.verbose and o.debugging values

This commit is contained in:
kris
2007-09-15 01:04:53 +00:00
parent 7c3448c1f7
commit c3b2e9af3f

View File

@@ -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;
}