Move cli global state into a structure and pass it around

This commit is contained in:
Jeremy Lakeman 2013-07-03 16:51:27 +09:30
parent 8249f65f8f
commit 53f3920b90
12 changed files with 390 additions and 414 deletions

2
cli.c
View File

@ -286,7 +286,7 @@ void _debug_cli_parsed(struct __sourceloc __whence, const struct cli_parsed *par
DEBUGF("parsed%s", strbuf_str(b)); DEBUGF("parsed%s", strbuf_str(b));
} }
int cli_invoke(const struct cli_parsed *parsed, void *context) int cli_invoke(const struct cli_parsed *parsed, struct cli_context *context)
{ {
IN(); IN();
int ret = parsed->commands[parsed->cmdi].function(parsed, context); int ret = parsed->commands[parsed->cmdi].function(parsed, context);

30
cli.h
View File

@ -23,12 +23,27 @@
#include "xprintf.h" #include "xprintf.h"
#include "log.h" #include "log.h"
#ifdef HAVE_JNI_H
#include <jni.h>
#endif
#define COMMAND_LINE_MAX_LABELS (32) #define COMMAND_LINE_MAX_LABELS (32)
struct cli_parsed; struct cli_parsed;
struct cli_context{
#ifdef HAVE_JNI_H
JNIEnv *jni_env;
int jni_exception;
jobject jniResults;
char *outv_buffer;
char *outv_current;
char *outv_limit;
#endif
void *context;
};
struct cli_schema { struct cli_schema {
int (*function)(const struct cli_parsed *parsed, void *context); int (*function)(const struct cli_parsed *parsed, struct cli_context *context);
const char *words[COMMAND_LINE_MAX_LABELS]; const char *words[COMMAND_LINE_MAX_LABELS];
unsigned long long flags; unsigned long long flags;
#define CLIFLAG_PERMISSIVE_CONFIG (1<<0) /* Accept defective configuration file */ #define CLIFLAG_PERMISSIVE_CONFIG (1<<0) /* Accept defective configuration file */
@ -57,7 +72,7 @@ int cli_usage(const struct cli_schema *commands, XPRINTF xpf);
int cli_usage_args(const int argc, const char *const *args, const struct cli_schema *commands, XPRINTF xpf); int cli_usage_args(const int argc, const char *const *args, const struct cli_schema *commands, XPRINTF xpf);
int cli_usage_parsed(const struct cli_parsed *parsed, XPRINTF xpf); int cli_usage_parsed(const struct cli_parsed *parsed, XPRINTF xpf);
int cli_parse(const int argc, const char *const *args, const struct cli_schema *commands, struct cli_parsed *parsed); int cli_parse(const int argc, const char *const *args, const struct cli_schema *commands, struct cli_parsed *parsed);
int cli_invoke(const struct cli_parsed *parsed, void *context); int cli_invoke(const struct cli_parsed *parsed, struct cli_context *context);
int _cli_arg(struct __sourceloc __whence, const struct cli_parsed *parsed, char *label, const char **dst, int (*validator)(const char *arg), char *defaultvalue); int _cli_arg(struct __sourceloc __whence, const struct cli_parsed *parsed, char *label, const char **dst, int (*validator)(const char *arg), char *defaultvalue);
#define cli_arg(parsed, label, dst, validator, defaultvalue) _cli_arg(__WHENCE__, parsed, label, dst, validator, defaultvalue) #define cli_arg(parsed, label, dst, validator, defaultvalue) _cli_arg(__WHENCE__, parsed, label, dst, validator, defaultvalue)
@ -74,4 +89,15 @@ int cli_interval_ms(const char *arg);
int cli_uint(const char *arg); int cli_uint(const char *arg);
int cli_optional_did(const char *text); int cli_optional_did(const char *text);
int cli_putchar(struct cli_context *context, char c);
int cli_puts(struct cli_context *context, const char *str);
int cli_printf(struct cli_context *context, const char *fmt, ...);
int cli_delim(struct cli_context *context, const char *opt);
void cli_columns(struct cli_context *context, int columns, const char *names[]);
void cli_row_count(struct cli_context *context, int rows);
void cli_field_name(struct cli_context *context, const char *name, const char *delim);
void cli_put_long(struct cli_context *context, int64_t value, const char *delim);
void cli_put_string(struct cli_context *context, const char *value, const char *delim);
void cli_put_hexvalue(struct cli_context *context, const unsigned char *value, int length, const char *delim);
#endif // __SERVALD_CLI_H #endif // __SERVALD_CLI_H

File diff suppressed because it is too large Load Diff

2
main.c
View File

@ -33,7 +33,7 @@ int main(int argc, char **argv)
srandomdev(); srandomdev();
server_save_argv(argc, (const char*const*)argv); server_save_argv(argc, (const char*const*)argv);
cf_init(); cf_init();
int status = parseCommandLine(argv[0], argc - 1, (const char*const*)&argv[1]); int status = parseCommandLine(NULL, argv[0], argc - 1, (const char*const*)&argv[1]);
#if defined WIN32 #if defined WIN32
WSACleanup(); WSACleanup();
#endif #endif

View File

@ -46,7 +46,7 @@ struct monitor_command_handler monitor_handlers[]={
{.command="", .handler=remote_print}, {.command="", .handler=remote_print},
}; };
int app_monitor_cli(const struct cli_parsed *parsed, void *context) int app_monitor_cli(const struct cli_parsed *parsed, struct cli_context *context)
{ {
struct pollfd fds[2]; struct pollfd fds[2];
struct monitor_state *state; struct monitor_state *state;

View File

@ -390,9 +390,9 @@ static int monitor_announce_all_peers(struct subscriber *subscriber, void *conte
return 0; return 0;
} }
static int monitor_set(const struct cli_parsed *parsed, void *context) static int monitor_set(const struct cli_parsed *parsed, struct cli_context *context)
{ {
struct monitor_context *c=context; struct monitor_context *c=context->context;
if (strcase_startswith(parsed->args[1],"vomp",NULL)){ if (strcase_startswith(parsed->args[1],"vomp",NULL)){
c->flags|=MONITOR_VOMP; c->flags|=MONITOR_VOMP;
// store the list of supported codecs against the monitor connection, // store the list of supported codecs against the monitor connection,
@ -423,9 +423,9 @@ static int monitor_set(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int monitor_clear(const struct cli_parsed *parsed, void *context) static int monitor_clear(const struct cli_parsed *parsed, struct cli_context *context)
{ {
struct monitor_context *c=context; struct monitor_context *c=context->context;
if (strcase_startswith(parsed->args[1],"vomp",NULL)) if (strcase_startswith(parsed->args[1],"vomp",NULL))
c->flags&=~MONITOR_VOMP; c->flags&=~MONITOR_VOMP;
else if (strcase_startswith(parsed->args[1],"rhizome", NULL)) else if (strcase_startswith(parsed->args[1],"rhizome", NULL))
@ -446,9 +446,9 @@ static int monitor_clear(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int monitor_lookup_match(const struct cli_parsed *parsed, void *context) static int monitor_lookup_match(const struct cli_parsed *parsed, struct cli_context *context)
{ {
struct monitor_context *c = context; struct monitor_context *c = context->context;
const char *sid = parsed->args[2]; const char *sid = parsed->args[2];
const char *ext = parsed->args[4]; const char *ext = parsed->args[4];
const char *name = parsed->argc >= 4 ? parsed->args[5] : ""; const char *name = parsed->argc >= 4 ? parsed->args[5] : "";
@ -470,9 +470,9 @@ static int monitor_lookup_match(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int monitor_call(const struct cli_parsed *parsed, void *context) static int monitor_call(const struct cli_parsed *parsed, struct cli_context *context)
{ {
struct monitor_context *c=context; struct monitor_context *c=context->context;
unsigned char sid[SID_SIZE]; unsigned char sid[SID_SIZE];
if (stowSid(sid, 0, parsed->args[1]) == -1) if (stowSid(sid, 0, parsed->args[1]) == -1)
return monitor_write_error(c,"invalid SID, so cannot place call"); return monitor_write_error(c,"invalid SID, so cannot place call");
@ -484,7 +484,7 @@ static int monitor_call(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int monitor_call_ring(const struct cli_parsed *parsed, void *context) static int monitor_call_ring(const struct cli_parsed *parsed, struct cli_context *context)
{ {
struct vomp_call_state *call=vomp_find_call_by_session(strtol(parsed->args[1],NULL,16)); struct vomp_call_state *call=vomp_find_call_by_session(strtol(parsed->args[1],NULL,16));
if (!call) if (!call)
@ -494,7 +494,7 @@ static int monitor_call_ring(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int monitor_call_pickup(const struct cli_parsed *parsed, void *context) static int monitor_call_pickup(const struct cli_parsed *parsed, struct cli_context *context)
{ {
struct vomp_call_state *call=vomp_find_call_by_session(strtol(parsed->args[1],NULL,16)); struct vomp_call_state *call=vomp_find_call_by_session(strtol(parsed->args[1],NULL,16));
if (!call) if (!call)
@ -504,9 +504,9 @@ static int monitor_call_pickup(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int monitor_call_audio(const struct cli_parsed *parsed, void *context) static int monitor_call_audio(const struct cli_parsed *parsed, struct cli_context *context)
{ {
struct monitor_context *c=context; struct monitor_context *c=context->context;
struct vomp_call_state *call=vomp_find_call_by_session(strtol(parsed->args[1],NULL,16)); struct vomp_call_state *call=vomp_find_call_by_session(strtol(parsed->args[1],NULL,16));
if (!call){ if (!call){
@ -522,7 +522,7 @@ static int monitor_call_audio(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int monitor_call_hangup(const struct cli_parsed *parsed, void *context) static int monitor_call_hangup(const struct cli_parsed *parsed, struct cli_context *context)
{ {
struct vomp_call_state *call=vomp_find_call_by_session(strtol(parsed->args[1],NULL,16)); struct vomp_call_state *call=vomp_find_call_by_session(strtol(parsed->args[1],NULL,16));
if (!call) if (!call)
@ -532,9 +532,9 @@ static int monitor_call_hangup(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int monitor_call_dtmf(const struct cli_parsed *parsed, void *context) static int monitor_call_dtmf(const struct cli_parsed *parsed, struct cli_context *context)
{ {
struct monitor_context *c=context; struct monitor_context *c=context->context;
struct vomp_call_state *call=vomp_find_call_by_session(strtol(parsed->args[1],NULL,16)); struct vomp_call_state *call=vomp_find_call_by_session(strtol(parsed->args[1],NULL,16));
if (!call) if (!call)
return monitor_write_error(c,"Invalid call token"); return monitor_write_error(c,"Invalid call token");
@ -556,7 +556,7 @@ static int monitor_call_dtmf(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int monitor_help(const struct cli_parsed *parsed, void *context); static int monitor_help(const struct cli_parsed *parsed, struct cli_context *context);
struct cli_schema monitor_commands[] = { struct cli_schema monitor_commands[] = {
{monitor_help,{"help",NULL},0,""}, {monitor_help,{"help",NULL},0,""},
@ -579,14 +579,15 @@ int monitor_process_command(struct monitor_context *c)
int argc = parse_argv(c->line, ' ', argv, 16); int argc = parse_argv(c->line, ' ', argv, 16);
struct cli_parsed parsed; struct cli_parsed parsed;
if (cli_parse(argc, (const char *const*)argv, monitor_commands, &parsed) || cli_invoke(&parsed, c)) struct cli_context context={.context=c};
if (cli_parse(argc, (const char *const*)argv, monitor_commands, &parsed) || cli_invoke(&parsed, &context))
return monitor_write_error(c, "Invalid command"); return monitor_write_error(c, "Invalid command");
return 0; return 0;
} }
static int monitor_help(const struct cli_parsed *parsed, void *context) static int monitor_help(const struct cli_parsed *parsed, struct cli_context *context)
{ {
struct monitor_context *c=context; struct monitor_context *c=context->context;
strbuf b = strbuf_alloca(16384); strbuf b = strbuf_alloca(16384);
strbuf_puts(b, "\nINFO:Usage\n"); strbuf_puts(b, "\nINFO:Usage\n");
cli_usage(monitor_commands, XPRINTF_STRBUF(b)); cli_usage(monitor_commands, XPRINTF_STRBUF(b));

18
nonce.c
View File

@ -48,26 +48,22 @@ int generate_nonce(unsigned char *nonce,int bytes)
return 0; return 0;
} }
int app_nonce_test(const struct cli_parsed *parsed, void *context) int app_nonce_test(const struct cli_parsed *parsed, struct cli_context *context)
{ {
int i,j; int i,j;
unsigned char nonces[0x10001][32]; unsigned char nonces[0x10001][32];
for(i=0;i<0x10001;i++) for(i=0;i<0x10001;i++)
{ {
if (generate_nonce(&nonces[i][0],32)) if (generate_nonce(&nonces[i][0],32))
{ return WHYF("Failed to generate nonce #%d\n",i);
printf("Failed to generate nonce #%d\n",i);
exit(-1);
}
for(j=0;j<i;j++) { for(j=0;j<i;j++) {
if (!memcmp(&nonces[i][0],&nonces[j][0],32)) { if (!memcmp(&nonces[i][0],&nonces[j][0],32))
printf("Nonce #%d is the same as nonce #%d\n",i,j); return WHYF("Nonce #%d is the same as nonce #%d\n",i,j);
exit(-1);
}
} }
if (!(random()&0xff)) printf("Nonce #%d = %02x%02x%02x%02x...\n", if (!(random()&0xff))
cli_printf(context, "Nonce #%d = %02x%02x%02x%02x...\n",
i,nonces[i][0],nonces[i][1],nonces[i][2],nonces[i][3]); i,nonces[i][0],nonces[i][1],nonces[i][2],nonces[i][3]);
} }
printf("Test passed\n"); cli_printf(context, "Test passed\n");
return 0; return 0;
} }

View File

@ -323,7 +323,7 @@ int rhizome_manifest_to_bar(rhizome_manifest *m,unsigned char *bar);
int64_t rhizome_bar_version(const unsigned char *bar); int64_t rhizome_bar_version(const unsigned char *bar);
unsigned long long rhizome_bar_bidprefix_ll(unsigned char *bar); unsigned long long rhizome_bar_bidprefix_ll(unsigned char *bar);
int rhizome_is_bar_interesting(unsigned char *bar); int rhizome_is_bar_interesting(unsigned char *bar);
int rhizome_list_manifests(const char *service, const char *name, int rhizome_list_manifests(struct cli_context *context, const char *service, const char *name,
const char *sender_sid, const char *recipient_sid, const char *sender_sid, const char *recipient_sid,
int limit, int offset, char count_rows); int limit, int offset, char count_rows);
int rhizome_retrieve_manifest(const char *manifestid, rhizome_manifest *m); int rhizome_retrieve_manifest(const char *manifestid, rhizome_manifest *m);

View File

@ -1004,7 +1004,7 @@ rollback:
return -1; return -1;
} }
int rhizome_list_manifests(const char *service, const char *name, int rhizome_list_manifests(struct cli_context *context, const char *service, const char *name,
const char *sender_sid, const char *recipient_sid, const char *sender_sid, const char *recipient_sid,
int limit, int offset, char count_rows) int limit, int offset, char count_rows)
{ {
@ -1068,7 +1068,7 @@ int rhizome_list_manifests(const char *service, const char *name,
"recipient", "recipient",
"name" "name"
}; };
cli_columns(13,names); cli_columns(context, 13, names);
while (sqlite_step_retry(&retry, statement) == SQLITE_ROW) { while (sqlite_step_retry(&retry, statement) == SQLITE_ROW) {
++rows; ++rows;
@ -1146,25 +1146,25 @@ int rhizome_list_manifests(const char *service, const char *name,
from_here = keyring_find_sid(keyring, &cn, &in, &kp, senderSid); from_here = keyring_find_sid(keyring, &cn, &in, &kp, senderSid);
} }
cli_put_long(rowid, ":"); cli_put_long(context, rowid, ":");
cli_put_string(blob_service, ":"); cli_put_string(context, blob_service, ":");
cli_put_hexvalue(m->cryptoSignPublic, RHIZOME_MANIFEST_ID_BYTES, ":"); cli_put_hexvalue(context, m->cryptoSignPublic, RHIZOME_MANIFEST_ID_BYTES, ":");
cli_put_long(blob_version, ":"); cli_put_long(context, blob_version, ":");
cli_put_long(blob_date, ":"); cli_put_long(context, blob_date, ":");
cli_put_long(q_inserttime, ":"); cli_put_long(context, q_inserttime, ":");
cli_put_hexvalue(q_author?m->author:NULL, SID_SIZE, ":"); cli_put_hexvalue(context, q_author?m->author:NULL, SID_SIZE, ":");
cli_put_long(from_here, ":"); cli_put_long(context, from_here, ":");
cli_put_long(m->fileLength, ":"); cli_put_long(context, m->fileLength, ":");
unsigned char filehash[SHA512_DIGEST_LENGTH]; unsigned char filehash[SHA512_DIGEST_LENGTH];
if (m->fileLength) if (m->fileLength)
fromhex(filehash, blob_filehash, SHA512_DIGEST_LENGTH); fromhex(filehash, blob_filehash, SHA512_DIGEST_LENGTH);
cli_put_hexvalue(m->fileLength?filehash:NULL, SHA512_DIGEST_LENGTH, ":"); cli_put_hexvalue(context, m->fileLength?filehash:NULL, SHA512_DIGEST_LENGTH, ":");
cli_put_hexvalue(blob_sender?senderSid:NULL, SID_SIZE, ":"); cli_put_hexvalue(context, blob_sender?senderSid:NULL, SID_SIZE, ":");
cli_put_hexvalue(blob_recipient?recipientSid:NULL, SID_SIZE, ":"); cli_put_hexvalue(context, blob_recipient?recipientSid:NULL, SID_SIZE, ":");
cli_put_string(blob_name, "\n"); cli_put_string(context, blob_name, "\n");
} }
} }
if (m) rhizome_manifest_free(m); if (m) rhizome_manifest_free(m);
@ -1174,7 +1174,7 @@ int rhizome_list_manifests(const char *service, const char *name,
while (sqlite_step_retry(&retry, statement) == SQLITE_ROW) while (sqlite_step_retry(&retry, statement) == SQLITE_ROW)
++rows; ++rows;
} }
cli_row_count(rows); cli_row_count(context, rows);
cleanup: cleanup:
sqlite3_finalize(statement); sqlite3_finalize(statement);

View File

@ -510,7 +510,7 @@ static int rhizome_sync_with_peers(int mode, int peer_count, const struct config
return 0; return 0;
} }
int app_rhizome_direct_sync(const struct cli_parsed *parsed, void *context) int app_rhizome_direct_sync(const struct cli_parsed *parsed, struct cli_context *context)
{ {
if (config.debug.verbose) if (config.debug.verbose)
DEBUG_cli_parsed(parsed); DEBUG_cli_parsed(parsed);

View File

@ -548,7 +548,7 @@ int serval_packetvisualise(XPRINTF xpf, const char *message, const unsigned char
int rhizome_fetching_get_fds(struct pollfd *fds,int *fdcount,int fdmax); int rhizome_fetching_get_fds(struct pollfd *fds,int *fdcount,int fdmax);
int rhizome_opendb(); int rhizome_opendb();
int parseCommandLine(const char *argv0, int argc, const char *const *argv); int parseCommandLine(struct cli_context *context, const char *argv0, int argc, const char *const *argv);
int overlay_mdp_get_fds(struct pollfd *fds,int *fdcount,int fdmax); int overlay_mdp_get_fds(struct pollfd *fds,int *fdcount,int fdmax);
int overlay_mdp_reply_error(int sock, int overlay_mdp_reply_error(int sock,
@ -641,17 +641,6 @@ int vomp_received_audio(struct vomp_call_state *call, int audio_codec, int time,
const unsigned char *audio, int audio_length); const unsigned char *audio, int audio_length);
void monitor_get_all_supported_codecs(unsigned char *codecs); void monitor_get_all_supported_codecs(unsigned char *codecs);
int cli_putchar(char c);
int cli_puts(const char *str);
int cli_printf(const char *fmt, ...);
int cli_delim(const char *opt);
void cli_columns(int columns, const char *names[]);
void cli_row_count(int rows);
void cli_field_name(const char *name, const char *delim);
void cli_put_long(int64_t value, const char *delim);
void cli_put_string(const char *value, const char *delim);
void cli_put_hexvalue(const unsigned char *value, int length, const char *delim);
int overlay_mdp_getmyaddr(unsigned index, sid_t *sid); int overlay_mdp_getmyaddr(unsigned index, sid_t *sid);
int overlay_mdp_bind(const sid_t *localaddr, int port) ; int overlay_mdp_bind(const sid_t *localaddr, int port) ;
int overlay_route_node_info(overlay_mdp_nodeinfo *node_info); int overlay_route_node_info(overlay_mdp_nodeinfo *node_info);
@ -671,13 +660,10 @@ int directory_registration();
int directory_service_init(); int directory_service_init();
struct cli_parsed; struct cli_parsed;
int app_nonce_test(const struct cli_parsed *parsed, void *context); int app_nonce_test(const struct cli_parsed *parsed, struct cli_context *context);
int app_rhizome_direct_sync(const struct cli_parsed *parsed, void *context); int app_rhizome_direct_sync(const struct cli_parsed *parsed, struct cli_context *context);
#ifdef HAVE_VOIPTEST int app_monitor_cli(const struct cli_parsed *parsed, struct cli_context *context);
int app_pa_phone(const struct cli_parsed *parsed, void *context); int app_vomp_console(const struct cli_parsed *parsed, struct cli_context *context);
#endif
int app_monitor_cli(const struct cli_parsed *parsed, void *context);
int app_vomp_console(const struct cli_parsed *parsed, void *context);
int monitor_get_fds(struct pollfd *fds,int *fdcount,int fdmax); int monitor_get_fds(struct pollfd *fds,int *fdcount,int fdmax);

View File

@ -186,7 +186,7 @@ struct monitor_command_handler console_handlers[]={
{.command="MONITORSTATUS", .handler=remote_noop}, {.command="MONITORSTATUS", .handler=remote_noop},
}; };
static int console_dial(const struct cli_parsed *parsed, void *context) static int console_dial(const struct cli_parsed *parsed, struct cli_context *context)
{ {
if (call_token!=-1){ if (call_token!=-1){
printf("Already in a call\n"); printf("Already in a call\n");
@ -199,7 +199,7 @@ static int console_dial(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int console_answer(const struct cli_parsed *parsed, void *context) static int console_answer(const struct cli_parsed *parsed, struct cli_context *context)
{ {
if (call_token==-1){ if (call_token==-1){
printf("No active call to answer\n"); printf("No active call to answer\n");
@ -209,7 +209,7 @@ static int console_answer(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int console_hangup(const struct cli_parsed *parsed, void *context) static int console_hangup(const struct cli_parsed *parsed, struct cli_context *context)
{ {
if (call_token==-1){ if (call_token==-1){
printf("No call to hangup\n"); printf("No call to hangup\n");
@ -219,7 +219,7 @@ static int console_hangup(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int console_audio(const struct cli_parsed *parsed, void *context) static int console_audio(const struct cli_parsed *parsed, struct cli_context *context)
{ {
if (call_token==-1){ if (call_token==-1){
printf("No active call\n"); printf("No active call\n");
@ -243,7 +243,7 @@ static int console_audio(const struct cli_parsed *parsed, void *context)
return 0; return 0;
} }
static int console_usage(const struct cli_parsed *parsed, void *context); static int console_usage(const struct cli_parsed *parsed, struct cli_context *context);
struct cli_schema console_commands[]={ struct cli_schema console_commands[]={
{console_answer,{"answer",NULL},0,"Answer an incoming phone call"}, {console_answer,{"answer",NULL},0,"Answer an incoming phone call"},
@ -254,7 +254,7 @@ struct cli_schema console_commands[]={
{NULL}, {NULL},
}; };
static int console_usage(const struct cli_parsed *parsed, void *context) static int console_usage(const struct cli_parsed *parsed, struct cli_context *context)
{ {
cli_usage(console_commands, XPRINTF_STDIO(stdout)); cli_usage(console_commands, XPRINTF_STDIO(stdout));
fflush(stdout); fflush(stdout);
@ -322,7 +322,7 @@ static void monitor_read(struct sched_ent *alarm){
} }
} }
int app_vomp_console(const struct cli_parsed *parsed, void *context) int app_vomp_console(const struct cli_parsed *parsed, struct cli_context *context)
{ {
if (config.debug.verbose) if (config.debug.verbose)
DEBUG_cli_parsed(parsed); DEBUG_cli_parsed(parsed);