-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscan_structs.h
More file actions
35 lines (29 loc) · 821 Bytes
/
scan_structs.h
File metadata and controls
35 lines (29 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#include <arpa/inet.h>
#include <stdbool.h>
#include <sys/socket.h>
#include "../constans.h"
#include "../other/network_interface.h"
#include "../other/transfer_layers.h"
// #include "constans.h"
// Used to store scanning result from a scan
typedef struct {
int state;
double scannig_time;
} scan_result_t;
// Used as a universal argument for every scanning method
typedef struct {
struct sockaddr_storage addr;
interface_info interface;
unsigned int timeout;
unsigned short port;
} scan_arg_t;
// Used to store information about a scanning functions
// that can be used to set it up
typedef struct {
char *name;
bool needs_root;
// This is used in case of a raw socket
transfer_protocol_t transfer_protocol;
int (*scan_func)(scan_arg_t arg, scan_result_t *result);
} scan_func_t;