33 lines
672 B
C
33 lines
672 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "host.h"
|
|
|
|
#define SCAN_NULL (1 << 0)
|
|
#define SCAN_SYN (1 << 1)
|
|
#define SCAN_ACK (1 << 2)
|
|
#define SCAN_FIN (1 << 3)
|
|
#define SCAN_XMAS (1 << 4)
|
|
#define SCAN_UDP (1 << 5)
|
|
#define SCAN_ALL (SCAN_NULL | SCAN_SYN | SCAN_ACK | SCAN_FIN | SCAN_XMAS | SCAN_UDP)
|
|
|
|
[[__maybe_unused__]] static const char *types_str[] = {
|
|
"NULL", "SYN", "ACK", "FIN", "XMAS", "UDP",
|
|
};
|
|
|
|
#define NB_SCAN (sizeof(types_str) / sizeof(*types_str))
|
|
|
|
struct scan {
|
|
struct host host;
|
|
char *dest_addr;
|
|
uint16_t port_start;
|
|
uint16_t port_end;
|
|
uint8_t type;
|
|
uint8_t ttl;
|
|
uint8_t max_retries;
|
|
struct response *responses;
|
|
};
|
|
|
|
int scan(struct scan *data);
|