1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 19:09:01 +00:00

enable --ttl support for connect() scans

This commit is contained in:
kris
2007-10-14 14:37:56 +00:00
parent 8725d37b47
commit dfc9eba4db
3 changed files with 13 additions and 0 deletions

View File

@@ -161,6 +161,16 @@ setsockopt(sd, IPPROTO_IP, IP_HDRINCL, (const char *) &one, sizeof(one));
#endif
}
void set_ttl(int sd, int ttl)
{
#ifdef IP_TTL
if (sd == -1)
return;
setsockopt(sd, IPPROTO_IP, IP_TTL, &ttl, sizeof ttl);
#endif
}
// Takes a protocol number like IPPROTO_TCP, IPPROTO_UDP, or
// IPPROTO_IP and returns a ascii representation (or "unknown" if it
// doesn't recognize the number). If uppercase is true, the returned