X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-config.c;h=98dd4e553f805d1085af782beebd162158ddc386;hb=4e925980d16a7468a55ad2c23cc29ec51311ef6d;hp=1b4a36933c58d9fe680b9f6e8c8e735d561bca0e;hpb=df506d8aeef9ec113c455f3a5f3d471b0a8529e6;p=src%2Fapp-framework-binder.git diff --git a/src/afb-config.c b/src/afb-config.c index 1b4a3693..98dd4e55 100644 --- a/src/afb-config.c +++ b/src/afb-config.c @@ -16,7 +16,7 @@ */ #define _GNU_SOURCE -#define NO_BINDING_VERBOSE_MACRO +#define AFB_BINDING_PRAGMA_NO_VERBOSE_MACRO #include #include @@ -31,7 +31,7 @@ #include "afb-config.h" #include "afb-hook.h" -#include +#include #if !defined(BINDING_INSTALL_DIR) #error "you should define BINDING_INSTALL_DIR" @@ -85,11 +85,14 @@ #define SET_NO_HTTPD 28 +#define ADD_CALL 'c' #define SET_TRACEDITF 'D' +#define SET_TRACEEVT 'E' #define SET_EXEC 'e' #define DISPLAY_HELP 'h' #define SET_QUIET 'q' #define SET_RNDTOKEN 'r' +#define SET_TRACESVC 'S' #define SET_TRACEREQ 'T' #define SET_AUTH_TOKEN 't' #define SET_UPLOAD_DIR 'u' @@ -97,7 +100,7 @@ #define SET_VERBOSE 'v' #define SET_WORK_DIR 'w' -#define SHORTOPTS "D:ehqrT:t:u:Vvw:" +#define SHORTOPTS "c:D:E:ehqrT:t:u:Vvw:" // Command line structure hold cli --command + help text typedef struct { @@ -151,6 +154,10 @@ static AFB_options cliOptions[] = { {SET_TRACEREQ, 1, "tracereq", "Log the requests: no, common, extra, all"}, {SET_TRACEDITF, 1, "traceditf", "Log the requests: no, common, extra, all"}, + {SET_TRACESVC, 1, "tracesvc", "Log the requests: no, all"}, + {SET_TRACEEVT, 1, "traceevt", "Log the requests: no, common, extra, all"}, + + {ADD_CALL, 1, "call", "call at start format of val: API/VERB:json-args"}, {SET_NO_HTTPD, 0, "no-httpd", "Forbids HTTP service"}, {SET_EXEC, 0, "exec", "Execute the remaining arguments"}, @@ -182,6 +189,20 @@ static struct enumdesc traceditf_desc[] = { { NULL, 0 } }; +static struct enumdesc tracesvc_desc[] = { + { "no", 0 }, + { "all", afb_hook_flags_svc_all }, + { NULL, 0 } +}; + +static struct enumdesc traceevt_desc[] = { + { "no", 0 }, + { "common", afb_hook_flags_evt_common }, + { "extra", afb_hook_flags_evt_extra }, + { "all", afb_hook_flags_evt_all }, + { NULL, 0 } +}; + static struct enumdesc mode_desc[] = { { "local", AFB_MODE_LOCAL }, { "remote", AFB_MODE_REMOTE }, @@ -437,6 +458,10 @@ static void parse_arguments(int argc, char **argv, struct afb_config *config) list_add(&config->ldpaths, argvalstr(optc)); break; + case ADD_CALL: + list_add(&config->calls, argvalstr(optc)); + break; + case SET_SESSION_DIR: /* config->sessiondir = argvalstr(optc); */ WARNING("Obsolete otpion %s ignored", optname(optc)); @@ -500,6 +525,14 @@ static void parse_arguments(int argc, char **argv, struct afb_config *config) config->traceditf = argvalenum(optc, traceditf_desc); break; + case SET_TRACESVC: + config->tracesvc = argvalenum(optc, tracesvc_desc); + break; + + case SET_TRACEEVT: + config->traceevt = argvalenum(optc, traceevt_desc); + break; + case SET_NO_HTTPD: noarg(optc); config->noHttpd = 1; @@ -620,6 +653,7 @@ void afb_config_dump(struct afb_config *config) L(ws_servers) L(so_bindings) L(ldpaths) + L(calls) V(exec)