fix: pcap_dispatch is non blocking

feature: no response handle
This commit is contained in:
0x35c
2025-05-30 16:12:51 +02:00
parent 936c277d02
commit f35cad887d
6 changed files with 74 additions and 22 deletions

View File

@ -7,14 +7,20 @@
#include "scan.h"
#define TIMEOUT 1
typedef enum {
OPEN = 1,
CLOSE,
OPENED,
CLOSED,
FILTERED,
UNFILTERED,
OPENFILTERED,
} e_state;
[[__maybe_unused__]] static const char *states_str[] = {
"OPENED", "CLOSED", "FILTERED", "UNFILTERED", "OPENFILTERED",
};
struct response {
uint16_t port;
e_state states[SCAN_ALL];
@ -24,3 +30,4 @@ struct response {
void tcp_response(const struct tcphdr *tcphdr, const struct scan *data);
void udp_response(const struct udphdr *udphdr, const struct scan *data);
void icmp_response(const struct icmphdr *icmphdr, const struct scan *data);
void no_response(const struct scan *data);