src/app-framework-binder.git
6 years agomain-afb-daemon: Remove call to "nice" 45/15145/1
José Bollo [Mon, 9 Jul 2018 16:30:53 +0000 (18:30 +0200)]
main-afb-daemon: Remove call to "nice"

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>
6 years agodocs: Fix internal links by referencing html files 25/15125/2
José Bollo [Mon, 9 Jul 2018 08:50:05 +0000 (10:50 +0200)]
docs: Fix internal links by referencing html files

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>
6 years agocoverage: Improve testing 11/15111/2
Jose Bollo [Fri, 6 Jul 2018 15:07:19 +0000 (17:07 +0200)]
coverage: Improve testing

- 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>
6 years agohello2: Add a binding v2 example 09/15109/2
José Bollo [Sun, 8 Jul 2018 17:00:51 +0000 (19:00 +0200)]
hello2: Add a binding v2 example

Needed for test of bindings v2.

Change-Id: I33f8b497428bf03f8f80ad26bcdec773d269f41d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agohello3: Fix a bug 07/15107/2
José Bollo [Sun, 8 Jul 2018 16:58:00 +0000 (18:58 +0200)]
hello3: Fix a bug

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>
6 years agoafb-api-v3: Fix a bug introduced by 8ca7b69 01/15101/2
Jose Bollo [Fri, 6 Jul 2018 14:11:25 +0000 (16:11 +0200)]
afb-api-v3: Fix a bug introduced by 8ca7b69

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>
6 years agoafb-cred: Fix memory leak 99/15099/2
Jose Bollo [Fri, 6 Jul 2018 13:07:08 +0000 (15:07 +0200)]
afb-cred: Fix memory leak

Change-Id: I1badca46d9e829c9b9443fce0a1e7d6a5ffad595
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
6 years agocoverage: Add valgrind diagnostics 97/15097/2
Jose Bollo [Fri, 6 Jul 2018 13:05:22 +0000 (15:05 +0200)]
coverage: Add valgrind diagnostics

Change-Id: I047f6a1946ba523776abf9f252a3938e945c8028
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
6 years agoUpdate version to 5.99.FFRC2 47/15047/2
José Bollo [Thu, 5 Jul 2018 17:15:47 +0000 (19:15 +0200)]
Update version to 5.99.FFRC2

Change-Id: I42bdaff39ac5f91c21bee4e4f9ff089ee3040a5b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoSimplify build by introducing queuing function 45/15045/2
José Bollo [Thu, 5 Jul 2018 17:12:50 +0000 (19:12 +0200)]
Simplify build by introducing queuing function

It is not valuable at the end to continue to have this
fake job implementation. So removing it is good.

Change-Id: I930ade3e3a511f0ebfb91292e5725ac3be884d44
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoRemove uses of deprecated macros 43/15043/1
José Bollo [Thu, 5 Jul 2018 15:34:11 +0000 (17:34 +0200)]
Remove uses of deprecated macros

Change-Id: I439e891d92fb34087755e68102fda97c43b5b786
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosupervision: Exclude conditionaly the supervision 41/15041/1
José Bollo [Thu, 5 Jul 2018 15:17:35 +0000 (17:17 +0200)]
supervision: Exclude conditionaly the supervision

Exclude from the binder the part related to the supervision
when the supervisor is excluded from the build.

Change-Id: I41193122d63e47b9f0db7f113f88d2d63b783027
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoSimplify build process 39/15039/1
José Bollo [Thu, 5 Jul 2018 14:27:54 +0000 (16:27 +0200)]
Simplify build process

Allows to compile all files even if it isn't
required to simplify the build process.

Change-Id: Ie09e99794aa9f57b179c7e4cfa882859958beb7a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agolocale-root: fixed uninitialized variable 21/15021/1
Thierry Bultel [Thu, 5 Jul 2018 08:21:31 +0000 (10:21 +0200)]
locale-root: fixed uninitialized variable

This has become an error since a gcc update

Change-Id: Ib49bd8c46091efdfe9483bb29a023a4e97c8db2f
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
6 years agoafb-trace: Fix bug in tracing of afb_req_get_client_info 07/15007/1
José Bollo [Wed, 4 Jul 2018 13:58:02 +0000 (15:58 +0200)]
afb-trace: Fix bug in tracing of afb_req_get_client_info

The utility wrap-json distinguishes o from O, the latest
increment the reference count, as expected.

Bug-AGL: SPEC-1563

Change-Id: I4490ac894059e47abf1e2474aab07249b862e985
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-client-demo: Fix bug that forbids interactive behaviour 05/15005/1
José Bollo [Wed, 4 Jul 2018 12:59:58 +0000 (14:59 +0200)]
afb-client-demo: Fix bug that forbids interactive behaviour

Latest change that added script compatibility
(see 1f9e60c) introduced a regression that made
afb-client-demo not useable interactively.

Bug-AGL: SPEC-1562

Change-Id: I1e0ca5caa23ee9838ba8691f384db3d0b13bd488
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-req: Fix a bug in afb_req_verbose 03/15003/1
José Bollo [Wed, 4 Jul 2018 10:23:43 +0000 (12:23 +0200)]
afb-req: Fix a bug in afb_req_verbose

The newer version of afb_req_verbose was self recursive
leading the crashes.

Bug-AGL: SPEC-1561

Change-Id: I40959e5b72ca850712c27a505e77efea43aadabd
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosaha -> salam: To continue using hello 75/14975/1
Jose Bollo [Tue, 3 Jul 2018 16:52:25 +0000 (18:52 +0200)]
saha -> salam: To continue using hello

My memory has hole and thought that saha was
hello in arabian but it is thank you.

To avoid misplaced suceptibility, i also adde shalom.

Change-Id: I493d91fe79c9ce1a2b1a0318883e2cb26a43eb87
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
6 years agodoc: Tiny improvement 73/14973/1
Jose Bollo [Tue, 3 Jul 2018 15:11:49 +0000 (17:11 +0200)]
doc: Tiny improvement

Change-Id: I3e8b0cbbe925d9536722962ed1ddc8a63cdbc08a
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
6 years agoImprove readdirs to follow symbolic links 71/14971/1
Jose Bollo [Tue, 3 Jul 2018 13:53:18 +0000 (15:53 +0200)]
Improve readdirs to follow symbolic links

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>
6 years agocoverage: Add the missing files 69/14969/1
José Bollo [Tue, 3 Jul 2018 16:42:32 +0000 (18:42 +0200)]
coverage: Add the missing files

The files weren't included due to git and gitignore.

Also add a README.md to reproduce the test.

Change-Id: Ifcdffaca32c369b2ff5fb82e246fa0cad87813f5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agocoverage: Add coverage test 23/14623/1 5.99.1 flounder/5.99.1 flounder_5.99.1
José Bollo [Fri, 22 Jun 2018 16:30:43 +0000 (18:30 +0200)]
coverage: Add coverage test

This is a first version of the coverage tests.

Change-Id: Iec2feaba12c369b2ff5fb82e246fa0cad87813f5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomain-afb-client-demo: Allow scripting 21/14621/1
José Bollo [Fri, 22 Jun 2018 16:25:25 +0000 (18:25 +0200)]
main-afb-client-demo: Allow scripting

This version allows to pipe from a script shell.

Change-Id: Ia2bb3e059b8a5a1b097178d2883ef385e7efcdca
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-autoset: Automatic prefix with unix: 19/14619/1
José Bollo [Fri, 22 Jun 2018 16:24:46 +0000 (18:24 +0200)]
afb-autoset: Automatic prefix with unix:

Change-Id: I325d768b3bdfcb313b57e1752cbc156b3735b55a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api-v3: Refactor verb description 17/14617/1
José Bollo [Fri, 22 Jun 2018 16:20:35 +0000 (18:20 +0200)]
afb-api-v3: Refactor verb description

Change-Id: Iaa1719ee2891d470f8229c6f1b98dd34265593a6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api-so: accept symbolic links for bindings 15/14615/1
José Bollo [Fri, 22 Jun 2018 16:18:31 +0000 (18:18 +0200)]
afb-api-so: accept symbolic links for bindings

Change-Id: I1ef90b0f889767d04f84c8c7eb27d19c04390b15
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agohello3: Add verbs 13/14613/1
José Bollo [Fri, 22 Jun 2018 16:00:44 +0000 (18:00 +0200)]
hello3: Add verbs

Add the following verb for testing purpose:

 - close:    close the session
 - set-loa:  set the LOA of the session
 - setctx:   set the contextual data of a session
 - setctxif: set the contextual data of a session if not already set
 - getctx:   get the contextual data of a session
 - info:     returns the info of the session

Change-Id: Ie2ceb897ecdff01f6efd0a3b174b5794913726d9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoapi-v3: Add monitoring of faults in preinit functions 11/14611/1
José Bollo [Fri, 22 Jun 2018 12:05:28 +0000 (14:05 +0200)]
api-v3: Add monitoring of faults in preinit functions

Change-Id: I0abea1aa62d86372f07f61b7c5dc2e854137f99a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-client-demo: Add option to keep running 09/14609/1
José Bollo [Fri, 22 Jun 2018 12:00:43 +0000 (14:00 +0200)]
afb-client-demo: Add option to keep running

This option allows to keep the client running
even when its input is closed. This will be used for
tests and for reporting because it allows to write:

  echo 'monitor trace {"add":{"api":"*","request":"*","event":"*","session":"*","global":"*"}}' |
  afb-client -k $WSURL > logfile

to capture all events.

Change-Id: If1c7804556190fd8ec9388260fe014c50b498b1d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoImprove documentation of api v3 89/14589/3
José Bollo [Tue, 19 Jun 2018 18:16:28 +0000 (20:16 +0200)]
Improve documentation of api v3

The documentation is improved to reflect the new version.

Tune the options

Change-Id: I894c3db3bc0c10e89db66a9a51a9ad049bb8c0c4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agopackaging: Add V3 demo files 55/14555/1
Ronan Le Martret [Wed, 20 Jun 2018 13:06:00 +0000 (15:06 +0200)]
packaging: Add V3 demo files

Change-Id: Ia9b047bf01543f7cc1c794d91bf479d9848509d3
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agopackaging: Update spec and deb packaging 43/14543/1
Ronan Le Martret [Mon, 14 May 2018 16:21:23 +0000 (18:21 +0200)]
packaging: Update spec and deb packaging

 - sort files by packaging type

Change-Id: Ic914b5eedffce04356bb59db36be30ba81a8a20d
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agoFix a warning in using readlink 37/14537/1
José Bollo [Tue, 19 Jun 2018 16:27:36 +0000 (18:27 +0200)]
Fix a warning in using readlink

The use of the same buffer as input and output of readlink
leads to warnings due to restrict use in new versions of
GLIBC

Change-Id: Ifbf1277b88bd18a9df1e18211d4248e94c16d6da
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoFix warnings due to json-c evolution 35/14535/1
José Bollo [Tue, 19 Jun 2018 16:25:34 +0000 (18:25 +0200)]
Fix warnings due to json-c evolution

The library json-c now returns size_t instead of
int when querying length of arrays.

Change-Id: Id52bb8e77da12cb01e61e1a7c7f4ae2fcbe4634e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hsrv: Add processing of type application/json 95/14495/2
jobol [Mon, 18 Jun 2018 11:10:45 +0000 (13:10 +0200)]
afb-hsrv: Add processing of type application/json

Makes the data posted as application/json directly
available through json.

The previous processing made content transmitted
with the content-type application/json available as
a string in the field of name "" of the returned
json object.

Change-Id: I11615b9b147ee4daa1b1358c2bd36fd839d8a7a9
Signed-off-by: jobol <jose.bollo@iot.bzh>
6 years agoapi-v3: First draft 63/14363/3
José Bollo [Mon, 9 Apr 2018 16:16:07 +0000 (18:16 +0200)]
api-v3: First draft

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>
6 years agojobs: Switch back to sd_event 61/14361/1
jobol [Mon, 11 Jun 2018 14:54:37 +0000 (16:54 +0200)]
jobs: Switch back to sd_event

Change-Id: I8c9de83d857844b1c5d0d2d26385dbf19fcae228
Signed-off-by: jobol <jose.bollo@iot.bzh>
6 years agoafb-trace: Restore microsecond time 59/14359/1
José Bollo [Fri, 18 May 2018 23:45:36 +0000 (01:45 +0200)]
afb-trace: Restore microsecond time

This allow to use accurately float 64 bits for times
from 1970 to 2112.

Change-Id: I8f57a57edbf5469f827c0eeb80191de934d9841e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agogitignore: Ignore netbean files from nbproject/ 57/14357/1
José Bollo [Thu, 17 May 2018 09:55:29 +0000 (11:55 +0200)]
gitignore: Ignore netbean files from nbproject/

Change-Id: Ic89f9dde8111a20e8dfc5f536ec0e731b2b49df7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoFixed spelling 55/14355/1
Sebastien Douheret [Fri, 1 Jun 2018 13:00:15 +0000 (15:00 +0200)]
Fixed spelling

Change-Id: Id7c183face3179a3b9cec7ed128e3a2561d9f3ad
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
6 years agoafb-client-demo: real raw output when --raw is set 53/14353/1
Sebastien Douheret [Fri, 1 Jun 2018 12:45:41 +0000 (14:45 +0200)]
afb-client-demo: real raw output when --raw is set

Having a 'real' raw output allows to pipe output with useful tools like jq.
For example:
 afb-client-demo 'localhost:5555/api?token=HELLO&uuid=c' hello ping | \
 jq .request.status

Change-Id: Ib871a257375bec26f315cdcdbb590033b645ac9d
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
6 years agoafb-client-demo: improved usage message 51/14351/1
Sebastien Douheret [Fri, 1 Jun 2018 12:38:11 +0000 (14:38 +0200)]
afb-client-demo: improved usage message

Change-Id: Ia529be2bf17d9bce3adfc5cb052afd724ae7bbdf
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
6 years agonetbean: update netbean config 49/14349/1
José Bollo [Thu, 17 May 2018 09:55:29 +0000 (11:55 +0200)]
netbean: update netbean config

Change-Id: I3c5e0e875cc5f16c8d366694b4a131768ab8ccd8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-client-demo: Add option -e/--echo 47/14347/1
José Bollo [Thu, 17 May 2018 09:44:09 +0000 (11:44 +0200)]
afb-client-demo: Add option -e/--echo

This option prints the command sent in the same way that it prints
the received actions.

Change-Id: I55d74f7b8645185f93e3b163cb772c8eb515fad0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agowrap-json: Update and fixes for y/Y 45/14345/1
José Bollo [Tue, 15 May 2018 07:20:44 +0000 (09:20 +0200)]
wrap-json: Update and fixes for y/Y

Change-Id: I9026f3498a4860851a41a0d5d56d1880ece75306
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hook: Factorize call to pattern matching 43/14343/1
José Bollo [Fri, 4 May 2018 10:12:30 +0000 (12:12 +0200)]
afb-hook: Factorize call to pattern matching

The pattern matching actually use fnmatch but this
could be changed in the futur to some lighter version.

Change-Id: I4f3617cd4a5bdf95988428cb184cef9e9543771d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-apiset: manage deletion of apis 41/14341/1
José Bollo [Fri, 27 Apr 2018 13:55:43 +0000 (15:55 +0200)]
afb-apiset: manage deletion of apis

Change-Id: If8b4a2b8773e5e7ce3ae62839193c611eefcb811
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hook: Refactor timestamps of hooks and trace 39/14339/1
José Bollo [Wed, 25 Apr 2018 14:48:58 +0000 (16:48 +0200)]
afb-hook: Refactor timestamps of hooks and trace

Change-Id: Iebcab280123d1f954eda3b1260d0b984ae3a98b5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Fix minor errors 37/14337/1
José Bollo [Wed, 18 Apr 2018 15:07:48 +0000 (17:07 +0200)]
jobs: Fix minor errors

Change-Id: I78aeb16fb1cf5b029fb24704d16c42152f9cc909
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years ago.gitignore: Ignore KDevelop files 35/14335/1
José Bollo [Tue, 17 Apr 2018 07:42:15 +0000 (09:42 +0200)]
.gitignore: Ignore KDevelop files

Change-Id: I832f09f44f00152bf2f1bbfc1f82bc4b7c9585e7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agowrap-json: Sync with app-afb-helpers-submodule 33/14333/1
José Bollo [Fri, 13 Apr 2018 07:53:26 +0000 (09:53 +0200)]
wrap-json: Sync with app-afb-helpers-submodule

Change-Id: Idc3360e7b96d5d9dd3fbb39ef97b3dc5d50c54bb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agowrap-json: Add base64 byte buffer support 31/14331/1
José Bollo [Thu, 12 Apr 2018 09:25:02 +0000 (11:25 +0200)]
wrap-json: Add base64 byte buffer support

Change-Id: I1c8e68b248e768b9a6f3cae712035c85b68572f9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-eventid: Fix comments 29/14329/1
José Bollo [Mon, 9 Apr 2018 12:18:46 +0000 (14:18 +0200)]
afb-eventid: Fix comments

Change-Id: I4ba49719a4776511d7f5448cd7fbf84caf7474e8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Add ws-server option 27/14327/1
José Bollo [Fri, 6 Apr 2018 22:01:33 +0000 (00:01 +0200)]
afs-supervisor: Add ws-server option

This allow exportation of the API of the supervisor.

Change-Id: I167ec94f00f40f8c3640377a46820e6a060b24f1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Switch to fdev_epoll instead of sd_event 25/14325/1
José Bollo [Fri, 23 Mar 2018 17:58:37 +0000 (18:58 +0100)]
jobs: Switch to fdev_epoll instead of sd_event

Use by default an epoll of jobs for handling HTTP and
websockets. The sd_event loop remains available (to be checked).

Change-Id: Iaaad005c9880ba1818936a93c8626490666c9eec
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agofdev: Improve fdev handling with epoll 23/14323/1
José Bollo [Fri, 23 Mar 2018 16:46:59 +0000 (17:46 +0100)]
fdev: Improve fdev handling with epoll

Change-Id: I53c6eb394772e40f87000a0e5383be923f5d15f1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Cosmetic changes 21/14321/1
José Bollo [Fri, 23 Mar 2018 13:01:09 +0000 (14:01 +0100)]
jobs: Cosmetic changes

Change-Id: I7505c3c5bcec9e2b7af645a59a3716cf9bfec552
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hsrv: remove dependency to systemd 19/14319/1
José Bollo [Fri, 23 Mar 2018 10:41:48 +0000 (11:41 +0100)]
afb-hsrv: remove dependency to systemd

Change-Id: I42428e7e57cb104b8575b60b1c7985782e9f779f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoMake DBUS transparency optional (off by default) 17/14317/1
José Bollo [Fri, 23 Mar 2018 10:16:32 +0000 (11:16 +0100)]
Make DBUS transparency optional (off by default)

The implementation of API transparency through
DBUS is not used at the moment.

To improve independancy to systemd (it relies on
systemd library) removing it should be possible.

Change-Id: I5750a92527dc3e9cf7dcd27625dce6a020797a3d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hswitch: Improve HTTP scanning of API/VERB 15/14315/1
José Bollo [Wed, 21 Mar 2018 08:40:41 +0000 (09:40 +0100)]
afb-hswitch: Improve HTTP scanning of API/VERB

The previous version wasn't accepting verbs containing
slashes (/) but the websocket did.

Some interesting use-cases are allowed by accepting to
include slashes in verbs.

Change-Id: I2786b5ed0e2686c3e68bb9b74923064d8953243c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Fix typo 13/14313/1
José Bollo [Wed, 21 Mar 2018 13:55:24 +0000 (14:55 +0100)]
afs-supervisor: Fix typo

Change-Id: Icc3c15f577f04117cdfaf2bcbcc4d15a99d02138
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoConvert pc.in from UTF-8 to US-ASCII 65/13865/2
Ronan Le Martret [Fri, 4 May 2018 16:42:26 +0000 (18:42 +0200)]
Convert pc.in from UTF-8 to US-ASCII

Change-Id: I14fd54002c6df3b3e566a9f5a61bc89b595f4e3d
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agoCMakeLists: Fix c++ build 57/13857/3
Ronan Le Martret [Thu, 3 May 2018 14:50:55 +0000 (16:50 +0200)]
CMakeLists: Fix c++ build

On debian, for example, we need to specify C14 compatibility

Change-Id: I4fd4d6dbca03d085def61e373617ab5336ebcb0b
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agofdev: Improve readability
José Bollo [Fri, 16 Mar 2018 10:37:01 +0000 (11:37 +0100)]
fdev: Improve readability

Change-Id: If81cdf43703b6ff3128ea79940ce240f56918b9d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-websock: Fix a double free
José Bollo [Thu, 15 Mar 2018 14:34:59 +0000 (15:34 +0100)]
afb-websock: Fix a double free

The commit 0ebdff94d461abd4328cf45a6281c15139a045eb of
libmicrohttpd fixed a bug but introduced a double free
of hreq resource attached to the connection. That commit
is between versions 0.9.59 and 0.9.60 of libmicrohttpd.

Now, hreq is freed in 'end_handler' of afb-hsrv.c

Change-Id: Ia865d65c5f9ef5ce787eb6545802ac8ea37ae468
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-websock: Fix double close
José Bollo [Fri, 16 Mar 2018 10:39:07 +0000 (11:39 +0100)]
afb-websock: Fix double close

Integration with newer versions of libmicrohttpd
was closing two times the file descriptor:
 - one time by the websocket within afb
 - one time by the upgrade close of libmicrohttpd

Thanks to 'autoclose' feature of 'fdev', the solution
is quiet easily.

Bug-AGL: SPEC-1345

Change-Id: Ifb691b3f69c095b5ff44bfd7f7267ea24d52df6d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoUpdate date of copyright notices
José Bollo [Tue, 27 Feb 2018 13:52:35 +0000 (14:52 +0100)]
Update date of copyright notices

Change-Id: If9d7e7728df086fbb7214f1de5cbec35cd2f1d9b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Enforce session check (for token)
José Bollo [Tue, 27 Feb 2018 08:13:59 +0000 (09:13 +0100)]
afs-supervisor: Enforce session check (for token)

Change-Id: I6fdc419923944183d12c9c931e90e276f3dc8ac6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Force reply
José Bollo [Tue, 27 Feb 2018 07:48:14 +0000 (08:48 +0100)]
afs-supervisor: Force reply

Change-Id: Iba3a80e327b4324c1bdb4f8a0e7b73021d6e4ad6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-supervision: Fix typo
José Bollo [Tue, 27 Feb 2018 07:43:35 +0000 (08:43 +0100)]
afb-supervision: Fix typo

Change-Id: Iaff0340d64b02ee24f45caadd01d74314afabacd
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Fix supervisor deafness
José Bollo [Mon, 26 Feb 2018 19:40:12 +0000 (20:40 +0100)]
afs-supervisor: Fix supervisor deafness

Change-Id: I68fc2799d1789cbcf5516539ab2af3ecd9b61e56
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Add systemd service and config
José Bollo [Mon, 26 Feb 2018 17:57:24 +0000 (18:57 +0100)]
afs-supervisor: Add systemd service and config

Change-Id: I64bf8de01dbb8cf9581ed0be358d81fa84106520
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Remove dependency to systemd
José Bollo [Mon, 26 Feb 2018 17:56:47 +0000 (18:56 +0100)]
afs-supervisor: Remove dependency to systemd

Change-Id: I74b455f569f9bf1a6e6970163fb50a946875e42d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosupervisor: Make it a HTTP server
José Bollo [Mon, 26 Feb 2018 17:09:49 +0000 (18:09 +0100)]
supervisor: Make it a HTTP server

The supervisor now run as an HTTP server by default.

Change-Id: Ia0a654cd97c941f15b212c5364d739e2196662e4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Fix bugs
José Bollo [Mon, 26 Feb 2018 13:35:00 +0000 (14:35 +0100)]
afb-session: Fix bugs

Change-Id: Ib45e2db47827b4527435a40c4b79d02fb3ab488a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: cosmetic improvements
José Bollo [Mon, 26 Feb 2018 13:32:44 +0000 (14:32 +0100)]
afb-stub-ws: cosmetic improvements

Change-Id: Ib6adf0ca4bdfee9d3da07055430bfe1974ac28bc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Add traceses for tracing sessions
José Bollo [Mon, 26 Feb 2018 12:35:43 +0000 (13:35 +0100)]
afb-config: Add traceses for tracing sessions

Change-Id: I9d36eb9eb4991066f94b1340262ad27467fc591e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomemo-supervisor: added a memo for supervisor
José Bollo [Thu, 22 Feb 2018 15:33:28 +0000 (16:33 +0100)]
memo-supervisor: added a memo for supervisor

Change-Id: I2bf91ef9b1407d1a72eea3708782836c625ebdc0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-supervision: Fix error on 'trace'
José Bollo [Thu, 22 Feb 2018 13:55:24 +0000 (14:55 +0100)]
afb-supervision: Fix error on 'trace'

Change-Id: I81c89e6c9406df583087845d6b38a19fff8ab0eb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoxreq: export a function to get req
José Bollo [Thu, 22 Feb 2018 13:54:47 +0000 (14:54 +0100)]
xreq: export a function to get req

Change-Id: Ie7eac225f514349926341b7db61ea0eb9029c5d8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agofdev: Introduce fdev for file event handling
José Bollo [Thu, 22 Feb 2018 12:22:48 +0000 (13:22 +0100)]
fdev: Introduce fdev for file event handling

This is an effort to keep cutting dependency to systemd.

Change-Id: I9a0c032a1095e297c7f3ac5b67827fda3658b8d9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-systemd: Integrate sd-fds features
José Bollo [Wed, 21 Feb 2018 15:07:56 +0000 (16:07 +0100)]
afb-systemd: Integrate sd-fds features

Change-Id: I59d194ba675912a42922f0905933b1cea796c78a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-systemd: Isolate systemd main entries
José Bollo [Wed, 21 Feb 2018 10:38:59 +0000 (11:38 +0100)]
afb-systemd: Isolate systemd main entries

This change prepares the possibilty to remove the dependency
to systemd/libsystemd.

Change-Id: Ife4181d6c7195230a11a32e527b8973af6a096e1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoBump version to 5.99-FFRC0
José Bollo [Wed, 21 Feb 2018 10:12:10 +0000 (11:12 +0100)]
Bump version to 5.99-FFRC0

Change-Id: I58829d86b871260538ce40d4be8480849d7f4b80
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-monitor: Add session and rework permissions
José Bollo [Thu, 15 Feb 2018 16:17:37 +0000 (17:17 +0100)]
afb-monitor: Add session and rework permissions

The new verb session is available to get session info and
to renew the token. See examples below.

The permission required is now just to being check
meaning having the token.

Example:

afb-client-demo -H localhost:5555/api?token=456
monitor session
ON-REPLY 1:monitor/session: OK
{
  "response":{
    "uuid":"5a30c118-319c-43a2-82d5-fc2198d01938",
    "token":"",
    "timeout":32000000,
    "remain":31999985
  },
  "jtype":"afb-reply",
  "request":{
    "status":"success",
    "uuid":"5a30c118-319c-43a2-82d5-fc2198d01938"
  }
}
monitor session {"refresh-token":true}
ON-REPLY 5:monitor/session: OK
{
  "response":{
    "uuid":"5a30c118-319c-43a2-82d5-fc2198d01938",
    "token":"2f60faf8-ad04-457e-9f56-5c0c20b5f1fc",
    "timeout":32000000,
    "remain":32000000
  },
  "jtype":"afb-reply",
  "request":{
    "status":"success",
    "token":"2f60faf8-ad04-457e-9f56-5c0c20b5f1fc"
  }
}

Change-Id: Ic93bae80616e5dad1640e73ac9f472b7b385104f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Verbs for timeout and remining time
José Bollo [Thu, 15 Feb 2018 15:51:25 +0000 (16:51 +0100)]
afb-session: Verbs for timeout and remining time

Change-Id: Ia1922187aa78d8633835c4a77e8aa533fa5d5f7d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-context: Early token change
José Bollo [Thu, 15 Feb 2018 15:50:31 +0000 (16:50 +0100)]
afb-context: Early token change

Change-Id: If27d84a702513b92f08c97ef91bf8cf89b5af238
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Fully exclude config monitoring
José Bollo [Thu, 15 Feb 2018 15:41:54 +0000 (16:41 +0100)]
afb-config: Fully exclude config monitoring

Change-Id: I93b3d49f46d4dec607b08cc439b6cb06cf68ec32
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Increase the default timeout of sessions
José Bollo [Thu, 15 Feb 2018 15:54:47 +0000 (16:54 +0100)]
afb-config: Increase the default timeout of sessions

The management of sessions is not very well understood
actually. People are using it without refreshing the token.
This has the effect that the binder closes sessions
after one hour.

So no demo can run more than one hour!

Increasing the timeout to more than one year will
solve the demo problem but will not fully solve the
overall problem.

Bug-AGL: SPEC-1296
Bug-AGL: SPEC-1293

Change-Id: Icb9adb4939a138c19be36280bf1e6643d04489ae
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Use clock insensitive to time changes
José Bollo [Thu, 15 Feb 2018 15:23:54 +0000 (16:23 +0100)]
afb-session: Use clock insensitive to time changes

Bug-AGL: SPEC-1296
Bug-AGL: SPEC-1293

Change-Id: I1838175b48dff8fbf1fd65bd304f9cfe917ced80
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Add verb for running discovery
José Bollo [Wed, 14 Feb 2018 14:18:34 +0000 (15:18 +0100)]
afs-supervisor: Add verb for running discovery

Change-Id: Iea9e54fa7a1c93ba3927c836d6ca5bcded77ca66
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Add discovery mechanic
José Bollo [Wed, 14 Feb 2018 14:12:30 +0000 (15:12 +0100)]
afs-supervisor: Add discovery mechanic

Change-Id: Icfcdcc16d0433454c9bb0785d0690f7f173980ae
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Improve name of supervisor api
José Bollo [Tue, 13 Feb 2018 11:18:49 +0000 (12:18 +0100)]
afs-supervisor: Improve name of supervisor api

Change-Id: Id0b43cecb91fa0a405c07f63d4f8c2f026c8a70c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosupervision: Add retrieval of config
José Bollo [Tue, 13 Feb 2018 10:51:14 +0000 (11:51 +0100)]
supervision: Add retrieval of config

Change-Id: Id7bb91c267037cbd36c6cafef62d3c39a67e77db
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: export config to json
José Bollo [Tue, 13 Feb 2018 10:49:02 +0000 (11:49 +0100)]
afb-config: export config to json

Change-Id: I8918733753ec791e77eb8a71032ccdb35fa68d71
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosupervision: Add supervision and supervisor
José Bollo [Thu, 29 Jun 2017 20:09:47 +0000 (22:09 +0200)]
supervision: Add supervision and supervisor

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: Fix segfault on diconection
José Bollo [Tue, 13 Feb 2018 09:26:26 +0000 (10:26 +0100)]
afb-stub-ws: Fix segfault on diconection

Change-Id: I7826b86e4d4cc921b2daaca5c8dda0fd27faae10
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: Protect against self-destruction
José Bollo [Mon, 12 Feb 2018 17:03:38 +0000 (18:03 +0100)]
afb-stub-ws: Protect against self-destruction

Change-Id: I43b15b8f675173a693816a0b8efd05fd024278f0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-trace: Add tracing of sessions
José Bollo [Mon, 12 Feb 2018 14:57:55 +0000 (15:57 +0100)]
afb-trace: Add tracing of sessions

Change-Id: Ieba4032bed526ca158dc69558177a038df95988b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Add function to enumerate sessions
José Bollo [Mon, 12 Feb 2018 13:27:46 +0000 (14:27 +0100)]
afb-session: Add function to enumerate sessions

Change-Id: Ifaa1aa02d0562c40763ac03b7c05df7f9f9c8127
Signed-off-by: José Bollo <jose.bollo@iot.bzh>