feature: multithreading wip

This commit is contained in:
0x35c
2025-05-29 02:16:04 +02:00
parent 6538a085b9
commit 623b3ad0d7
8 changed files with 231 additions and 29 deletions

View File

@ -2,5 +2,6 @@
#include <netinet/in.h>
int dns_lookup(char *ip_addr, char *hostname, struct sockaddr_in *addr_con);
int dns_lookup(char *ip_addr, const char *hostname,
struct sockaddr_in *addr_con);
int reverse_dns_lookup(char *ip_addr, char *host);

View File

@ -1,5 +1,9 @@
#pragma once
#include <stdint.h>
#include "scan.h"
#define NB_OPTIONS 5
typedef enum {
@ -17,4 +21,6 @@ struct option_lst {
};
struct option_lst *parse_options(int ac, char *const *av);
char *get_option_arg(struct option_lst *options, e_flag flag);
const char *get_option_arg(const struct option_lst *options, e_flag flag);
int parse_ports(const char *arg, uint16_t *start, uint16_t *end);
e_scantype parse_type(const char *arg);

View File

@ -11,7 +11,7 @@ typedef enum {
SCAN_FIN,
SCAN_XMAS,
SCAN_UDP,
SCAN_TCP,
SCAN_ALL,
} e_scantype;
struct scan {

View File

@ -3,6 +3,7 @@
#include <stdint.h>
#include "host.h"
#include "parsing.h"
#include "response.h"
#include "scan.h"
@ -16,3 +17,5 @@ struct thread {
};
void *routine(void *p_data);
int create_threads(const struct option_lst *options, char *ip_addr,
struct response *responses);