42_ft_nmap/include/parsing.h
2025-05-29 14:52:09 +02:00

29 lines
521 B
C

#pragma once
#include <stdint.h>
#include "scan.h"
#define NB_OPTIONS 6
typedef enum {
FL_HELP,
FL_PORTS,
FL_IP,
FL_FILE,
FL_SPEEDUP,
FL_SCAN,
} e_flag;
struct option_lst {
e_flag flag;
char *arg;
struct option_lst *next;
};
struct option_lst *parse_options(int ac, char *const *av);
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);
void free_options(struct option_lst *options);