José Bollo [Thu, 21 Feb 2019 17:46:30 +0000 (18:46 +0100)]
Add support for L4Re Virtio Sockets
Change-Id: Ia47ef2fa8c650781d5a4545fa08360808291faf5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Jose Bollo [Mon, 25 Feb 2019 13:45:57 +0000 (14:45 +0100)]
globmatch: Add globmatch to wrap fnmatch
Change-Id: I1effa961a169cce444ea246f5d7f8839b4937403
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jose Bollo [Mon, 25 Feb 2019 10:27:48 +0000 (11:27 +0100)]
doc: Improve comment on asynchronous calls
Following remarks of fellow developpers, the status
the object received by the callback function
needed to be more explained.
Change-Id: I0e6bcd51849bbc5af92af08675949a901bfd683e
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jose Bollo [Thu, 21 Feb 2019 13:39:59 +0000 (14:39 +0100)]
Allow to remove libmicrohttpd (HTTP server)
This allows to remove the dependency to libmicrohttpd.
At the end, this will allow either to replace it with
an other HTTP library or to fully remove the HTTP server.
It also makes a tiny improvement of the conditionnal compilation.
Change-Id: I24106659af04453b6693f2cda0939a601391202f
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jose Bollo [Wed, 20 Feb 2019 09:07:21 +0000 (10:07 +0100)]
jobs: Add starting mode for jobs
Also improve naming of variables.
Change-Id: I8efa74e27256425df18f57b3de257c234ff60e69
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jose Bollo [Tue, 19 Feb 2019 08:13:26 +0000 (09:13 +0100)]
Allow to remove systemd library
This change allows to compile a binder
that doesn't use libsystemd.
The restriction implied is that the neither
the systemd event loop nor the systemd dbus
facilities are availables. Consequently,
the dbus transparancy of APIs isn't available.
Also the work isn't fully complete because
afb-ws-client doesn't handle the removal of
libsystemd.
A more general work still have to be made to
allow the binder to run as library using an
external event loop.
Change-Id: I27a80862868b9c5a0453011a1d8aa3ce75cb5f6e
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jose Bollo [Mon, 18 Feb 2019 14:04:38 +0000 (15:04 +0100)]
Add conditionnal support of dynamic bindings
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
Jose Bollo [Mon, 18 Feb 2019 13:31:25 +0000 (14:31 +0100)]
Add conditionnal support of bindings version 2
Bindings version 2 will become legacy soon.
This patch allows their removal
Change-Id: Iecad3abd0ddd714e5d55c0b935be756a29d1ca37
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jose Bollo [Mon, 18 Feb 2019 12:13:56 +0000 (13:13 +0100)]
Improve setting of options
Change-Id: Idbadb9b7b801cb61d527addb5d3137aeb4cf6311
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
José Bollo [Fri, 15 Feb 2019 19:49:54 +0000 (20:49 +0100)]
jobs: Refactor exiting jobs
The new termination function can allow the restart
because it doesn't abort the waiting jobs.
So after calling 'jobs_exit', all threads stop.
The function 'job_start' returns.
The threads that are in blocking state, i.e. in
a call to 'jobs_enter' or 'jobs_call' are stopped.
An error status -1 with errno=EINTR is returned in
that case.
But before returning, that function calls the exit
handler if any.
Change-Id: I85a4b1976b09b18804eb681af940531ae5ace6c3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Fri, 15 Feb 2019 16:40:04 +0000 (17:40 +0100)]
Workaround an exit issue
When running gcov the running script is
sometime blocking.
GDB tells:
Thread 1 (Thread 0x7ff14e783b40 (LWP 1318)):
#0 0x00007ff14ccf334c in __lll_lock_wait_private () from /lib64/libc.so.6
#1 0x00007ff14cc70598 in malloc () from /lib64/libc.so.6
#2 0x000000000046523a in gcov_do_dump ()
#3 0x00000000004653f4 in __gcov_exit ()
#4 0x00000000004632df in _GLOBAL__sub_D_00100_1_wrap_json_get_error_position () at ../../src/wrap-json.c:1250
#5 0x00007ff14e5b5916 in _dl_fini () from /lib64/ld-linux-x86-64.so.2
#6 0x00007ff14cc255ec in __run_exit_handlers () from /lib64/libc.so.6
#7 0x00007ff14cc2571c in exit () from /lib64/libc.so.6
#8 0x00000000004069fc in on_sigchld (signum=17, info=0x7ffc3f43fa70, uctx=0x7ffc3f43f940) at ../../src/main-afb-daemon.c:411
#9 <signal handler called>
#10 0x00007ff14cc6e527 in _int_malloc () from /lib64/libc.so.6
#11 0x00007ff14cc710a2 in calloc () from /lib64/libc.so.6
#12 0x00007ff14d454ff7 in json_object_new_int () from /lib64/libjson-c.so.4
...
It means that allocating memory in exit handlers
can block!
The work around here is to force the daemon to exit
properly, i.e., not in a signal handler, by calling hello/exit
from test script -at the very end-.
Change-Id: Iee289fb1af8479628df895aac7eb021cedda4f2c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Fri, 15 Feb 2019 16:13:38 +0000 (17:13 +0100)]
Rename afb-config to afb-args
With the introduction of more compilation flags,
it becomes interesting to use a configuration
file.
The configuration file is usually "config.h".
So that renaming avoids future ambiguity.
It also reflects better what the module does.
Change-Id: I952adc1e1bf469132dc224900bd9140ccc51c58b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Jose Bollo [Fri, 15 Feb 2019 12:41:38 +0000 (13:41 +0100)]
hooks: Allow to remove hooking (and/or trace)
This change allows to downsize the binder by
removing its internal hooking and tracing features.
Change-Id: Ifb080a7426216f6c6b1c8f8e5bf8ddd52df40a3e
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
José Bollo [Thu, 14 Feb 2019 18:43:29 +0000 (19:43 +0100)]
sig-monitor: Add compiling switches
The following new switches are added:
- USE_SIG_MONITOR_DUMPSTACK activate dump stack on error
- USE_SIG_MONITOR_SIGNALS activate handling of signals
- USE_SIG_MONITOR_FOR_CALL activate monitoring of calls
- USE_SIG_MONITOR_TIMERS activate monitoring of call expiration
All enabled by default
Change-Id: I2231e5f2a8db469b7258ce14530f72b4c5f38b00
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Wed, 13 Feb 2019 19:14:52 +0000 (20:14 +0100)]
evmgr: Isolate the event loop from jobs
The event loop is renamed evmgr for "event manager"
with the intention (1) still use evloop in jobs (2)
to provide an abstract event manager/handler/loop
abstraction.
Change-Id: Ib1955f661f98df80e1c7be99e9fe26a1e06d78f6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Thu, 14 Feb 2019 08:37:26 +0000 (09:37 +0100)]
system & jobs: Reverse link and acquiring events
- The new version of 'systemd_get_event_loop' dont depends
anymore on jobs but returns a unique systemd event loop
for any threads.
- The event loop of jobs now use system.h function instead
of the opposite.
- The function 'jobs_get_sd_event' is removed
- The function 'jobs_acquire_event_manager' is introduced.
It is designed to that the current thread can manipulate
the single event manager
Change-Id: I31fe48dfe0f2cfa4d468e49338d36fea6e7e8081
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Thu, 14 Feb 2019 09:15:40 +0000 (10:15 +0100)]
Rename afb-systemd to systemd
Files "afb-systemd.[ch]" are renamed "systemd.[ch]"
and their functions "afb_systemd_*" are renamed "systemd_*"
Change-Id: I8362a2ca8b71945b54c6ab9a7ead51d9c50bc8e2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Wed, 13 Feb 2019 16:09:05 +0000 (17:09 +0100)]
watchdog: Isolate the watchdog from jobs
Change-Id: Iaa7f71dc7e5d8d525463619b4da980c827722909
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Wed, 13 Feb 2019 13:50:34 +0000 (14:50 +0100)]
jobs: Clean unneeded code
Minor cleanup
Change-Id: Iddcaf85cdc30f74e54016ce300380b33662fbc04
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Thu, 14 Feb 2019 10:41:21 +0000 (11:41 +0100)]
coverage: Allow removal of valgrind
It can be usefull for debugging with gdb to
avoid the use of valgrind in the test.
This can be done by setting the environment
NOVALGRIND to any not empty value.
Also add more temporary files to ignore.
Change-Id: I853eb566607aa7ec87c356ee3acd9b1fa658b659
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Frederic Marec [Fri, 22 Mar 2019 10:03:44 +0000 (11:03 +0100)]
jobs: Ensure validy of event loop
In rare circumstances during intialization threads should wait instead
of using a null event loop. This is because no one has needed event loop at
this stage of initialization.
Change-Id: I05b6ddbc05bec50958d0981213219b1d641401a5
Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
José Bollo [Tue, 12 Mar 2019 12:41:48 +0000 (13:41 +0100)]
json2c: Fix a fatal warning
At the end, the case is never reached because
json_object_to_json_string_ext only produces
valid JSON strings and a string terminated by
'\' isn't a valid JSON string.
Change-Id: I58a6dc4d9c014487ff2dc85f7eb3dbf33ffea6b1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Loïc Collignon [Wed, 27 Feb 2019 16:44:37 +0000 (17:44 +0100)]
c++: Add tutorial tuto-5 for C++ class base_api_t
Added the tuto-5 that show how to benefit from the
new 'binding-object' header and its new class 'base_api_t'.
Change-Id: I81e6fd8dc5899b8e93d75530d902c0e12fba72a9
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Loïc Collignon [Mon, 21 Jan 2019 09:40:50 +0000 (10:40 +0100)]
c++: Inherit of class afb::api
Base the class afb::base_api_t on the raw wrapper
class afb::api
Change-Id: Idbc4786d548ffcb0062a85b686c196758e49823c
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Loïc Collignon [Fri, 4 Jan 2019 15:50:06 +0000 (16:50 +0100)]
c++: Add the wrapper class 'afb::api'
New 'api' wrapper for 'afb_api_t' related functions.
Change-Id: I695b65ff3d27b0ecc0f95f660a13b7a98fd92223
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Loïc Collignon [Fri, 4 Jan 2019 15:05:10 +0000 (16:05 +0100)]
c++: Reworked the event class
Added move semantic and remove invalidation method as it's not used anymore
since we drop the support of APIv2.
Change-Id: If53840010d6f24d410712915051386190f55b504
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Loïc Collignon [Fri, 4 Jan 2019 14:49:18 +0000 (15:49 +0100)]
c++: Fix multiple definition and cast
The function was defined as many time as the header was included.
Making it a weak function fix the issue.
Also, a plain old C cast is required to make this constexpr valid.
Change-Id: I278f376e00ec6728272df4fde8ca8984195dd533
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Jose Bollo [Wed, 2 Jan 2019 16:38:00 +0000 (17:38 +0100)]
c++: Add verb initialisation for C++
This new constexpr initialisation method accepts
a callback receiving a afb::req instead of a
afb_req_t.
Change-Id: I752e670b5545a9d7956987984e725b468196a6e9
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Loïc Collignon [Fri, 4 Jan 2019 14:31:02 +0000 (15:31 +0100)]
c++: Fix a wrong callback version
It used the legacy callback definition of apiv2 instead
of the apiv3 one.
Change-Id: Iab281131a923ae59cfbbb50cf72fd4a5c3f11d65
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Loïc Collignon [Fri, 4 Jan 2019 14:25:31 +0000 (15:25 +0100)]
c++: Drop support of binding APIv2
The C++ interface is currently used only in APIv3.
Change-Id: Id1a3bca5dc8e69c1af229871e7f33192395230e7
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Loïc Collignon [Fri, 4 Jan 2019 14:22:27 +0000 (15:22 +0100)]
c++: Avoid relative path when including headers
Prefer the system path to include headers.
Change-Id: I08a64e8d27808084ea4592988f36b7e5099a7fc6
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Loïc Collignon [Wed, 2 Jan 2019 16:44:27 +0000 (17:44 +0100)]
c++: New C++ API for bindings
You can implement a C++ binding API by inheriting
the templated base class 'base_api_t' and overriding
the methods you want.
At the same time, the c++ files are now located in
in their own subdirectory: afb/c++
Change-Id: Ie02535961ec6b4b5ae21390cb520acb1fdc44c9e
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
José Bollo [Thu, 7 Mar 2019 16:25:12 +0000 (17:25 +0100)]
afb-stub-ws: Allow unordered process of messages
Requests are already sequenced on need (noconcurrency
flag of bindings). Sequencing messages until their
completion has a side effect when dealing with events
and synchronous calls: event -> call -> reply locked
until event completion (see SPEC-2219).
This change could be reverted if events are converted
to jobs (see SPEC-2215).
Bug-AGL: SPEC-2219
Change-Id: Ia577bc54ba38291817fd5ed3e3dda1b67b2818b7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
ronan [Thu, 28 Feb 2019 16:05:15 +0000 (17:05 +0100)]
Fix build dep on OBS
Change-Id: I95fa03c430b9f488b3b5b9a9bdfc50a1ff0f0421
Signed-off-by: ronan <ronan.lemartret@iot.bzh>
José Bollo [Thu, 14 Feb 2019 14:25:22 +0000 (15:25 +0100)]
Upgrade dependency to libmicrohttpd version 0.9.60
The version of libmicrohttpd required is 0.9.60
at least.
Change-Id: Ia0784f5433d63d4de50654dd7577a8767578c069
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Fri, 8 Feb 2019 17:11:28 +0000 (18:11 +0100)]
stress: Improve the stress test scripts
The improvement was able to track the bug
SPEC-2163 by launching:
- ./stress-server.sh --ws --valgrind
- ./stress-clients.sh --null --count 20
Bug-AGL: SPEC-2163
Change-Id: I04634f0e98ab7a28df7c1d34ecc0d9c1faf43d57
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Fri, 8 Feb 2019 12:09:39 +0000 (13:09 +0100)]
afb-stub-ws: Fix concurrent memory issues
This changes takes care to increment the
the count of reference before using it.
Bug-AGL: SPEC-2163
Change-Id: Ia7882427eeae933eeb5030aad025ebb1da129d6f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Tue, 5 Feb 2019 08:02:02 +0000 (09:02 +0100)]
Update copyright date
Change-Id: I3aaa92b2bfb01699ee8ae609272e93032b6f1a9d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Tue, 5 Feb 2019 07:45:47 +0000 (08:45 +0100)]
Set next version of binder
Change-Id: I53c43380902f96b7a46a6a131a956965d7cf6fbc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Jose Bollo [Wed, 6 Feb 2019 16:16:09 +0000 (17:16 +0100)]
jobs: Ensure releasing event loop
The internal functions blocking threads
for implementing call_sync were not releasing
the event loop, leading to deafness of the
binder.
Include a tuto-4 that reproduce the issue
on a binder with the bug and that also shows
interesting usages of the binder.
Bug-AGL: SPEC-2161
Change-Id: I83ad4d55d721a6046e798a5e06967df4dd5a7284
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jan-Simon Moeller [Fri, 18 Jan 2019 18:28:56 +0000 (18:28 +0000)]
Merge changes from topic 'spec-2089'
* changes:
hello3: Fix warning unused variable
afb-hsrv: Avoid call to getnameinfo
jobs: Remove conditionnal REMOVE_SYSTEMD_EVENT
jobs: Separate internal threads from others
jobs: Refactor event loop handling
afb-proto-ws: Serialize incoming message
Jose Bollo [Mon, 14 Jan 2019 13:40:04 +0000 (14:40 +0100)]
hello3: Fix warning unused variable
The variable 'calling' was not used anymore.
Change-Id: I3a041cee57b2682374084003415d13a77a554fba
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
José Bollo [Sat, 5 Jan 2019 20:15:40 +0000 (21:15 +0100)]
afb-hsrv: Avoid call to getnameinfo
Calling getnameinfo may block the program
a long time (5s) when address is zero.
Bug-AGL: SPEC-2133
Change-Id: Id52b2989c5e996363fd4b6f39049f059a6ee97a2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Jose Bollo [Wed, 16 Jan 2019 16:23:40 +0000 (17:23 +0100)]
jobs: Remove conditionnal REMOVE_SYSTEMD_EVENT
The removal of the systemd event loop will be made
in later changes.
Change-Id: Ia6c52feb4969f360c31cbfc50ae991f1767f007d
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
José Bollo [Wed, 16 Jan 2019 10:57:38 +0000 (11:57 +0100)]
jobs: Separate internal threads from others
Foreign threads, that are not started by jobs,
are allowed to use synchronous jobs_call/job_leave
(directly or indirectly).
This commit ensure that those foreign thread will
neither acquire the eventloop nor execute jobs.
Includes a tiny cleanup of remain usage.
Bug-AGL: SPEC-2089
Change-Id: I2ad7fcfe2c276e34bdc4ec0c2aa3a4207bea1854
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Sun, 6 Jan 2019 09:34:12 +0000 (10:34 +0100)]
jobs: Refactor event loop handling
This improves the arbitration of the single event
loop across threads.
Before introduction of using 'evenfd' there was
several event loop. At the current time, there
is only one. At the end, there will probably
remain only one.
Bug-AGL: SPEC-2089
Change-Id: Iac9db7cbe15b4c9c76e6e9a8f6e641ed2a9039e0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Sat, 5 Jan 2019 20:08:33 +0000 (21:08 +0100)]
afb-proto-ws: Serialize incoming message
Enforce serialisation for a connection
Bug-AGL: SPEC-2089
Change-Id: Id9f261b7cc02fda78922dc511856c34b7c5bf56d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Ronan Le Martret [Wed, 16 Jan 2019 08:29:53 +0000 (09:29 +0100)]
packaging: update dependency on libmicrohttpd version
app-framework-binder dependency on libmicrohttpd version
has been set at least to 0.9.62
Change-Id: If6af70611a5cd6236068781437e4bcbd28f368b7
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
Stéphane Desneux [Sat, 5 Jan 2019 22:38:33 +0000 (22:38 +0000)]
Merge "afb-api-v3: Fix potential buffer overflow"
Jose Bollo [Fri, 4 Jan 2019 13:30:04 +0000 (14:30 +0100)]
afb-api-v3: Fix potential buffer overflow
Change-Id: I170e127ebf96d2accfdd6d6a4ec322afeaa2782f
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
José Bollo [Wed, 2 Jan 2019 19:01:44 +0000 (20:01 +0100)]
afb-binding-v3: Fix issues in includes
Fix 1: afb_api_v3_verbose doesn't exist
Fix 2: afb_api_vverbose isn't declared
Fix 3: Ensure implicit cast of "api" and "req"
Using presupposed knowledge of internals of afb_api_t
and afb_req_t is bad when dealing with implicit
conversion in C++ and is generally not the way to
go.
Change-Id: I2630faa5ea0ae315ca95e4fd6ed6ae1a0beb01a5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Jose Bollo [Thu, 3 Jan 2019 12:53:16 +0000 (13:53 +0100)]
packaging: Remove hard dependency to samples
Fixing names and number of samples in packaging
could be avoided.
Change-Id: I57355e68be45e1a4fdd6d76bcd44dea57ca63813
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jose Bollo [Mon, 31 Dec 2018 10:15:19 +0000 (11:15 +0100)]
hello3: Add verb 'after'
The verb 'after' launches a new thread
that after a delay will call a verb (like
call). The type of call can be set to 'call',
'callsync', 'subcall' or 'subcallsync'.
This allows to add test for asynchronous issues
in multithreaded environment.
Change-Id: Ic59a27b7b7fbd3716d34fdaa35c42aa9ecb7f201
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jose Bollo [Mon, 31 Dec 2018 08:59:16 +0000 (09:59 +0100)]
bindings/samples: Cleanup and tiny comment
The count of samples was too large and with
duplications. Hopefuly, removing duplications
and adding a tiny README file lowers fuzzy.
Change-Id: I55ed8f40a4f1e6e28e2a36f2819e25505246ecdd
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jose Bollo [Mon, 31 Dec 2018 08:33:01 +0000 (09:33 +0100)]
jobs: Fix a lock of call sync
Sometime the function jobs_leave missed to
wake up the process that expected the result.
It happened when that waiting thread was locked
in the epoll. That commit unlock it.
Bug-AGL: SPEC-2089
Change-Id: I6ab6a60a8c9ea3639143f282f90c7b77ed16853a
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Sebastien Douheret [Wed, 19 Dec 2018 22:19:32 +0000 (23:19 +0100)]
Remove useless %lang% prefix in yaml book file
Change-Id: I25c5efebc281f774324851372d2d074e31988847
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
José Bollo [Fri, 14 Dec 2018 17:37:14 +0000 (18:37 +0100)]
wrap-json: Upgrade to latest version
Change-Id: I3eb4e922cb5106bcf8a1ccc5e1b010bd0a60bf34
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Jose Bollo [Tue, 30 Oct 2018 13:31:33 +0000 (14:31 +0100)]
afb-hsrv: Prepare selection of listening interfaces
The listening socket will no more be the default one
but will be the selected ones, with ability to select
more than just one listening interface.
Nevertheless, the behavior is not changed at the moment.
The default interface (0.0.0.0) is still used. A further
change will add the ability to select the listening
interfaces.
That evolution depends on a fix of libmicrohttpd to
enable at the same time epoll and no-listen-fd.
Bug-AGL: SPEC-1833
Bug-AGL: SPEC-1016
Change-Id: Ia78671cbee90a243ba7b2c724b6155cffbde6920
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Wed, 12 Dec 2018 16:13:14 +0000 (17:13 +0100)]
afb-trace: Make real timestamps
The optimisation that represent the timestamp as
a fake double is not accurate in local context.
Bug-AGL: SPEC-2051
Change-Id: I285837251507a69ad210823020d0cf69ad5999f3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Clément Bénier [Wed, 12 Dec 2018 08:40:02 +0000 (09:40 +0100)]
docs: add yaml book
SPEC-1988
Change-Id: Ida94e5cf39b8c23efca9620d62ec2db55746d2b3
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Jose Bollo [Mon, 3 Dec 2018 14:16:30 +0000 (15:16 +0100)]
afb-proto-ws: Add error report
Change-Id: I58c88f8bcaf4cfb8a53b58eeefd7fa3415bf894a
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
José Bollo [Tue, 4 Dec 2018 11:05:01 +0000 (12:05 +0100)]
afb-hook: Improve reentrancy of hooking
Work on testing showed that a deadlock
was occuring in management of hooks.
Change-Id: Ib51eb4f0b9ffc5d9dfe2770f2c3f8f47f262b60f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Johann CAHIER [Wed, 28 Nov 2018 14:29:45 +0000 (15:29 +0100)]
Fix deprecation warnings for older GCC versions
For some reason, SDK doesn't display warning when AFB_BINDING_VERSION
is defined as 2.
Using #warning instead of #pragma GCC warning fixes the display.
Change-Id: I3c96b3630e0d1eac63b2fde72bdec3c7f3d1714a
Signed-off-by: Johann CAHIER <johann.cahier@iot.bzh>
Jose Bollo [Thu, 22 Nov 2018 08:03:33 +0000 (09:03 +0100)]
globset: Introduce globset for event handling
It optimises the event handling that was slow.
It also fix few bugs:
- at most one event handler is called now
- the handler call has the most specific pattern
Change-Id: Ic13a0258b5743579ab15e0e953ec62206d982850
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
José Bollo [Tue, 20 Nov 2018 08:58:50 +0000 (09:58 +0100)]
AFB.js: Tiny improvement and space fix
Change-Id: I170abe0dd1a1de3d2cc2ea7f86c746eb93e63eae
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Fri, 16 Nov 2018 18:09:22 +0000 (19:09 +0100)]
afb-socket: Fix address reuse
Change-Id: I3ae51611b92762a4f09b1f6cca6ff27853cd9f95
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Fri, 16 Nov 2018 10:37:54 +0000 (11:37 +0100)]
afb-export: Fix error in event handling
Change-Id: I2869a2a840fb07550d493ddc2d651358892d33d1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Thu, 8 Nov 2018 14:25:11 +0000 (15:25 +0100)]
main-afb-daemon: Export variables to connect to binder
Two new variables are exported that will allow
to connect to the binder:
- AFB_PORT: the HTTP port that the binder listen
- AFB_TOKEN: the initial token that the binder expects
These variables are defined only if the HTTP server
is started. They are available during initialisation
of bindings, even if it is before the real start of the
HTTP server.
Change-Id: I1b7c8572e3d77b7036a32af47b2a2f1d95803a41
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Jan-Simon Moeller [Fri, 2 Nov 2018 12:47:36 +0000 (12:47 +0000)]
Merge "afb-socket: Relax requirement of tcp ending slash"
Jan-Simon Moeller [Fri, 2 Nov 2018 12:47:36 +0000 (12:47 +0000)]
Merge "afb-socket: Handle listening on all interfaces"
José Bollo [Tue, 30 Oct 2018 15:25:54 +0000 (16:25 +0100)]
afb-socket: Relax requirement of tcp ending slash
The uri for tcp was requiring a slash (/) after the
port. This change allows to not provide that slash.
This is usefull for future implementation of HTTP
server selection.
Change-Id: I0a76d167065258d242845579b7c8728eefcc359f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Jose Bollo [Tue, 30 Oct 2018 09:54:02 +0000 (10:54 +0100)]
samples: Fix compiling error
Latest versions of libraries used doesn't
define TRUE. This fix it by using 1 instead.
Change-Id: I17db5ca34aeceab96c83143f49094fbaca74a95a
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jose Bollo [Tue, 30 Oct 2018 09:55:49 +0000 (10:55 +0100)]
afb-socket: Handle listening on all interfaces
Change-Id: I909493166f98f152e5aeb02a72f40bc3c58b42b2
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
José Bollo [Fri, 26 Oct 2018 07:16:19 +0000 (09:16 +0200)]
afb-hsrv: Adapt to next version of libmicrohttpd
Change-Id: I5bef17178e972e73b653ddbff5a8b09cfc2287eb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Loïc Collignon [Mon, 22 Oct 2018 14:44:03 +0000 (16:44 +0200)]
Added an option to color out the ouput
Enhance the readability using basic colorization to the logging system.
As the '--call' option is almost unused, it doesn't require to have a
shortname. So we use the '-c' and '--color' for the new colorization
option, and keep only the longname for the 'call' option.
Change-Id: I095fc9f38133fb742e0f0003540cd120feec8f5e
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Jose Bollo [Mon, 22 Oct 2018 10:09:58 +0000 (12:09 +0200)]
afb-session: Add language to session
Bug-AGL: SPEC-1827
Change-Id: Icfb9e2ee76186ac677ff2fbb37be28cd83dd3b6b
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jose Bollo [Sat, 20 Oct 2018 06:56:31 +0000 (08:56 +0200)]
monitoring: Fix naming of apis
The introduction of API v3 changed the API of
monitoring/tracing. This introduced a regression
of the monitoring: it wass not more possible to
filter api by name. This fix that issue.
Bug-AGL: SPEC-1828
Change-Id: Ic7f614f6c696119c7fd313e3cd252095f578c64c
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jan-Simon Moeller [Fri, 19 Oct 2018 07:52:38 +0000 (07:52 +0000)]
Merge "Make profile.d file consistent between rpm and debian"
Jose Bollo [Tue, 16 Oct 2018 17:58:03 +0000 (19:58 +0200)]
afb-apiset: Reorder priority of messages
The message before starting has now a greater
priority than the one stating that start
completed. Expecting that in case of problem
it wil be cleaner.
Change-Id: I2c27eb70f218d0492291c3eab4f8396ab5a6c093
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Sebastien Douheret [Mon, 15 Oct 2018 15:54:40 +0000 (17:54 +0200)]
Make profile.d file consistent between rpm and debian
The file /etc/profile.d/AGL-app-framework-binder.sh must have the same
name for all distro / packages, all the more that a reference of this
file is given in the online documentation:
http://docs.automotivelinux.org/docs/devguides/en/dev/
reference/host-configuration/docs/2_AGL_Application_Framework.html
Change-Id: If3bd2d87bdce7af2f625eeb9a7b230f11520b9e9
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
José Bollo [Fri, 12 Oct 2018 16:51:31 +0000 (18:51 +0200)]
AFB.html: Allow to call any verb of any API
Change-Id: I3bfff2632d5854d5885740e55f0ec38fe3214424
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Fri, 12 Oct 2018 16:41:16 +0000 (18:41 +0200)]
afb-hsrv: Lower the "no handler" message
Bored to see WARNING: Unhandled request to favicon.ico
Change-Id: I7289b508f93bcd5ac4650ec32670ed0fd291044e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Thu, 11 Oct 2018 15:37:02 +0000 (17:37 +0200)]
APIv3: Allow to write application binding
This enable a binding version 3 to declare
no API. This is used to start a job that will
will run after initialisation.
The tutorial tuto-app1 shows how. Run it with:
afb-daemon --binding tuto-app1.so
A further option could be add to close stdin
even if running in foreground, as it was the
case before.
Change-Id: I2b384d125accb4642eed8e004642ba959326878f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Fri, 12 Oct 2018 12:29:43 +0000 (14:29 +0200)]
afb-api-so-v3: Keep root API in all cases
For bindings v3, it is possible to have no
explicit default root API.
In that case, the binder creates a fake API
that references the binding itself. That api
isn't callable be it allows to emit messages,
to catch events and to call services (other
apis).
It must be kept to ensure that there is no
further error in the hypothetical case where
it is used.
Bug-AGL: SPEC-1812
Change-Id: I1a6c1e1390411a45521b9a6c1c386dc7807191df
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Wed, 10 Oct 2018 16:46:23 +0000 (18:46 +0200)]
genskel: Fix issues for C++ bindings v3
The C++ compiler is too much strict. It doesn't accept
valid C because fields are in the wrong order or missing.
- afb_verb_t generated structure invert vcbdata and session
- missing provide_class, require_class, require_api in the
afb_binding_v3 generated struct
The signature of the declared function was wrong.
- wrong verb's callback signature void fun(afb_req) instead of
void fun(afb_req_t)
This add the declaration of the (pre)initialization and onevent functions.
- missing init function signation generation, or probably preinit and
onevent (not tested those ones)
Bug-AGL: SPEC-1806
Change-Id: I1abf8a29f831ecc80458edcd3bd094b2108dc227
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Thu, 4 Oct 2018 13:44:46 +0000 (15:44 +0200)]
packaging/deb: install all headers
The previous filter wasn't installing the files
afb/afb-binding and afb/afb-binding.hpp
The packaging/rpm is modified to do the same
Change-Id: I77e31d618b9a2c6f8f8dd3f02a4219c4c8c1604f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Ronan Le Martret [Thu, 4 Oct 2018 09:03:38 +0000 (11:03 +0200)]
Fix native deb pkg install dependency
agl-app-framework-binder-bin failed to install on Ubuntu 18.04.
(libmicrohttpd is named libmicrohttpd12)
Remove hard coded libmicrohttpd dependency solve the issue.
Change-Id: Ic1e760c422a9ea1d294d1bec614aa7b134c5b042
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
José Bollo [Tue, 18 Sep 2018 09:03:23 +0000 (11:03 +0200)]
afb-export: Emit a warning on bad 'afb_require_api' call
The call to 'afb_require_api' in a preinit was forbiden
before binding v3 refactoring. Since v3 it is made possible
by deferring the requirement to the initialisation step.
But this may lead to bad behaviour if someone use the
call to test whether an api exists or not. This commit
introduce a message that could warn a developper raising
that issue.
Change-Id: Icc14c3887d70f73d87da0e664bb0e5e961867b4a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Jose Bollo [Thu, 13 Sep 2018 10:18:44 +0000 (12:18 +0200)]
afb-socket: API name cares of abstract UDS
Change-Id: Ie485672d8f66ff32ea20cb0eb313690ba380db4a
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
José Bollo [Fri, 14 Sep 2018 08:14:31 +0000 (10:14 +0200)]
afb-session: Fix an issue in managing sessions
Probably an old copy/paste error in the commit
d45426257d5149c735e33e3055220625a919e7bc
It doesn't affect version EE (Electric Eel).
Bug-AGL: SPEC-1735
Change-Id: Ia1536e141ac12275000196a3218eb62d77b36a06
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Wed, 12 Sep 2018 12:35:03 +0000 (14:35 +0200)]
CMakeLists: Use AGLVERSION if set
And default the version to the next version of AGL
pre-guppy: 6.90.0
Change-Id: I5955add9307dd2d07a071383950839f1137e7705
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Thierry Bultel [Fri, 7 Sep 2018 15:09:47 +0000 (17:09 +0200)]
afb-apiset: fixed the error message upon api open.
just a typo
Change-Id: I2963c2568cffdc89f577e99f2280da6dcb732b04
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
Jose Bollo [Thu, 6 Sep 2018 14:01:20 +0000 (16:01 +0200)]
afb-session: Use ad-hoc pseudo-random uuid
The use of the generator given by the lib uuid
implies the use of the system call 'getrandom'
without the flag GRND_NONBLOCK. It has a weird
effect on boot because many binders require
the generation of uuid at the same time but
getrandom is subject to starving.
This introduced a tiny pseudo-random generation
of UUID that does not implies the use of 'getrandom'.
Bug-AGL: SPEC-1655
Change-Id: I5131072881d7a53f0edda9e36762985c96a04550
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Jose Bollo [Thu, 6 Sep 2018 08:48:40 +0000 (10:48 +0200)]
VERSION 5.99.FFRC6
Also add newline at end of .gitreview
Change-Id: I826ecaf695a40dd883a690125fe8e2bffce1cd87
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
José Bollo [Thu, 6 Sep 2018 08:25:47 +0000 (08:25 +0000)]
Merge "main-afb-daemon: Export API after initialization"
Jose Bollo [Wed, 5 Sep 2018 12:25:50 +0000 (14:25 +0200)]
main-afb-daemon: Export API after initialization
Exporting API after initialization is a simple technic
to avoid interleaving of incoming foreign calls during
initialisation.
Also a tiny fix in jobs.c and afb-socket.c.
Bug-AGL: SPEC-1724
Change-Id: I59596256481c8afcd88755ec303bf7f881b55c12
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
CorentinLGS [Fri, 31 Aug 2018 07:39:04 +0000 (09:39 +0200)]
app-framework-binder doc: Changed doc to fit new format.
-Split book.json in 2.
-Deleted unwanted files.
-Changed all links to .html files to .md files in the SUMMARY.md,
it is used by gitbook to build the pdf and as gitbook
doesn't handle .html files I had to change it.
Change-Id: I15705ef0f0d9143971c046ccb72a4eee04b98890
Signed-off-by: CorentinLGS <corentinlgs@gmail.com>
José Bollo [Tue, 28 Aug 2018 15:15:12 +0000 (17:15 +0200)]
Allow choice to trap or not program faults
The binder traps faults by default to recover as much as
possible from unexpected errors.
Developers may need to remove that behaviour to get core file.
This introduces 2 ways to set or remove the trapping of faults:
- the environment variable AFB_TRAP_FAULTS
- the command line option --trap-faults
Both take a boolean value set using on of the following words:
1 yes true on -- enable trapping of faults (the default)
0 no false off -- disable trapping of faults
Bug-AGL: SPEC-1702
Change-Id: I6c6a3b933dbda9922a6079c390a601c533d49e55
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Jose Bollo [Mon, 27 Aug 2018 16:25:30 +0000 (18:25 +0200)]
main-afb-daemon: Set AFB_ROOTDIR and AFB_WORKDIR in environment
It may be difficult to retrieve the root directory from bindings
and from process spawn by option --exec.
In the same way, well identifying the workdir might interest
programs or bindings.
So, from now, the environment variables below are set:
- AFB_ROOTDIR: identify the rootdir as set by --rootdir
and in the context of AGL it will be the widget directory
- AFB_WORKDIR: identify the workdir as set by --workdir
To avoid any confusion, the function realpath is used to export
absolute path names.
Bug-AGL: SPEC-1694
Change-Id: Id272e009ca975e28aaab8b14fa2a98fbd2216e73
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Jose Bollo [Mon, 27 Aug 2018 11:19:19 +0000 (13:19 +0200)]
afb-hook-flags: Fix a compilation warning
Change-Id: Ic9d1cc44ef1bbf6db4afe8eb7016b05f4cddb9a4
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>