1/* 2 * Common hostapd/wpa_supplicant command line interface functionality 3 * Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi> 4 * 5 * This software may be distributed under the terms of the BSD license. 6 * See README for more details. 7 */ 8 9#ifndef CLI_H 10#define CLI_H 11 12#include "utils/list.h" 13 14extern const char *const cli_license; 15extern const char *const cli_full_license; 16 17struct cli_txt_entry { 18 struct dl_list list; 19 char *txt; 20}; 21 22void cli_txt_list_free(struct cli_txt_entry *e); 23void cli_txt_list_flush(struct dl_list *list); 24 25struct cli_txt_entry * 26cli_txt_list_get(struct dl_list *txt_list, const char *txt); 27 28void cli_txt_list_del(struct dl_list *txt_list, const char *txt); 29void cli_txt_list_del_addr(struct dl_list *txt_list, const char *txt); 30void cli_txt_list_del_word(struct dl_list *txt_list, const char *txt, 31 int separator); 32 33int cli_txt_list_add(struct dl_list *txt_list, const char *txt); 34int cli_txt_list_add_addr(struct dl_list *txt_list, const char *txt); 35int cli_txt_list_add_word(struct dl_list *txt_list, const char *txt, 36 int separator); 37 38char ** cli_txt_list_array(struct dl_list *txt_list); 39 40int get_cmd_arg_num(const char *str, int pos); 41int write_cmd(char *buf, size_t buflen, const char *cmd, int argc, 42 char *argv[]); 43 44#define max_args 10 45int tokenize_cmd(char *cmd, char *argv[]); 46 47#endif /* CLI_H */ 48