aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-08-02Fix warnings and false errorsJosé Bollo3-3/+3
Change-Id: I434a0bd6be2758fd7964bc272d63dc280d400f47 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-02afb-export: Manage path of librariesJosé Bollo9-49/+87
This change allows a binding to know its installation path. This path is retrieved using the api function 'afb_api_settings'. The path is returned --if known-- as a string of key "binding-path". Change-Id: Ie1a349dc4936d4ccf173f1f77e118099f7f0599a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-02Add ability to provide binding settingsJosé Bollo16-40/+378
Change-Id: Iab93a26340fa9743a58ca43cd903bbf31c783e5b Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-02Improve parsing of json stringJose Bollo7-25/+46
Change-Id: I7100961ef8f8a75d623a0667178f191dd4cfb9d3 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-02afb-socket: Separate socket creationJosé Bollo6-167/+321
The objective is to have a well identified and possibly reusable internally. Change-Id: Icdb6ce7d85ae26373cfe4f0b492fe97b74ed747c Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-02tic-tac-toe: improve event handlingJose Bollo1-15/+17
Change-Id: Ifba67b4b83650f9b32f78d077d0bbd3d3882238b Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-02afb-msg-json: remove obsolete functionJose Bollo3-11/+9
The function afb_msg_json_internal_error was based on the previous reply standard and was not used very much. Removing it seems a good idea. Change-Id: I3dddee9c24ffd8c43c787b9b6a737ab013d757b7 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-02afs-supervisor: Improve commentsJosé Bollo1-0/+16
Change-Id: Ic1954403e3924def8fc9fa395ac54e4c5ee6293a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-27coverage: Improve coverage testJosé Bollo19-43/+410
The test now raise an overall coverage rate: lines......: 75.4% (8356 of 11080 lines) functions..: 80.4% (1094 of 1360 functions) Also Improve the documentation and improve parts of code. Change-Id: Ic2b8bc2f85d4181aa0b358a953f95cb105a0eed9 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-27afb-export: Set API context as validatedJosé Bollo1-0/+1
An API is always valid internally to the binder. Change-Id: I3c8eed166c9cfc1bcc47daa30c8f327af777d136 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-26main-afb-client-demo: Exit with a significant codeJosé Bollo1-12/+27
The program afb-client-demo now exits whith one of the following code: 0 - everything went well, no error 1 - last received answer was an error 2 - the remote hung up the connection 3 - stdin either has too long line (16384) or has error 4 - bad argument of the command line 5 - cant connect to remote Bug-AGL: SPEC-1619 Change-Id: Ia979c9ddcdae496ce205882b895cd9742f93f365 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-25Tune dependency to fdev-epollJose Bollo3-22/+21
The dependency to fdev-epoll is not real at the moment because afb-daemon still uses systemd event loop mechanisms. At the end use of it will depend on the conditional compilation flag as REMOVE_SYSTEMD_EVENT here. Change-Id: I46e65cddafef05a9418cd4cf4d5cbf596ebeda49 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-07-25afb-api-v3: Simplify the codeJose Bollo1-11/+8
Having a code more easy to read is better here. Change-Id: I429e82d87729e41ec53d0852daa6f146261443c9 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-07-25fdev: Simplify the codeJosé Bollo2-21/+1
Less code is faster and safer. Change-Id: Ide71fec5ee80f14482e2972a3d0f65ef0b589f12 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-25coverage: Add inet's API test caseJosé Bollo2-0/+37
Change-Id: I2a08d70b655478252de48fa2071cd4682aa4192d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-25Fix some more memory leaksJose Bollo2-27/+6
While making coverage test, few leaks appeared. This corrects the last discorvered ones. Change-Id: Id9e508bc9412072b628742971b02dd3d62799f3f Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-07-25afb-config: Rewrite the config as JSON objectJosé Bollo10-1078/+1147
Despite its poor performance, this changes is good at the end because: - it allows to put config in files - it removes dirty code to translate to JSON - it removes dirty code to dump the config - it unifies code for scanning hook's flag's names - it improves unity of naming between option's names and JSON's names Change-Id: I2487c8746d78a0cff80505a12b9fa60e40da9951 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-25Fix tiny documentation bugJose Bollo2-4/+4
Change-Id: Ib11160a8137480af92c450b65039b1272084f2d6 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-07-24main-afb-daemon: Reorder instantiation of APIJosé Bollo1-6/+3
The client API are now instanciated after the server API. This allows to be client of itself but forbids to export (serve) a client API. Change-Id: I9b19180cfb60108344c2f846427e964df8339430 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-24json-c: Remove escaping of slashsJosé Bollo11-54/+89
By default json-c escapes the slashes. This is almost ugly and unuseful. But the resolution (with JSON_C_TO_STRING_NOSLASHESCAPE) was introduced lately by json-c. Integrate it as much as possible. Change-Id: Ia9c4bee78dc11df1ee9640cb04311991bd860e43 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-24coverage and test: Add testsJose Bollo21-47/+1211
coverage values: - lines: 70.5 % - functions: 76.3 % Change-Id: Iaf802e84bbfa57502bbbac8c3b567b14c01608b6 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-07-24afb-api: Define the function afb_api_is_publicJosé Bollo3-2/+8
And remove the info line setting that the API . is added. Change-Id: I42e247036b9a1016797bb2674ad95f8a8c30e9be Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-24Tiny documentation fixesJosé Bollo12-34/+33
Some english improvement of the documentation. Change-Id: I066c41d657a1921ed7dcc46dafcc7c65d122239c Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-24afb-export: Fix event handler of APIJosé Bollo1-2/+2
Change-Id: Ibadaf6f41e39cce398d33a2a2a73751d68dad34d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-19afb-config: Simplify version printflounder_5.99.2flounder/5.99.25.99.2José Bollo1-52/+45
Change-Id: Ia9fc00fbb04a27a46dd66cb60e9b359645f9dc11 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-19afb-trace: Fix bug on uuid of session's eventsJosé Bollo1-1/+1
Change-Id: I4e4c2f337ae61a3399c7c97cfd028411f1471f98 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-19afb-trace: Fix bug in session handlingJosé Bollo1-1/+1
A copy-paste error! Change-Id: Iaf7bd9f3cbd62cddfbab04fecc685f334f983175 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-19Fix errors in migration to V3José Bollo4-10/+19
Fix a tiny error in the migration script and improve it. Fix declaration of afb_daemon_get... without args for binding V3 compatibility. Fix declaration of afb_api_event_handler_... Fix the correct URL to the sed script: valid: https://git.automotivelinux.org/src/app-framework-binder/plain/docs/migration-to-binding-v3.sed invalid: https://git.automotivelinux.org/src/app-framework-binder/tree/docs/migration-to-binding-v3.sed Bug-AGL: SPEC-1595 Change-Id: I245b20a9c14634a94c69420312afbd97628bc750 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-17Set version to 5.99.FFRC3José Bollo1-1/+1
Change-Id: Ia735f23a473849d130992c32c312213533311736 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-16afb-binding: Add missing declarationsJosé Bollo1-0/+2
The functions afb_api_set_verbs_v3 and afb_api_delete_api were missing. Change-Id: Icab928984dd6620b8b3920d0406aeb3cb35c9428 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-16Simplify starting of servicesJosé Bollo9-75/+55
The previous version was confusing and was expecting that onneed and share_session were always true. Removing this parameter simplifies the code. Also handle errors of required classes and apis at initialisation. Change-Id: I7c99aa356cba41f368bd47cab797fa086a5740af Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-trace: Fix compiling error on old json-cJosé Bollo1-3/+4
Versions of json-c older than 0.12 doesn't have the function json_object_new_double_s. Change-Id: If34c36ddcfabb3796aeb6739cd150e2b3e763679 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-hook & afb-trace: Fix usage of readlinkJosé Bollo2-4/+14
The function readlink doesn't add a terminating null. This patch fixes that were needed. Change-Id: Ie15309471fe8203c8e98b97315c4ea30de3ccd75 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-binding: Fix export of "class" handlingJosé Bollo1-0/+2
The functions afb_api_require_class and afb_api_provide_class weren't exported. This commit fix that oversight. Change-Id: Ica6532bd9e06aa9003a24ae7a54b05c64be7093b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-wsj1: Fix json parsing of unterminatedJosé Bollo1-0/+2
When receiving 'false', 'true' or 1, the tokener isn't able to terminate its job without ambiguity. Catch this case to force a terminating character. Change-Id: I5c78f759852060ccf0fac87b3f6fc33a65bf30c9 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-api-v3: Fix wrong error messageJosé Bollo1-2/+3
Change-Id: Idc2d85ccf71fb7c88a3bbcf981c316b5ba70f434 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-apiset: Try to initialize all APIsJosé Bollo1-3/+4
Don't stop on the first error when initializing apis. Record the error and return it at the end. Change-Id: I1f0f50ff4e527ca5bf0e78904fccddafe54ba5f2 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-export: Monitor calls to API initialisationJosé Bollo1-19/+49
Catching SEGV or other exceptional execution error is better for the whole process. Change-Id: I0ece72abe5e0a7ebd7d29aafa416462e6e5963af Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-api-so-v2: Monitor the preinit to catch SEGVJosé Bollo1-1/+24
Add monitoring of preinitialisation of bindings v2 in the hope to better handle arbitrary code execution. Change-Id: I86354caedb17ef9d4904c1f4f47b1ea3c6dd4c40 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13main-afb-daemon: Kill child instead of itJosé Bollo1-1/+1
Killing afb-daemon when exit is called has bad side effects. Because there is no need to do it now, remove it. Change-Id: I18903bb168b1722a522cb4a78c5c8c2508483996 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-config: Fix wrong error message and more infoJosé Bollo1-3/+21
The wrong value of the log option wasn't displayed. The output of --version now prints more compile options. Change-Id: I09b8b66279a10cd4b2b6d460b3dbaeb370b3dadd Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-supervision: Remove dependency to externalJosé Bollo8-14/+23
Also some cleaning in use of extern to allow accurate grep. Removing extern is better for linking and for structuration. Change-Id: I8121c4b9b34fa2737bffd2ecbe170d04d1d60ad1 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-12Packaging: Fix RPM buildRomain Forlot1-0/+1
RPM build failed because there is an unpackaged files found which has been installed. This fix the build error: Installed (but unpackaged) file(s) found: /opt/AGL/lib64/afb/hello2.so Change-Id: Id5775966bbc4cac00d6adc8b9032d32cf41a7207 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-09main-afb-daemon: Remove call to "nice"José Bollo1-3/+0
Instead of setting the priority in the binder, delegate that responsibility of setting the priority of the process to the launcher. Bug-AGL: SPEC-1578 Change-Id: Ia6bdbdda72ce76fabc19c6448deeb62e2861dce0 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-09docs: Fix internal links by referencing html filesJosé Bollo6-58/+58
What to reference? Markdown files or HTML files? I dont like this solution but it is the least effort. Bug-AGL: SPEC-1544 Change-Id: I0d2e2c7fe1cfe769149bee3af611b04d2fe1aead Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-08coverage: Improve testingJose Bollo6-3/+68
- Add test of bindings v2 - Distinguish between clean and cleanall - More valgrind ouput Change-Id: If929756d9d35ddb959b46f7330cbf318301d532e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-08hello2: Add a binding v2 exampleJosé Bollo2-0/+553
Needed for test of bindings v2. Change-Id: I33f8b497428bf03f8f80ad26bcdec773d269f41d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-08hello3: Fix a bugJosé Bollo1-1/+0
The request was released without any need. It came from migration from v2 to v3. Change-Id: If2558ca247f0db912ce5705fa1fd98f3771dcb1f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-08afb-api-v3: Fix a bug introduced by 8ca7b69Jose Bollo1-3/+3
This bug returned a wrong OpenAPI description and produced a memory leaak. It it could be good to rewrite this part using wrap_json_pack. Change-Id: Ie0cf03e4434f8674273e9fac3c49a0f9c8196eac Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-07-08afb-cred: Fix memory leakJose Bollo1-3/+5
Change-Id: I1badca46d9e829c9b9443fce0a1e7d6a5ffad595 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>