1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Wrap dnet eth functions for non-Ethernet links

This commit is contained in:
dmiller
2025-06-23 20:54:32 +00:00
parent 7637ce3674
commit 3499025302
9 changed files with 177 additions and 49 deletions

View File

@@ -229,7 +229,7 @@ public:
~HostState();
bool has_more_probes() const;
bool is_finished() const;
bool send_next_probe(int rawsd, eth_t *ethsd);
bool send_next_probe(int rawsd, netutil_eth_t *ethsd);
void next_ttl();
void count_up();
int cancel_probe(std::list<Probe *>::iterator it);
@@ -262,8 +262,8 @@ public:
Probe(HostState *host, struct probespec pspec, u8 ttl);
virtual ~Probe();
void send(int rawsd, eth_t *ethsd, struct timeval *now = NULL);
void resend(int rawsd, eth_t *ethsd, struct timeval *now = NULL);
void send(int rawsd, netutil_eth_t *ethsd, struct timeval *now = NULL);
void resend(int rawsd, netutil_eth_t *ethsd, struct timeval *now = NULL);
bool is_timedout(struct timeval *now = NULL) const;
bool may_resend() const;
virtual unsigned char *build_packet(const struct sockaddr_storage *source,
@@ -292,7 +292,7 @@ public:
double completion_fraction() const;
private:
eth_t *ethsd;
netutil_eth_t *ethsd;
int rawsd;
pcap_t *pd;
int num_active_probes;
@@ -348,7 +348,7 @@ bool HostState::is_finished() const {
&& active_probes.empty() && pending_resends.empty();
}
bool HostState::send_next_probe(int rawsd, eth_t *ethsd) {
bool HostState::send_next_probe(int rawsd, netutil_eth_t *ethsd) {
Probe *probe;
/* Do a resend if possible. */
@@ -589,7 +589,7 @@ Probe::Probe(HostState *host, struct probespec pspec, u8 ttl) {
Probe::~Probe() {
}
void Probe::send(int rawsd, eth_t *ethsd, struct timeval *now) {
void Probe::send(int rawsd, netutil_eth_t *ethsd, struct timeval *now) {
struct eth_nfo eth;
struct eth_nfo *ethp;
int decoy;
@@ -623,7 +623,7 @@ void Probe::send(int rawsd, eth_t *ethsd, struct timeval *now) {
}
}
void Probe::resend(int rawsd, eth_t *ethsd, struct timeval *now) {
void Probe::resend(int rawsd, netutil_eth_t *ethsd, struct timeval *now) {
num_resends++;
this->send(rawsd, ethsd, now);
}