mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Consolidate raw socket acquisition.
This commit is contained in:
16
output.cc
16
output.cc
@@ -218,22 +218,6 @@ static void print_xml_service(const struct serviceDeductions *sd) {
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
/* Show a fatal error explaining that an interface is not Ethernet and won't
|
||||
work on Windows. Do nothing if --send-ip (PACKET_SEND_IP_STRONG) was used. */
|
||||
void win32_fatal_raw_sockets(const char *devname) {
|
||||
if ((o.sendpref & PACKET_SEND_IP_STRONG) != 0)
|
||||
return;
|
||||
|
||||
if (devname != NULL) {
|
||||
fatal("Only ethernet devices can be used for raw scans on Windows, and\n"
|
||||
"\"%s\" is not an ethernet device. Use the --unprivileged option\n"
|
||||
"for this scan.", devname);
|
||||
} else {
|
||||
fatal("Only ethernet devices can be used for raw scans on Windows. Use\n"
|
||||
"the --unprivileged option for this scan.");
|
||||
}
|
||||
}
|
||||
|
||||
/* Display the mapping from libdnet interface names (like "eth0") to Npcap
|
||||
interface names (like "\Device\NPF_{...}"). This is the same mapping used by
|
||||
eth_open and so can help diagnose connection problems. Additionally display
|
||||
|
||||
Reference in New Issue
Block a user