2016-07-07 14:04:34 +02:00
|
|
|
/*
|
|
|
|
* Common hostapd/wpa_supplicant command line interface functionality
|
|
|
|
* Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
|
|
|
|
*
|
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CLI_H
|
|
|
|
#define CLI_H
|
|
|
|
|
|
|
|
#include "utils/list.h"
|
|
|
|
|
2016-07-07 14:04:38 +02:00
|
|
|
extern const char *const cli_license;
|
|
|
|
extern const char *const cli_full_license;
|
|
|
|
|
2016-07-07 14:04:34 +02:00
|
|
|
struct cli_txt_entry {
|
|
|
|
struct dl_list list;
|
|
|
|
char *txt;
|
|
|
|
};
|
|
|
|
|
|
|
|
void cli_txt_list_free(struct cli_txt_entry *e);
|
|
|
|
void cli_txt_list_flush(struct dl_list *list);
|
|
|
|
|
|
|
|
struct cli_txt_entry *
|
|
|
|
cli_txt_list_get(struct dl_list *txt_list, const char *txt);
|
|
|
|
|
|
|
|
void cli_txt_list_del(struct dl_list *txt_list, const char *txt);
|
|
|
|
void cli_txt_list_del_addr(struct dl_list *txt_list, const char *txt);
|
|
|
|
void cli_txt_list_del_word(struct dl_list *txt_list, const char *txt,
|
|
|
|
int separator);
|
|
|
|
|
|
|
|
int cli_txt_list_add(struct dl_list *txt_list, const char *txt);
|
|
|
|
int cli_txt_list_add_addr(struct dl_list *txt_list, const char *txt);
|
|
|
|
int cli_txt_list_add_word(struct dl_list *txt_list, const char *txt,
|
|
|
|
int separator);
|
|
|
|
|
|
|
|
char ** cli_txt_list_array(struct dl_list *txt_list);
|
|
|
|
|
2016-08-06 11:39:56 +02:00
|
|
|
int get_cmd_arg_num(const char *str, int pos);
|
2016-08-06 11:41:56 +02:00
|
|
|
int write_cmd(char *buf, size_t buflen, const char *cmd, int argc,
|
|
|
|
char *argv[]);
|
2016-08-06 11:39:56 +02:00
|
|
|
|
2016-08-06 11:46:39 +02:00
|
|
|
#define max_args 10
|
|
|
|
int tokenize_cmd(char *cmd, char *argv[]);
|
|
|
|
|
2016-07-07 14:04:34 +02:00
|
|
|
#endif /* CLI_H */
|