1324714Scy/* 2324714Scy * Common hostapd/wpa_supplicant command line interface functionality 3324714Scy * Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi> 4324714Scy * 5324714Scy * This software may be distributed under the terms of the BSD license. 6324714Scy * See README for more details. 7324714Scy */ 8324714Scy 9324714Scy#ifndef CLI_H 10324714Scy#define CLI_H 11324714Scy 12324714Scy#include "utils/list.h" 13324714Scy 14324714Scyextern const char *const cli_license; 15324714Scyextern const char *const cli_full_license; 16324714Scy 17324714Scystruct cli_txt_entry { 18324714Scy struct dl_list list; 19324714Scy char *txt; 20324714Scy}; 21324714Scy 22324714Scyvoid cli_txt_list_free(struct cli_txt_entry *e); 23324714Scyvoid cli_txt_list_flush(struct dl_list *list); 24324714Scy 25324714Scystruct cli_txt_entry * 26324714Scycli_txt_list_get(struct dl_list *txt_list, const char *txt); 27324714Scy 28324714Scyvoid cli_txt_list_del(struct dl_list *txt_list, const char *txt); 29324714Scyvoid cli_txt_list_del_addr(struct dl_list *txt_list, const char *txt); 30324714Scyvoid cli_txt_list_del_word(struct dl_list *txt_list, const char *txt, 31324714Scy int separator); 32324714Scy 33324714Scyint cli_txt_list_add(struct dl_list *txt_list, const char *txt); 34324714Scyint cli_txt_list_add_addr(struct dl_list *txt_list, const char *txt); 35324714Scyint cli_txt_list_add_word(struct dl_list *txt_list, const char *txt, 36324714Scy int separator); 37324714Scy 38324714Scychar ** cli_txt_list_array(struct dl_list *txt_list); 39324714Scy 40324714Scyint get_cmd_arg_num(const char *str, int pos); 41324714Scyint write_cmd(char *buf, size_t buflen, const char *cmd, int argc, 42324714Scy char *argv[]); 43324714Scy 44324714Scy#define max_args 10 45324714Scyint tokenize_cmd(char *cmd, char *argv[]); 46324714Scy 47324714Scy#endif /* CLI_H */ 48