mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Revert r20455; I meant to do this in a branch.
This commit is contained in:
parent
87ee8343f3
commit
1723949c05
2 changed files with 0 additions and 52 deletions
37
nse_nsock.cc
37
nse_nsock.cc
|
|
@ -727,42 +727,6 @@ int l_get_ssl_certificate (lua_State *L)
|
|||
}
|
||||
#endif
|
||||
|
||||
static int l_setup (lua_State *L)
|
||||
{
|
||||
static const int families[] = { AF_INET, AF_INET6 };
|
||||
static const char *const fam_op[] = {"ipv4", "ipv6", NULL};
|
||||
nsock_pool nsp;
|
||||
nse_nsock_udata *nu;
|
||||
const char *proto;
|
||||
int af;
|
||||
|
||||
af = families[luaL_checkoption(L, 2, NULL, fam_op)];
|
||||
proto = luaL_checkstring(L, 3);
|
||||
|
||||
if (strcmp(proto, "udp") != 0)
|
||||
return luaL_argerror(L, 2, "must be \"udp\"");
|
||||
|
||||
nsp = get_pool(L);
|
||||
nu = check_nsock_udata(L, 1, 0);
|
||||
|
||||
nu->nsiod = nsi_new(nsp, NULL);
|
||||
if (nu->source_addr.ss_family != AF_UNSPEC) {
|
||||
nsi_set_localaddr(nu->nsiod, &nu->source_addr, nu->source_addrlen);
|
||||
} else if (o.spoofsource) {
|
||||
struct sockaddr_storage ss;
|
||||
size_t sslen;
|
||||
|
||||
o.SourceSockAddr(&ss, &sslen);
|
||||
nsi_set_localaddr(nu->nsiod, &ss, sslen);
|
||||
}
|
||||
if (o.ipoptionslen)
|
||||
nsi_set_ipoptions(nu->nsiod, o.ipoptions, o.ipoptionslen);
|
||||
|
||||
nsock_setup_udp(nsp, nu->nsiod, callback, nu->timeout, nu, af);
|
||||
|
||||
return yield(L, nu, "SETUP", TO, 0, NULL);
|
||||
}
|
||||
|
||||
/* Set the local address for socket operations. The two optional parameters
|
||||
after the first (which is the socket object) are a string representing a
|
||||
numeric address, and a port number. If either optional parameter is omitted
|
||||
|
|
@ -1023,7 +987,6 @@ LUALIB_API int luaopen_nsock (lua_State *L)
|
|||
"return receive_buf;\n";
|
||||
|
||||
static const luaL_Reg l_nsock[] = {
|
||||
{"setup", l_setup},
|
||||
{"bind", l_bind},
|
||||
{"send", l_send},
|
||||
{"receive", l_receive},
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
description = ""
|
||||
categories = {}
|
||||
|
||||
prerule = function() return true end
|
||||
|
||||
action = function()
|
||||
local s, status, data
|
||||
|
||||
s = nmap.new_socket()
|
||||
s:bind("255.255.255.255", 67)
|
||||
s:setup("ipv4", "udp")
|
||||
status, data = s:receive()
|
||||
|
||||
return data
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue