1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-22 15:39:03 +00:00

Added a --nsock-engine option to nmap, nping and ncat to enforce use of a

given nsock IO engine. [Henri]
This commit is contained in:
henri
2012-03-01 09:05:02 +00:00
parent ee9b9eb0a7
commit b1086ac340
8 changed files with 57 additions and 4 deletions

View File

@@ -83,8 +83,10 @@ static struct io_engine *available_engines[] = {
NULL
};
static char *engine_hint;
struct io_engine *get_io_engine(const char *engine_hint) {
struct io_engine *get_io_engine(void) {
struct io_engine *engine = NULL;
int i;
@@ -105,3 +107,13 @@ struct io_engine *get_io_engine(const char *engine_hint) {
return engine;
}
void nsock_set_default_engine(char *engine) {
if (engine_hint)
free(engine_hint);
if (engine)
engine_hint = strdup(engine);
else
engine_hint = NULL;
}