X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-config.c;h=b23619e45f3c875c4edc088ff4883af9e5547be0;hb=0bae7b4ed23310d368bdd2e0b167d8283bced4a0;hp=f7e5000896254fc391106c4b1630dceed86fe77e;hpb=f7b281af2b449de0c9cddde6d455b17905631a75;p=src%2Fapp-framework-binder.git diff --git a/src/afb-config.c b/src/afb-config.c index f7e50008..b23619e4 100644 --- a/src/afb-config.c +++ b/src/afb-config.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015, 2016, 2017 "IoT.bzh" + * Copyright (C) 2015-2018 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -97,6 +97,7 @@ #define SET_QUIET 'q' #define SET_RNDTOKEN 'r' #define SET_TRACESVC 'S' +#define SET_TRACESES 's' #define SET_TRACEREQ 'T' #define SET_AUTH_TOKEN 't' #define SET_UPLOAD_DIR 'u' @@ -105,7 +106,7 @@ #define SET_WORK_DIR 'w' const char shortopts[] = - "c:D:E:ehn:p:qrT:t:u:Vvw:" + "c:D:E:ehn:p:qrS:s:T:t:u:Vvw:" #if defined(WITH_MONITORING_OPTION) "M" #endif @@ -169,6 +170,7 @@ static AFB_options cliOptions[] = { {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"}, + {SET_TRACESES, 1, "traceses", "Log the sessions: no, all"}, {ADD_CALL, 1, "call", "call at start format of val: API/VERB:json-args"}, @@ -219,6 +221,13 @@ static struct enumdesc traceevt_desc[] = { { NULL, 0 } }; +static struct enumdesc traceses_desc[] = { + { "no", 0 }, + { "common", afb_hook_flags_session_common }, + { "all", afb_hook_flags_session_all }, + { NULL, 0 } +}; + static struct enumdesc mode_desc[] = { { "local", AFB_MODE_LOCAL }, { "remote", AFB_MODE_REMOTE }, @@ -588,6 +597,10 @@ static void parse_arguments(int argc, char **argv, struct afb_config *config) config->traceevt = argvalenum(optc, traceevt_desc); break; + case SET_TRACESES: + config->traceses = argvalenum(optc, traceses_desc); + break; + case SET_NO_HTTPD: noarg(optc); config->noHttpd = 1; @@ -734,11 +747,14 @@ void afb_config_dump(struct afb_config *config) E(traceditf,traceditf_desc) E(tracesvc,tracesvc_desc) E(traceevt,traceevt_desc) + E(traceses,traceses_desc) B(no_ldpaths) B(noHttpd) B(background) +#if defined(WITH_MONITORING_OPTION) B(monitoring) +#endif B(random_token) P("---END-OF-CONFIG---\n"); @@ -785,6 +801,7 @@ static void parse_environment(struct afb_config *config) on_environment_enum(&config->traceditf, "AFB_TRACEDITF", traceditf_desc); on_environment_enum(&config->tracesvc, "AFB_TRACESVC", tracesvc_desc); on_environment_enum(&config->traceevt, "AFB_TRACEEVT", traceevt_desc); + on_environment_enum(&config->traceses, "AFB_TRACESES", traceses_desc); on_environment_list(&config->ldpaths, "AFB_LDPATHS"); } @@ -862,11 +879,14 @@ struct json_object *afb_config_json(struct afb_config *config) E(traceditf,traceditf_desc) E(tracesvc,tracesvc_desc) E(traceevt,traceevt_desc) + E(traceses,traceses_desc) B(no_ldpaths) B(noHttpd) B(background) +#if defined(WITH_MONITORING_OPTION) B(monitoring) +#endif B(random_token) #undef E