mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Corrected many #includes for header files (where they are included).
Moved the includes for Lua headers to the .cc files so they are not needlessly, repeatedly included. Similarly, moved some standard headers to the .cc files and reorganized includes to be uniform for all nse_* source files. Fixed whitespace (removed tabs).
This commit is contained in:
@@ -41,12 +41,12 @@
|
|||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
extern "C" {
|
|
||||||
#include "lua.h"
|
|
||||||
#include "lualib.h"
|
|
||||||
#include "lauxlib.h"
|
|
||||||
}
|
|
||||||
#include <nbase.h>
|
#include <nbase.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "lua.h"
|
||||||
|
#include "lauxlib.h"
|
||||||
|
}
|
||||||
#include "nse_binlib.h"
|
#include "nse_binlib.h"
|
||||||
|
|
||||||
static void badcode(lua_State *L, int c)
|
static void badcode(lua_State *L, int c)
|
||||||
|
|||||||
@@ -8,6 +8,11 @@
|
|||||||
* the most recent copy can be found at http://rrt.sc3d.org/Software/Lua/
|
* the most recent copy can be found at http://rrt.sc3d.org/Software/Lua/
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "lauxlib.h"
|
||||||
|
#include "lua.h"
|
||||||
|
}
|
||||||
|
|
||||||
#include "nse_bit.h"
|
#include "nse_bit.h"
|
||||||
|
|
||||||
typedef long long Integer;
|
typedef long long Integer;
|
||||||
|
|||||||
@@ -3,12 +3,6 @@
|
|||||||
|
|
||||||
#define BITLIBNAME "bit"
|
#define BITLIBNAME "bit"
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include "lauxlib.h"
|
|
||||||
#include "lua.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
LUALIB_API int luaopen_bit(lua_State *L);
|
LUALIB_API int luaopen_bit(lua_State *L);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "lua.h"
|
||||||
|
#include "lauxlib.h"
|
||||||
|
}
|
||||||
|
|
||||||
#include "nse_debug.h"
|
#include "nse_debug.h"
|
||||||
#include "output.h"
|
#include "output.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
#ifndef NSE_DEBUG
|
#ifndef NSE_DEBUG
|
||||||
#define NSE_DEBUG
|
#define NSE_DEBUG
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include "lua.h"
|
|
||||||
#include "lualib.h"
|
|
||||||
#include "lauxlib.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
void value_dump(lua_State *L, int i, int depth_limit);
|
void value_dump(lua_State *L, int i, int depth_limit);
|
||||||
void stack_dump(lua_State *L);
|
void stack_dump(lua_State *L);
|
||||||
void lua_state_dump(lua_State *L);
|
void lua_state_dump(lua_State *L);
|
||||||
|
|||||||
10
nse_fs.cc
10
nse_fs.cc
@@ -1,3 +1,13 @@
|
|||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "lua.h"
|
||||||
|
#include "lauxlib.h"
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include "dirent.h"
|
#include "dirent.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
10
nse_fs.h
10
nse_fs.h
@@ -1,16 +1,6 @@
|
|||||||
#ifndef NSE_FS
|
#ifndef NSE_FS
|
||||||
#define NSE_FS
|
#define NSE_FS
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include "lua.h"
|
|
||||||
#include "lualib.h"
|
|
||||||
#include "lauxlib.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
int nse_check_extension (const char* ext, const char* path);
|
int nse_check_extension (const char* ext, const char* path);
|
||||||
|
|
||||||
int nse_fetchfile(char *path, size_t path_len, const char *file);
|
int nse_fetchfile(char *path, size_t path_len, const char *file);
|
||||||
|
|||||||
11
nse_init.cc
11
nse_init.cc
@@ -1,3 +1,14 @@
|
|||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "lua.h"
|
||||||
|
#include "lauxlib.h"
|
||||||
|
#include "lualib.h" /* for libraries */
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "nse_init.h"
|
#include "nse_init.h"
|
||||||
#include "nse_nmaplib.h"
|
#include "nse_nmaplib.h"
|
||||||
#include "nse_macros.h"
|
#include "nse_macros.h"
|
||||||
|
|||||||
10
nse_init.h
10
nse_init.h
@@ -1,16 +1,6 @@
|
|||||||
#ifndef NSE_INIT
|
#ifndef NSE_INIT
|
||||||
#define 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
|
// initialize the lua state
|
||||||
// opens the standard libraries and the nmap lua library
|
// opens the standard libraries and the nmap lua library
|
||||||
int init_lua(lua_State* L);
|
int init_lua(lua_State* L);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
#include "nse_main.h"
|
#include "nse_main.h"
|
||||||
|
|
||||||
#include "nse_init.h"
|
#include "nse_init.h"
|
||||||
|
|||||||
11
nse_main.h
11
nse_main.h
@@ -1,18 +1,17 @@
|
|||||||
#ifndef NMAP_LUA_H
|
#ifndef NMAP_LUA_H
|
||||||
#define NMAP_LUA_H
|
#define NMAP_LUA_H
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include "lua.h"
|
|
||||||
#include "lualib.h"
|
|
||||||
#include "lauxlib.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "lua.h"
|
||||||
|
#include "lauxlib.h"
|
||||||
|
}
|
||||||
|
|
||||||
class ScriptResult
|
class ScriptResult
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "lua.h"
|
||||||
|
#include "lauxlib.h"
|
||||||
|
}
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "nmap.h"
|
#include "nmap.h"
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
#ifndef NSE_NMAPLIB
|
#ifndef NSE_NMAPLIB
|
||||||
#define NSE_NMAPLIB
|
#define NSE_NMAPLIB
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include "lua.h"
|
|
||||||
#include "lualib.h"
|
|
||||||
#include "lauxlib.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
class Target;
|
class Target;
|
||||||
class Port;
|
class Port;
|
||||||
|
|
||||||
|
|||||||
19
nse_nsock.cc
19
nse_nsock.cc
@@ -1,12 +1,8 @@
|
|||||||
#include "nse_nsock.h"
|
|
||||||
#include "nse_macros.h"
|
|
||||||
|
|
||||||
#include "nse_debug.h"
|
extern "C" {
|
||||||
|
#include "lua.h"
|
||||||
#include "nsock.h"
|
#include "lauxlib.h"
|
||||||
#include "nmap_error.h"
|
}
|
||||||
/* #include "osscan.h" */
|
|
||||||
#include "NmapOps.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -14,6 +10,13 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
|
#include "nse_nsock.h"
|
||||||
|
#include "nse_macros.h"
|
||||||
|
#include "nse_debug.h"
|
||||||
|
|
||||||
|
#include "nsock.h"
|
||||||
|
#include "nmap_error.h"
|
||||||
|
#include "NmapOps.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "tcpip.h"
|
#include "tcpip.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
#ifndef NMAP_LUA_NSOCK_H
|
#ifndef NMAP_LUA_NSOCK_H
|
||||||
#define NMAP_LUA_NSOCK_H
|
#define NMAP_LUA_NSOCK_H
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include "lua.h"
|
|
||||||
#include "lualib.h"
|
|
||||||
#include "lauxlib.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
int luaopen_nsock(lua_State *);
|
int luaopen_nsock(lua_State *);
|
||||||
int l_nsock_new(lua_State *);
|
int l_nsock_new(lua_State *);
|
||||||
int l_nsock_loop(int tout);
|
int l_nsock_loop(int tout);
|
||||||
|
|||||||
@@ -18,9 +18,12 @@
|
|||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "lua.h"
|
||||||
|
#include "lauxlib.h"
|
||||||
|
}
|
||||||
|
|
||||||
#include "nse_openssl.h"
|
#include "nse_openssl.h"
|
||||||
#include "lua.h"
|
|
||||||
#include "lauxlib.h"
|
|
||||||
|
|
||||||
typedef struct bignum_data {
|
typedef struct bignum_data {
|
||||||
BIGNUM * bn;
|
BIGNUM * bn;
|
||||||
|
|||||||
@@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
#define OPENSSLLIBNAME "openssl"
|
#define OPENSSLLIBNAME "openssl"
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include "lua.h"
|
|
||||||
#include "lauxlib.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
LUALIB_API int luaopen_openssl(lua_State *L);
|
LUALIB_API int luaopen_openssl(lua_State *L);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
#include "lauxlib.h"
|
#include "lauxlib.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user