1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Move probespec to its own header to reduce includes of scan_engine.h

This commit is contained in:
dmiller
2018-07-13 18:18:28 +00:00
parent b2e0efb960
commit aaf5075c67
7 changed files with 191 additions and 55 deletions

View File

@@ -135,6 +135,7 @@
#define SCAN_ENGINE_H
#include "scan_lists.h"
#include "probespec.h"
#include <dnet.h>
@@ -151,59 +152,6 @@
#include <algorithm>
class Target;
struct probespec_tcpdata {
u16 dport;
u8 flags;
};
struct probespec_udpdata {
u16 dport;
};
struct probespec_sctpdata {
u16 dport;
u8 chunktype;
};
struct probespec_icmpdata {
u8 type;
u8 code;
};
struct probespec_icmpv6data {
u8 type;
u8 code;
};
#define PS_NONE 0
#define PS_TCP 1
#define PS_UDP 2
#define PS_PROTO 3
#define PS_ICMP 4
#define PS_ARP 5
#define PS_CONNECTTCP 6
#define PS_SCTP 7
#define PS_ICMPV6 8
#define PS_ND 9
/* The size of this structure is critical, since there can be tens of
thousands of them stored together ... */
typedef struct probespec {
/* To save space, I changed this from private enum (took 4 bytes) to
u8 that uses #defines above */
u8 type;
u8 proto; /* If not PS_ARP -- Protocol number ... eg IPPROTO_TCP, etc. */
union {
struct probespec_tcpdata tcp; /* If type is PS_TCP or PS_CONNECTTCP. */
struct probespec_udpdata udp; /* PS_UDP */
struct probespec_sctpdata sctp; /* PS_SCTP */
struct probespec_icmpdata icmp; /* PS_ICMP */
struct probespec_icmpv6data icmpv6; /* PS_ICMPV6 */
/* Nothing needed for PS_ARP, since src mac and target IP are
avail from target structure anyway */
} pd;
} probespec;
/* 3rd generation Nmap scanning function. Handles most Nmap port scan types */
void ultra_scan(std::vector<Target *> &Targets, struct scan_lists *ports,
stype scantype, struct timeout_info *to = NULL);