1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-19 20:59:01 +00:00

Move osscan structs from global_structures to osscan2.h

This commit is contained in:
dmiller
2015-06-23 15:53:05 +00:00
parent 2e602435f5
commit 638a123ba6
7 changed files with 102 additions and 106 deletions

57
nmap.cc
View File

@@ -2788,63 +2788,6 @@ void free_scan_lists(struct scan_lists *ports) {
free(ports->proto_ping_ports);
}
char *seqreport(struct seq_info *seq) {
static char report[512];
Snprintf(report, sizeof(report), "TCP Sequence Prediction: Difficulty=%d (%s)\n", seq->index, seqidx2difficultystr(seq->index));
return report;
}
/* Convert a TCP sequence prediction difficulty index like 1264386
into a difficulty string like "Worthy Challenge */
const char *seqidx2difficultystr(unsigned long idx) {
return (idx < 3) ? "Trivial joke" : (idx < 6) ? "Easy" : (idx < 11) ? "Medium" : (idx < 12) ? "Formidable" : (idx < 16) ? "Worthy challenge" : "Good luck!";
}
const char *ipidclass2ascii(int seqclass) {
switch (seqclass) {
case IPID_SEQ_CONSTANT:
return "Duplicated ipid (!)";
case IPID_SEQ_INCR:
return "Incremental";
case IPID_SEQ_INCR_BY_2:
return "Incrementing by 2";
case IPID_SEQ_BROKEN_INCR:
return "Broken little-endian incremental";
case IPID_SEQ_RD:
return "Randomized";
case IPID_SEQ_RPI:
return "Random positive increments";
case IPID_SEQ_ZERO:
return "All zeros";
case IPID_SEQ_UNKNOWN:
return "Busy server or unknown class";
default:
return "ERROR, WTF?";
}
}
const char *tsseqclass2ascii(int seqclass) {
switch (seqclass) {
case TS_SEQ_ZERO:
return "zero timestamp";
case TS_SEQ_2HZ:
return "2HZ";
case TS_SEQ_100HZ:
return "100HZ";
case TS_SEQ_1000HZ:
return "1000HZ";
case TS_SEQ_OTHER_NUM:
return "other";
case TS_SEQ_UNSUPPORTED:
return "none returned (unsupported)";
case TS_SEQ_UNKNOWN:
return "unknown class";
default:
return "ERROR, WTF?";
}
}