Adding this include fixes a build error seen with an old buildroot
toolchain based on gcc-6.3.0/glibc-2.25:
traceroute.cc: In function ‘bool parse_encapsulated_reply(const u8*, unsigned int, Reply*)’:
traceroute.cc:1084:24: error: expected primary-expression before ‘struct’
if (len < offsetof(struct icmp, icmp_id) + 2)
^~~~~~
In file included from struct_ip.h:56:0,
from traceroute.cc:113:
traceroute.cc:1084:37: error: ‘icmp_hun’ was not declared in this scope
if (len < offsetof(struct icmp, icmp_id) + 2)
^
traceroute.cc:1084:44: error: ‘offsetof’ was not declared in this scope
if (len < offsetof(struct icmp, icmp_id) + 2)
^
traceroute.cc:1091:52: error: expected primary-expression before ‘struct’
if (len < sizeof(struct icmpv6_hdr) + offsetof(struct icmpv6_msg_echo, icmpv6_seq) + 2)
^~~~~~
traceroute.cc:1091:76: error: ‘icmpv6_seq’ was not declared in this scope
if (len < sizeof(struct icmpv6_hdr) + offsetof(struct icmpv6_msg_echo, icmpv6_seq) + 2)
^~~~~~~~~~
traceroute.cc:1091:86: error: ‘offsetof’ was not declared in this scope
if (len < sizeof(struct icmpv6_hdr) + offsetof(struct icmpv6_msg_echo, icmpv6_seq) + 2)
^
traceroute.cc:1098:24: error: expected primary-expression before ‘struct’
if (len < offsetof(struct tcp_hdr, th_sport) + 2) return false;
^~~~~~
traceroute.cc:1098:40: error: ‘th_sport’ was not declared in this scope
if (len < offsetof(struct tcp_hdr, th_sport) + 2) return false;
^~~~~~~~
traceroute.cc:1098:48: error: ‘offsetof’ was not declared in this scope
if (len < offsetof(struct tcp_hdr, th_sport) + 2) return false;
^
traceroute.cc:1102:24: error: expected primary-expression before ‘struct’
if (len < offsetof(struct udp_hdr, uh_sport) + 2) return false;
^~~~~~
traceroute.cc:1102:40: error: ‘uh_sport’ was not declared in this scope
if (len < offsetof(struct udp_hdr, uh_sport) + 2) return false;
^~~~~~~~
traceroute.cc:1102:48: error: ‘offsetof’ was not declared in this scope
if (len < offsetof(struct udp_hdr, uh_sport) + 2) return false;
^
traceroute.cc:1106:24: error: expected primary-expression before ‘struct’
if (len < offsetof(struct sctp_hdr, sh_sport) + 2) return false;
^~~~~~
traceroute.cc:1106:41: error: ‘sh_sport’ was not declared in this scope
if (len < offsetof(struct sctp_hdr, sh_sport) + 2) return false;
^~~~~~~~
traceroute.cc:1106:49: error: ‘offsetof’ was not declared in this scope
if (len < offsetof(struct sctp_hdr, sh_sport) + 2) return false;
^
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
|
||
|---|---|---|
| .github | ||
| docs | ||
| fuzz | ||
| libdnet-stripped | ||
| liblinear | ||
| liblua | ||
| libnetutil | ||
| libpcap | ||
| libpcre | ||
| libssh2 | ||
| libz | ||
| m4 | ||
| macosx | ||
| mswin32 | ||
| nbase | ||
| ncat | ||
| ndiff | ||
| nping | ||
| nselib | ||
| nsock | ||
| scripts | ||
| tests | ||
| zenmap | ||
| .gitignore | ||
| .lgtm.yml | ||
| .travis.yml | ||
| acinclude.m4 | ||
| aclocal.m4 | ||
| BSDmakefile | ||
| CHANGELOG | ||
| charpool.cc | ||
| charpool.h | ||
| checklibs.sh | ||
| config.guess | ||
| config.sub | ||
| configure | ||
| configure.ac | ||
| CONTRIBUTING.md | ||
| depcomp | ||
| FingerPrintResults.cc | ||
| FingerPrintResults.h | ||
| FPEngine.cc | ||
| FPEngine.h | ||
| FPModel.cc | ||
| FPModel.h | ||
| HACKING | ||
| idle_scan.cc | ||
| idle_scan.h | ||
| INSTALL | ||
| LICENSE | ||
| lpeg.c | ||
| ltmain.sh | ||
| MACLookup.cc | ||
| MACLookup.h | ||
| main.cc | ||
| Makefile.in | ||
| missing | ||
| NewTargets.cc | ||
| NewTargets.h | ||
| nmap-header-template.cc | ||
| nmap-mac-prefixes | ||
| nmap-os-db | ||
| nmap-protocols | ||
| nmap-rpc | ||
| nmap-service-probes | ||
| nmap-services | ||
| nmap.cc | ||
| nmap.h | ||
| nmap.spec.in | ||
| nmap_amigaos.h | ||
| nmap_config.h.in | ||
| nmap_dns.cc | ||
| nmap_dns.h | ||
| nmap_error.cc | ||
| nmap_error.h | ||
| nmap_ftp.cc | ||
| nmap_ftp.h | ||
| nmap_tty.cc | ||
| nmap_tty.h | ||
| nmap_winconfig.h | ||
| NmapOps.cc | ||
| NmapOps.h | ||
| NmapOutputTable.cc | ||
| NmapOutputTable.h | ||
| nse_db.cc | ||
| nse_db.h | ||
| nse_debug.cc | ||
| nse_debug.h | ||
| nse_dnet.cc | ||
| nse_dnet.h | ||
| nse_fs.cc | ||
| nse_fs.h | ||
| nse_libssh2.cc | ||
| nse_libssh2.h | ||
| nse_lpeg.cc | ||
| nse_lpeg.h | ||
| nse_lua.h | ||
| nse_main.cc | ||
| nse_main.h | ||
| nse_main.lua | ||
| nse_nmaplib.cc | ||
| nse_nmaplib.h | ||
| nse_nsock.cc | ||
| nse_nsock.h | ||
| nse_openssl.cc | ||
| nse_openssl.h | ||
| nse_ssl_cert.cc | ||
| nse_ssl_cert.h | ||
| nse_utility.cc | ||
| nse_utility.h | ||
| nse_zlib.cc | ||
| nse_zlib.h | ||
| osscan.cc | ||
| osscan.h | ||
| osscan2.cc | ||
| osscan2.h | ||
| output.cc | ||
| output.h | ||
| payload.cc | ||
| payload.h | ||
| portlist.cc | ||
| portlist.h | ||
| portreasons.cc | ||
| portreasons.h | ||
| probespec.h | ||
| protocols.cc | ||
| protocols.h | ||
| README-WIN32 | ||
| README.md | ||
| scan_engine.cc | ||
| scan_engine.h | ||
| scan_engine_connect.cc | ||
| scan_engine_connect.h | ||
| scan_engine_raw.cc | ||
| scan_engine_raw.h | ||
| scan_lists.cc | ||
| scan_lists.h | ||
| service_scan.cc | ||
| service_scan.h | ||
| services.cc | ||
| services.h | ||
| shtool | ||
| string_pool.cc | ||
| string_pool.h | ||
| struct_ip.h | ||
| Target.cc | ||
| Target.h | ||
| TargetGroup.cc | ||
| TargetGroup.h | ||
| targets.cc | ||
| targets.h | ||
| tcpip.cc | ||
| tcpip.h | ||
| timing.cc | ||
| timing.h | ||
| traceroute.cc | ||
| traceroute.h | ||
| utils.cc | ||
| utils.h | ||
| xml.cc | ||
| xml.h | ||
| zenmap.spec.in | ||
Nmap 
Nmap is released under a custom license, which is based on (but not compatible with) GPLv2. The Nmap license allows free usage by end users, and we also offer a commercial license for companies that wish to redistribute Nmap technology with their products. See Nmap Copyright and Licensing for full details.
The latest version of this software as well as binary installers for Windows, macOS, and Linux (RPM) are available from Nmap.org
Full documentation is also available on the Nmap.org website.
Questions and suggestions may be sent to the Nmap-dev mailing list.
Installing
Ideally, you should be able to just type:
./configure
make
make install
For far more in-depth compilation, installation, and removal notes, read the Nmap Install Guide on Nmap.org.
Using Nmap
Nmap has a lot of features, but getting started is as easy as running nmap scanme.nmap.org. Running nmap without any parameters will give a helpful
list of the most common options, which are discussed in depth in the man
page. Users who prefer a graphical interface
can use the included Zenmap front-end.
Contributing
Information about filing bug reports and contributing to the Nmap project can be found in the HACKING and CONTRIBUTING.md files.