feature: start to implement responses
This commit is contained in:
27
src/thread.c
Normal file
27
src/thread.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user