diff options
author | Frederic Marec <frederic.marec@iot.bzh> | 2019-05-09 18:56:06 +0200 |
---|---|---|
committer | Frederic Marec <frederic.marec@iot.bzh> | 2019-05-09 18:56:06 +0200 |
commit | 395554e75a52056ff6cbff9c2a9a62f401e287a9 (patch) | |
tree | ee779fe56b0ba9e87ccae8cad0d1fe1a0ae73e8e /src/xds-binding.c | |
parent | d285cf2515dc1f65cae7c685f6da18351a0a5429 (diff) |
Git submodule migration to separated libraries
Bug-AGL: SPEC-2139
Change-Id: Ie96b5a51b8e725a175a824236a11eb29de3631fc
Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
Diffstat (limited to 'src/xds-binding.c')
-rw-r--r-- | src/xds-binding.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/xds-binding.c b/src/xds-binding.c index c4193b0..f93a121 100644 --- a/src/xds-binding.c +++ b/src/xds-binding.c @@ -35,37 +35,37 @@ static CtlSectionT ctrlSections[] = { { .key = NULL } }; -static void ctrlapi_ping(AFB_ReqT request) +static void ctrlapi_ping(afb_req_t request) { static int count = 0; json_object* resJ; int rc; count++; - AFB_ReqNotice(request, "Controller:ping count=%d", count); + AFB_REQ_NOTICE(request, "Controller:ping count=%d", count); rc = wrap_json_pack(&resJ, "{ss si}", "status", "pong", "count", count); if (rc < 0) { - AFB_ReqFailF(request, "ERROR", "wrap_json_pack rc=%d", rc); + afb_req_fail_f(request, "ERROR", "wrap_json_pack rc=%d", rc); return; } - AFB_ReqSuccess(request, resJ, NULL); + afb_req_success(request, resJ, NULL); return; } -void ctrlapi_auth(AFB_ReqT request) +void ctrlapi_auth(afb_req_t request) { - AFB_ReqSetLOA(request, 1); - AFB_ReqSuccess(request, NULL, NULL); + afb_req_session_set_LOA(request, 1); + afb_req_success(request, NULL, NULL); } -static AFB_ApiVerbs CtrlApiVerbs[] = { +static afb_verb_t CtrlApiVerbs[] = { /* VERB'S NAME FUNCTION TO CALL SHORT DESCRIPTION */ { .verb = "ping", .callback = ctrlapi_ping, .info = "ping test for API" }, { .verb = "auth", .callback = ctrlapi_auth, .info = "Authenticate session to raise Level Of Assurance of the session" }, { .verb = NULL } /* marker for end of the array */ }; -static int CtrlLoadStaticVerbs(afb_dynapi* apiHandle, AFB_ApiVerbs* verbs) +static int CtrlLoadStaticVerbs(afb_dynapi* apiHandle, afb_verb_t* verbs) { int errcount = 0; @@ -78,7 +78,7 @@ static int CtrlLoadStaticVerbs(afb_dynapi* apiHandle, AFB_ApiVerbs* verbs) return errcount; }; -static int CtrlInitOneApi(AFB_ApiT apiHandle) +static int CtrlInitOneApi(afb_api_t apiHandle) { int err = 0; @@ -88,7 +88,7 @@ static int CtrlInitOneApi(AFB_ApiT apiHandle) CtlConfigT* ctrlConfig = (CtlConfigT*)afb_dynapi_get_userdata(apiHandle); err = CtlConfigExec(apiHandle, ctrlConfig); if (err) { - AFB_ApiError(apiHandle, "Error at CtlConfigExec step"); + AFB_API_ERROR(apiHandle, "Error at CtlConfigExec step"); return err; } @@ -98,7 +98,7 @@ static int CtrlInitOneApi(AFB_ApiT apiHandle) // next generation dynamic API-V3 mode #include <signal.h> -static int CtrlLoadOneApi(void* cbdata, AFB_ApiT apiHandle) +static int CtrlLoadOneApi(void* cbdata, afb_api_t apiHandle) { CtlConfigT* ctrlConfig = (CtlConfigT*)cbdata; @@ -108,7 +108,7 @@ static int CtrlLoadOneApi(void* cbdata, AFB_ApiT apiHandle) // add static controls verbs int err = CtrlLoadStaticVerbs(apiHandle, CtrlApiVerbs); if (err) { - AFB_ApiError(apiHandle, "CtrlLoadSection fail to register static V2 verbs"); + AFB_API_ERROR(apiHandle, "CtrlLoadSection fail to register static V2 verbs"); return ERROR; } @@ -129,7 +129,7 @@ int afbBindingEntry(afb_dynapi* apiHandle) { AFB_default = apiHandle; - AFB_ApiNotice(apiHandle, "Controller in afbBindingEntry"); + AFB_API_NOTICE(apiHandle, "Controller in afbBindingEntry"); const char* dirList = getenv("CONTROL_CONFIG_PATH"); if (!dirList) @@ -137,27 +137,27 @@ int afbBindingEntry(afb_dynapi* apiHandle) const char* configPath = CtlConfigSearch(apiHandle, dirList, ""); if (!configPath) { - AFB_ApiError(apiHandle, "CtlPreInit: No %s* config found in %s ", GetBinderName(), dirList); + AFB_API_ERROR(apiHandle, "CtlPreInit: No %s* config found in %s ", GetBinderName(), dirList); return ERROR; } // load config file and create API CtlConfigT* ctrlConfig = CtlLoadMetaData(apiHandle, configPath); if (!ctrlConfig) { - AFB_ApiError(apiHandle, + AFB_API_ERROR(apiHandle, "CtrlBindingDyn No valid control config file in:\n-- %s", configPath); return ERROR; } if (!ctrlConfig->api) { - AFB_ApiError(apiHandle, + AFB_API_ERROR(apiHandle, "CtrlBindingDyn API Missing from metadata in:\n-- %s", configPath); return ERROR; } - AFB_ApiNotice(apiHandle, "Controller API='%s' info='%s'", ctrlConfig->api, + AFB_API_NOTICE(apiHandle, "Controller API='%s' info='%s'", ctrlConfig->api, ctrlConfig->info); // create one API per config file (Pre-V3 return code ToBeChanged) |