aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-api-so.c
AgeCommit message (Collapse)AuthorFilesLines
2019-04-02Add conditionnal support of dynamic bindingsJose Bollo1-0/+3
The load of dynamic bindings becomes removable. This is a step in direction of a tiny binder library. Also refactor AGL_DEVEL Signed-off-by: Jose Bollo <jose.bollo@iot.bzh> Change-Id: If283f431fd8a831429e717b2770464cb54476dc7
2019-04-02Add conditionnal support of bindings version 2Jose Bollo1-1/+10
Bindings version 2 will become legacy soon. This patch allows their removal Change-Id: Iecad3abd0ddd714e5d55c0b935be756a29d1ca37 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2019-04-02Improve setting of optionsJose Bollo1-4/+4
Change-Id: Idbadb9b7b801cb61d527addb5d3137aeb4cf6311 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2019-02-06Update copyright datehalibut_7.90.0halibut/7.90.07.90.0José Bollo1-1/+1
Change-Id: I3aaa92b2bfb01699ee8ae609272e93032b6f1a9d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-03Improve readdirs to follow symbolic linksJose Bollo1-6/+12
The use of symbolic links can be helpful in some cases. That modification takes care of allowing symbolic links in the exploration of directories. Change-Id: I54d9004187ba5942410aca37b890cd4f6925177d Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-06-22afb-api-so: accept symbolic links for bindingsJosé Bollo1-3/+3
Change-Id: I1ef90b0f889767d04f84c8c7eb27d19c04390b15 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-06-15api-v3: First draftJosé Bollo1-29/+57
This commit introduces the bindings v3 API for bindings. The documentation has still to be improved and will come very soon. Change-Id: I8f9007370e29f671fdfd1da87fff7372a17db7af Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-02-27Update date of copyright noticesJosé Bollo1-1/+1
Change-Id: If9d7e7728df086fbb7214f1de5cbec35cd2f1d9b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-01-05afb-api-so: Exclude directories starting with .José Bollo1-0/+42
Exclude from the search of bindings any directory starting with a dot (.) by default. It is possible to reactivate the prvious behaviour by defining the following preprocessor variables - AFB_API_SO_ACCEPT_DOT_PREFIXED_DIRS When this variable is defined, the directories starting with a dot are searched except if their name is "." or ".." or ".debug" - AFB_API_SO_ACCEPT_DOT_DEBUG_DIRS When this variable is defined and the variable AFB_API_SO_ACCEPT_DOT_PREFIXED_DIRS is also defined scans any directory not being "." or "..". The previous behaviour was like difining the 2 variables, meaning that only . and .. were excluded from the search. This change is intended to definitely solve the issue SPEC-662. Yocto installed the debugging symbols in the subdirectory .debug. For example the binding.so also had a .debug/binding.so file attached. Opening that debug file made dlopen crashing. See https://sourceware.org/bugzilla/show_bug.cgi?id=22101 Bug-AGL: SPEC-662 Change-Id: Ic38a83aaa5f16d938e504aba66597bb9a219c193 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-16afb-api-so: improve error messagesJosé Bollo1-1/+1
Change-Id: I3bbf11890800a8b05c9cfaa8bd10b50a0b22c245 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Allow pure dynamic bindingsJosé Bollo1-0/+10
Activates the new internal interfaces Change-Id: I8f51cd271f66a0216ffdf03626300bb5964a70f9 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07Improve isolation of bindingsJosé Bollo1-1/+1
Adding this flag will avoid potential conflict with previously loaded bindings. Change-Id: Iae42a68fa4750d107895dc01045aac7b885759f7 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07afb-api-so: take care of SIGSEGV in dlopenJosé Bollo1-3/+32
In some case, dlopen raise a segmentation fault. This commit takes care of this. Change-Id: I6cbe59de2422dafcdf3714d0539b1757511c100b Bug-AGL: SPEC-662 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-27monitoring: improvementsJosé Bollo1-1/+1
- use flex/css for correct layout - handles disconnection nicely - handles initial token - fix typo in afb-api-so Change-Id: I386b98f9d6a2182029d39a373a9820478f97cfa6 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-26src/afb-api-so.c: fix uninitialized variableStephane Desneux1-1/+1
Change-Id: If7f576e8f4bdc613d836c158df6e5f0bbfea87b7 Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
2017-08-25afb-api-so: fix a bug in error detectionJosé Bollo1-11/+27
Error detection wasn't reported when an error occured in a subdirectory. Also closes the opened directories on error and allows a mode for ignoring binding errors. Change-Id: I34e52de8ea71bf84556878a395b56c6628cc5d9a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-22Bindings V2: Remove explicit references to daemon/serviceJosé Bollo1-10/+13
Usage shown that managing daemon interface and service interface wasn't obvious. This evolution hides the complexity by setting up an internal hidden variable. Change-Id: I667b1ee4e3a7b5ad29d712ee20ad5dd1878b97f3 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-04Prepare bindings version 2José Bollo1-1/+0
Change-Id: Ic9e417d9a36f5da08883c3ded127d8350ff893cc Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-13Introduce apiset for grouping apisJosé Bollo1-15/+15
This will be used at the end for debugging facilities. Change-Id: I75e3345667e1f58143c77a885e166375680ca194 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-04Launch job at a earlier stepJosé Bollo1-7/+0
Change-Id: I3fcb96e4d748e38eacc4d413a451143dd9b4a10d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-30Start to implement the bindings V2José Bollo1-1/+7
More work has to be done for merging common code. Change-Id: I72b01901f978854843967c12bfcb3cc59cc10310 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-29Prepare move to bindings version 2José Bollo1-289/+27
Change-Id: I3105a5898d0703d1e57eff09f179b38742482842 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-27Simplify functions for callsJosé Bollo1-3/+3
For historical reasons, the call to apis was passing the length of the api and the length of the verb. The reason was to avoid a copy of strings. But the copy occured only for HTTP requests. Having this implementation is of small interest and compromise future changes. This patch simplify things. Change-Id: I8157724c6c721b6797cd0eab52b07e1b8d6eb5f8 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-22Refactor of threading and signal monitorJosé Bollo1-7/+1
The goal is to allow use of this facilities for things that are not 'afb_req'. Change-Id: I0d99c227934ed45136477bf6235bd1541d5f05cf Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-01-03Improves naming of session's moduleJosé Bollo1-1/+1
Make names looking like other names Change-Id: I63ce3d8a3d84193eca9d517cecb1888d630a9b2d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-01-03Removes uses of readdir_rJosé Bollo1-11/+17
Since glibc 2.24, readdir_r is deprecated. Change-Id: Id0e186e67b7e60bd537a8ba85ede446be0c5095e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-01-03Adds 2017 to copyrightsJosé Bollo1-1/+1
Change-Id: Id85c4eb4e36a05b61346004ba95daa19faf5074f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-11-17afb-api-so: adds verbosity on dlopen errorJosé Bollo1-1/+1
Change-Id: Ibe42a346c29e71b12d67ebbf43a6fc8152df8202 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-10-31api-so: cleanupJosé Bollo1-5/+0
The structure monitoring is not used anymore. Change-Id: I3b900f7b109b2549f0b4cf17550bb71c4b49d32d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-10-10Threads: handles request with threadsJosé Bollo1-29/+22
This implementation handles all requests with threads. Later implementation could add a mechanism to choose what request will be handled by threads. Each API receive its requests in serial order without reentrancy. Here again, this can change in the future if a choice is possible to allow reentrant calls. The signal/event are not processed using threads in this version. It may change in the future. Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-08-31bindings: adds ability to use data of applicationsJosé Bollo1-1/+15
The two new verbs 'afb_daemon_rootdir_get_fd' and 'afb_daemon_rootdir_open_locale' allow the bindings to retrieve its installed global data. Change-Id: I369997d9e59402a413a929aa650c48613f034183 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-08-03removing casts to (void*)José Bollo1-18/+25
Change-Id: I34a4444c1fe8b9fa81c5319f53d154d6fe93916c Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-07-27fix unexpected ending spacesJosé Bollo1-2/+2
Change-Id: Ie7ebccb02b42e91457df3bdbf2a6f037b248400e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-07-07Fix bug when logging during bindings initJosé Bollo1-0/+10
Change-Id: I1901070c94c3ca7e07b167d7c769d111b02cbd64 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-06-23vocabulary: moving from 'plugin' to 'binding'José Bollo1-57/+57
Change-Id: Ic9e118df2bede1fefbb591f8ae7887266b7324ca Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-06-13minor reordering of codeJosé Bollo1-19/+23
Change-Id: I0768fa05de116f621dbb6e630dba3024e0886c6d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-06-13Service instanciationJosé Bollo1-1/+46
Adds the ability for a service to initiate calls to other services and to receive events in its own context. Change-Id: I5ff149a0231e551e9ce8a8de9658cb492a38cae1 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-06-09Events: refactoringJosé Bollo1-2/+24
This new version allows to subscribe a client for an event. The event should first be created for the API (the API's prefix is added) using 'afb_daemon_make_event'. After that, plugins can subscribe or unsubscribe their clients (identified through requests) to the events that it generates. See 'afb_req_subscribe' and 'afb_req_unsubscribe'. Events created by 'afb_daemon_make_event' can be widely broadcasted using 'afb_event_broadcast' or pushed only to suscribers using 'afb_event_push'. Events can be destroyed using 'afb_event_drop'. Change-Id: I7c0bed5e625c2052dcd81c6bfe960def1fa032f3 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-05-30applies timeout setting for apisJosé Bollo1-0/+5
Change-Id: I6ff93946990400a6e900d6d6916e2b68af92fbcc Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-05-29remove event sender interfaceJosé Bollo1-13/+3
Change-Id: I45735ccb4204821caecf89e3fdce08ec0a2471d7 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-05-27indicates the call to initialisation functionJosé Bollo1-0/+1
Change-Id: Ia2e27fa2661b539e67e388a7e9f3fc1555281bd7 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-05-24add log macros for pluginsJosé Bollo1-6/+23
Change-Id: I3de30aeb90a41ed8ee63ec1e19c6032440d65574 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-05-23fix regression of AFB_SESSION_NONEJosé Bollo1-1/+1
Change-Id: I1a03b99aa24bac7f801f94cfa0c8fd1cf28107e6 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-05-23Setting and checking LOAJosé Bollo1-2/+18
Change-Id: I02c3795c6e212491605861228eb60b731be78537 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-05-23Fix don't close session on 'create again' errorJosé Bollo1-1/+0
Change-Id: I3ea1f1d76ab111217c8a229da7443becde4ec9e6 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-05-22Fix AFB_SESSION_CREATE behaviourJosé Bollo1-2/+6
This commit allows to call methods having AFB_SESSION_CREATE at any time. This commit prepares the future LOA (level of authorization) implementation that wille soon replace the deprecated mechanism of AFB_SESSION_CREATE. Change-Id: Ia3e99186e012fcd55a6c81a7067ab5b4aca21e4d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-05-20plugin: improves error detectionJosé Bollo1-17/+25
Change-Id: Ib6b1f958c347c04a0697c2e1d8116773a5977bd4 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-05-18adds detection of wrong names for apisJosé Bollo1-0/+4
Change-Id: I5466879bc2d9a60992605bf2514f78d3121f8114 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-05-18fix naming of plugin entriesJosé Bollo1-1/+1
Change-Id: I6aa39d2a9e83b0a406aab503a051a9e5f8e96a0b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-05-17event sender: better namingJosé Bollo1-7/+7
Change-Id: I82d918cd14b1e368ef509fa3a1b21c3e55a6b98d Signed-off-by: José Bollo <jose.bollo@iot.bzh>