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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user