-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathnse_main.h
59 lines (46 loc) · 1.11 KB
/
nse_main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef NMAP_LUA_H
#define NMAP_LUA_H
#include <vector>
#include <list>
#include <string>
#include <string.h>
#include <iostream>
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
class ScriptResult
{
private:
std::string output;
std::string id;
public:
void set_output (const char *);
std::string get_output (void);
void set_id (const char *);
std::string get_id (void);
};
typedef std::vector<ScriptResult> ScriptResults;
class Target;
/* API */
int nse_yield (lua_State *);
void nse_restore (lua_State *, int);
void nse_destructor (lua_State *, char);
void nse_base (lua_State *);
void nse_selectedbyname (lua_State *);
void open_nse (void);
void script_scan (std::vector<Target *> &targets);
void close_nse (void);
int script_updatedb (void);
#define SCRIPT_ENGINE "NSE"
#ifdef WIN32
# define SCRIPT_ENGINE_LUA_DIR "scripts\\"
# define SCRIPT_ENGINE_LIB_DIR "nselib\\"
#else
# define SCRIPT_ENGINE_LUA_DIR "scripts/"
# define SCRIPT_ENGINE_LIB_DIR "nselib/"
#endif
#define SCRIPT_ENGINE_DATABASE "script.db"
#define SCRIPT_ENGINE_EXTENSION ".nse"
#endif