-
Notifications
You must be signed in to change notification settings - Fork 0
/
mports.h
54 lines (51 loc) · 1.28 KB
/
mports.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Struct: input_args
* ------------------
* A struct to represent program parameters.
*
* tar_ip: Target IP address.
*
* dev_name: Network interface device name.
*
* simp_scan: Boolean indicating to perform a simple scan or a full scan.
*
* start_port: Starting TCP port.
*
* end_port: Ending TCP port.
*/
struct input_args {
const struct in_addr *tar_ip;
const char* dev_name;
unsigned char simp_scan;
unsigned short start_port;
unsigned short end_port;
};
/*
* Function: parse_input_args
* --------------------------
* Parses the input arguments and uses them to populate a input_args struct
* used to set program options.
*
* argc: The number of tokens in argv.
*
* argv: An array of tokens of size argc.
*
* return: A input_args struct or NULL on error.
*/
struct input_args * parse_input_args(int argc, const char **argv);
/*
* Function: print_usage
* ---------------------
* Prints the program's usage message.
*/
void print_usage();
/*
* Function: get_common_ports_arr
* ------------------------------
* Copies common port numbers into the arr_copy array parameter.
*
* arr_copy: A NULL pointer.
*
* return: The length of the array copied.
*/
int get_common_ports_arr(unsigned short int *arr_copy);