mirror of
https://github.com/nmap/nmap.git
synced 2026-10-08 21:36:20 +00:00
Move some functions from traceroute.h into traceroute.cc so they can be
easily referenced while looking at the code that uses them.
This commit is contained in:
parent
43acb0eab8
commit
5371550a75
2 changed files with 32 additions and 4 deletions
|
|
@ -1207,6 +1207,34 @@ void TraceGroup::consolidateHops() {
|
|||
TraceProbes.erase(++ttl_count);
|
||||
}
|
||||
|
||||
/* This is the function that gives the traceroute its "up and down" nature.
|
||||
gotReply is true if we've gotten a reply from the target (finished counting
|
||||
up). */
|
||||
void TraceGroup::nextTTL() {
|
||||
if (gotReply) {
|
||||
ttl--;
|
||||
} else {
|
||||
ttl++;
|
||||
hopDistance++;
|
||||
}
|
||||
}
|
||||
|
||||
void TraceGroup::incRemaining() {
|
||||
if (remaining < 255)
|
||||
++remaining;
|
||||
}
|
||||
|
||||
void TraceGroup::decRemaining() {
|
||||
if (remaining > 0)
|
||||
--remaining;
|
||||
}
|
||||
|
||||
char *TraceGroup::IPStr() {
|
||||
struct in_addr s;
|
||||
s.s_addr = ipdst;
|
||||
return inet_ntoa (s);
|
||||
}
|
||||
|
||||
u8
|
||||
TraceGroup::setState(u8 state) {
|
||||
if (state <= G_FINISH && state >= G_OK)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue