Parse commandline of sdbd and make use of values provided 19/15719/5
authorAleksander Zdyb <a.zdyb@partner.samsung.com>
Fri, 31 Jan 2014 11:00:45 +0000 (12:00 +0100)
committerAleksander Zdyb <a.zdyb@partner.samsung.com>
Fri, 31 Jan 2014 13:19:10 +0000 (14:19 +0100)
commit89f1249fe3462ce00f3aaa01494e4a8ba4bfade8
tree3b1ead405e21f0d6fd9a2925b1d6c2ffd907122e
parent48009389842b30fed3707b0173068d20cb62df03
Parse commandline of sdbd and make use of values provided

Settings such as emulator name or ports are no longer parsed
from /proc/cmdline. Individual ports can be now explicitly
specified and not determined by some hardcoded arithmetical logic.
An additional advantage is possibility to launch sdbd in tcp mode
on specified IP and port. Moreover running on emulator or not
is not determined at runtime, but rather passed as an option.

Available options are:
* -e, --emulator=HOST:PORT   emulator's name and forward port
* -c, --connect-to=HOST:PORT hostname or IP and port of sdb
                             listening on host (for notification)
* -s, --sensors=HOST:PORT    hostname or IP and port of sensors
                             daemon
* -l, --listen-port=PORT     port on which sdbd shall be
                             listening on

Some functions are rewritten to make use of commandline args:
* is_emulator(),
* get_emulator_forward_port(),
* get_emulator_name().

send_msg_to_localhost_from_guest() is more generic now -- accepts
hostname.

Change-Id: I498ce3688019418548dc94c55c4ea8144be8687a
Signed-off-by: Aleksander Zdyb <a.zdyb@partner.samsung.com>
Makefile
packaging/sdbd_emulator.service
src/commandline_sdbd.c [new file with mode: 0644]
src/commandline_sdbd.h [new file with mode: 0644]
src/sdb.c
src/sdb.h
src/transport_local.c
test/test_commandline_sdbd.c [new file with mode: 0644]