mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Now does most of it's work through Lua:
From Nmap-dev: "Many of the changes consist of changing how Nmap interfaces
with Lua that were sometimes awkward or inflexible. Most of the functions
have been made to be callable directly by Lua which offers many technical
advantages: stack management is alleviated, errors are handled cleanly and
are more descriptive, and there is increased reusability."
Additionally:
-- Moved all lua_State * symbols from "l" to "L". This is to maintain
consistency with other Lua libraries (convention) and to make our macros portable.
-- Moved file system manipulation over to nse_fs.cc (from nse_init.cc)
31 lines
768 B
C++
31 lines
768 B
C++
#ifndef NSE_INIT
|
|
#define NSE_INIT
|
|
|
|
extern "C" {
|
|
#include "lua.h"
|
|
#include "lualib.h"
|
|
#include "lauxlib.h"
|
|
}
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
#include <string.h>
|
|
|
|
// initialize the lua state
|
|
// opens the standard libraries and the nmap lua library
|
|
int init_lua(lua_State* L);
|
|
|
|
//takes the script arguments provided to nmap through --script-args and
|
|
//processes and checks them - leaves the processed string on the stack
|
|
int init_parseargs(lua_State* L);
|
|
//sets the previously parsed args inside nmap.registry
|
|
int init_setargs(lua_State* L);
|
|
|
|
// you give it a description of scripts to run and it
|
|
// populates the tables 'hosttests' and 'porttests' in l with
|
|
// activation records for tests
|
|
int init_rules(lua_State *L);
|
|
int init_updatedb(lua_State* L);
|
|
|
|
#endif
|