feature: start to implement responses

This commit is contained in:
0x35c
2025-05-22 17:08:26 +02:00
parent 1361cd9f9c
commit 84d5960900
10 changed files with 224 additions and 23 deletions

27
src/thread.c Normal file
View File

@ -0,0 +1,27 @@
#include <netinet/in.h>
#include <stdint.h>
#include <stdio.h>
#include "scan.h"
#include "thread.h"
void *routine(void *p_data)
{
struct thread *thread_data = (struct thread *)p_data;
struct scan scan_data = {
.dest_addr = thread_data->dest_addr,
.host = &thread_data->host,
.port_start = thread_data->port_start,
.type = thread_data->type,
};
for (uint16_t port = thread_data->port_start;
port <= thread_data->port_end; port++) {
scan_data.port = port;
scan_data.response =
&thread_data->responses[thread_data->port_start - port];
scan(&scan_data);
}
return p_data;
}