2021-10-26 15:17:39 +02:00
|
|
|
/* This common_user.h is used by userspace programs */
|
|
|
|
#ifndef __COMMON_PARAMS_H
|
|
|
|
#define __COMMON_PARAMS_H
|
|
|
|
|
|
|
|
#include <getopt.h>
|
|
|
|
#include "common_defines.h"
|
|
|
|
|
|
|
|
struct option_wrapper {
|
|
|
|
struct option option;
|
|
|
|
char *help;
|
|
|
|
char *metavar;
|
|
|
|
bool required;
|
|
|
|
};
|
|
|
|
|
|
|
|
void usage(const char *prog_name, const char *doc,
|
|
|
|
const struct option_wrapper *long_options, bool full);
|
|
|
|
|
|
|
|
void parse_cmdline_args(int argc, char **argv,
|
|
|
|
const struct option_wrapper *long_options,
|
|
|
|
struct config *cfg, const char *doc);
|
|
|
|
|
2022-01-18 16:48:34 +01:00
|
|
|
bool get_ipv4_u32(char *ip_str, uint32_t *ip_addr);
|
|
|
|
|
2021-10-26 15:17:39 +02:00
|
|
|
#endif /* __COMMON_PARAMS_H */
|