The value of net_index in DevKeyMessageReceived() method must be set
to the value of a subnet index on which a device key encoded message
has been received. Was hard coded to 0. Fixed.
This moves the check for incoming messages addressed to fixed addresses,
e.g. RELAY, PROXY, FRIEND. If the corresponding feature is not enabled,
the message is not processed.
The network settings such as relay, beacon, proxy and friend are
always set based on local node feature settings. This change makes
the net modes initialization unconditional, to include the "No Support"
setting on node level which should result in the disabled mode in net.c
Due to the asyncronous multi-step process to send a packet on an HCI
socket, an outbound packet could be superseded before send procedure
is completed. This change ensures that at any stage in the process,
that the pointer to the packet has been fully disposed.
Adding a sonfig server model when loading from storage is unnecessary,
since the daemon-generated stored configuration always contains
config server model.
This also fixes a memory leak caused by bad parameters passed to
mesh_model_add()
This changes the order of function arguments in
mesh_config_model_binding_add() and mesh_config_model_binding_del()
to make them consistent with the rest of mesh_config_model... APIs
Model IDs for SIG defined models need to be stripped off SIG_VENDOR
value used for internal housekeeping prior to calling functions
that save new model state in node configuration.
Also, remove duplicate statements for model lookup in node config.
Config Key Refresh Phase Status is 4 octets long (see Mesh Profile
v1.0.1, section 4.3.2.60): 1 octet for status, 2 octets for net key
index, 1 octet for the phase.
Because l_queue_find can't distinguish between entry->data equal to zero
and missing entry, has_binding() fails when we bind app key with index
0, via L_UINT_TO_PTR.
Bug has been introduced in commit 1a2a6debd
Move heartbeat publication/subscription timers and housekeeping
to net.c since this is where the trigger events and control messages
are handled. Configuration server (cfgmod-server.c) stays
responsible for parsing the set pub/sub message parameters and
assemblying the pub/sub status messages.
Also, make sure that the correct message status is reported.
This modification allows using a single point for sending out
the composed status messages by the Config Server.
Also, this checks for the correct relationship between KR transition
and KR phase values. Correct error codes are sent on unsuccessful
requests and malformed requests are ignored.
This modification allows using a single point for sending out
the composed status messages by the Config Server.
Also, return Feature Not Supported errror code when credential
flag is set, but the node does not support LPN feature
This modification allows using a single point for sending out
the composed status messages by the Config Server.
Also, remove unused definitions for binding functions in node.h
This provides better functional grouping based on whether a group or
a virtual label is used for the subscription address.
Also, use a single point for sending out the composed Config Server
status messages.
Mesh Profile v1.0.1, section 4.3.2.40 Config AppKey Status
(...) The Status Code shall be Success if the received request was
redundant (add of an identical existing key, update of an identical
updated key, or delete of a non-existent key), with no further action
taken.
This fixes the extraction of bit fields from model publication
period octet received as part of Congif Publication Set message.
The step resolution field is extracted as upper 2 bits (shift by 6)
and the number of steps field is extracted by masking lower 6 bits.
When using HCI command chains, the first packet send that starts an
outbound sequence needs to still exist when command chain completes, or
the outbound queue will wedge. The simplest solution is to send packets
at least twice on an empty queue, if there is a chance it could be canceled.
This moves the model related code out of node.c to model.c providing
for better functional separation of modules.
Also, use the value of 0xFFFF for internal representation of vendor ID
for BT SIG defined models. This allows to maintain a single internal
vendor ID / model ID space.
This eliminates dynamic allocation for long responses and local
arrays for short responses. Instead, aclear text response from
config server is written into a static buffer and then encoded
into dynamically allocated messafe buffer to use in actual
transmission.
This fixes a bug that caused disallowed composition changes from being
detected and rejected. The only fields that are allowed to freely change
are CID, PID, VID and CRPL.
Mesh supports multiple Composition Pages, although only one is defined
in the current specification. This change allows saving and retrieval of
any pages, numbered 0-255.
Object path to node interfaces do not exist unless the owning
application is attached. This caused a Segmentation fault if IVIndex
change was signaled.
Crash output:
mesh/pb-adv.c:send_adv_segs() size: 01, CRC: 3e
mesh/pb-adv.c:pb_adv_packet() Link closed notification: 00
mesh/net.c:update_iv_ivu_state() iv_upd_state = IV_UPD_NORMAL
Program received signal SIGSEGV, Segmentation fault.
0xb6fbc1dc in strlen () from /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so
(gdb) backtrace
0 0xb6fbc1dc in strlen () from /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so
1 0x00448488 in l_str_hash (p=0x0) at ell/hashmap.c:168
2 0x00448980 in l_hashmap_lookup (hashmap=0x46b550, key=key@entry=0x0) at ell/hashmap.c:487
3 0x00444704 in _dbus_object_tree_property_changed (dbus=0x469438, path=0x0, interface_name=0x44bb74 "org.bluez.mesh.Node1", property_name=0x44aa18 "IVIndex") at ell/dbus-service.c:1196
4 0x0044545c in l_dbus_property_changed (dbus=<optimized out>, path=<optimized out>, interface=<optimized out>, property=<optimized out>) at ell/dbus-service.c:1804
5 0x0041805c in node_property_changed (node=<optimized out>, property=<optimized out>) at mesh/node.c:2392
6 0x0040c690 in update_iv_ivu_state (ivu=false, iv_index=0, net=0x46e240) at mesh/net.c:2569
7 process_beacon (net_ptr=0x46e240, user_data=0xbefff1e4) at mesh/net.c:2610
8 0x00431edc in l_queue_foreach (queue=<optimized out>, function=0x40c468 <process_beacon>, user_data=user_data@entry=0xbefff1e4) at ell/queue.c:441
9 0x0040a848 in beacon_recv (user_data=<optimized out>, info=<optimized out>, data=<optimized out>, len=<optimized out>) at mesh/net.c:2647
10 0x00431edc in l_queue_foreach (queue=<optimized out>, function=0x408bec <process_rx_callbacks>, function@entry=0x15463acd, user_data=user_data@entry=0xbefff230) at ell/queue.c:441
11 0x00409ec0 in process_rx (len=<optimized out>, data=0xbefff297 "+\001", addr=0xbefff258 "\260\362B", instant=4646248, rssi=-78 '\262', pvt=<optimized out>) at mesh/mesh-io-generic.c:121
12 event_adv_report (io=0x46c3c8, size=<optimized out>, buf=0xbefff255) at mesh/mesh-io-generic.c:159
13 event_callback (buf=<optimized out>, size=<optimized out>, user_data=0x46c3c8) at mesh/mesh-io- generic.c:172
14 0x0042ff58 in queue_foreach (queue=0x46d370, function=0x42f2b0 <process_notify>, user_data=user_data@entry= 0xbefff289) at src/shared/queue.c:219
15 0x0042f674 in process_event (size=<optimized out>, data=0xbefff283, hci=0x46c3d8) at src/shared/hci.c:258
16 io_read_callback (io=<optimized out>, user_data=0x46c3d8) at src/shared/hci.c:286
17 0x00432600 in io_callback (fd=<optimized out>, events=1, user_data=0x46d318) at ell/io.c:126
18 0x0043348c in l_main_iterate (timeout=<optimized out>) at ell/main.c:470
19 0x00433554 in l_main_run () at ell/main.c:520
20 l_main_run () at ell/main.c:502
21 0x004337b4 in l_main_run_with_signal (callback=<optimized out>, user_data=0x0) at ell/main.c:642
22 0x00404e90 in main (argc=<optimized out>, argv=<optimized out>) at mesh/main.c:269
(gdb)
This adds handling of new options dictionary included with
"Models" and "VendorModels" properties on org.bluez.mesh.Element1
interface.
Supported (optional) dictionary entries:
"Publish" - indicates whether the model supports publication mechanism.
If not present, publication is enabled.
"Subscribe" - indicates whether the model supports subscription mechanism.
If not present, subscriptions are enabled.
If a config message related to subscription state is received for a model
that does not support subscription mechanism, an error code 0x08,
("Not A Subscribe Model") is sent in response.
If a config message related to publication state is received for a model
that does not support publication mechanism, an error code 0x07
("Invalid Publish Parameters") is sent in response.
If a new packet for outbound delivery is queued during the last
transmission of the only other packet being sent, the prior
packet got forgotten and leaked. This fix correctly deletes the prior
packet, but also makes sure it is given the proper oportunity for
transmission.
This adds emitting of PropertiesChanged signal whenever the
mesh IV index is updated to indicate that the vlaues of "IvIndex"
property has been modified.
To import nodes, applications need just IvIndex and IvUpdate. KeyRefresh
phase in under provisioner's control, so we don't need to expose it.
Moreover, BeaconFlags property dealt just with the primary net key, and
each subnet key is refreshed separately.
We require the successful return of JoinComplete() method before
handling subsequent Attach() or Leave() method calls. To simplify the
construction of Applications, we will accept one of these calls up to 1
second prior to receiving the final return status of JoinComplete,
which tells us that the Application is ready to use the node.
If the node is still not ready after the deferral, Attach and/or Leave
will fail.
This introduces the following behavior change for those methods
on Network interface that specify node token as an input parameter
Leave() method:
If Leave method is called for a node that is being processed as a result
of a Create, Import, Join or Attach method calls in progress, node removal
is not allowed and org.bluez.mesh.Error.Busy error is returned.
Attach() method:
If Attach method is called for a node that is being processed as a result
of a Create, Import or Join method calls in progress, node attachment
is not allowed and org.bluez.mesh.Error.Busy error is returned.
This separates "Busy" and "InProgress" error codes:
MESH_ERROR_IN_PROGRESS maps to org.bluez.mesh.Error.InProgress
MESH_ERROR_BUSY maps to org.bluez.mesh.Error.Busy
Minor API change:
UpdateAppKey() returns "InProgress" error instead of "Busy"
Before the clean-up we were making a useless check of an otherwise
unused boolean (net->provisioner) to determine if we should decode with
device keys (which was incorrect). This was replaced by a check the
node type (node->provisioner). However, the check was incorrect in the
first place, and prevents provisioner nodes from decrypting non device
key messages.
During overcommit, mesh_config_save is called in asynchronous mode to
avoid blocking Send() calls. This means that update of cfg->write_time
is scheduled via l_idle_oneshot, so if the next Send() gets scheduled
first, the code may see elapsed time of zero.
If this happens, then the overcommit logic was already executed and the
overcommit is pending, so we can just return.
The folllowing functionsa are not being used anywhere in the code and
have been removed:
mesh_net_flush()
mesh_net_prov_caps_get()
mesh_net_priv_key_get()
mesh_net_priv_key_set()
mesh_net_prov_rand()
mesh_net_prov_uni()
mesh_net_id_uuid_set()
mesh_net_test_addr()
mesh_net_test_mode()
mesh_net_uni_range_set()
mesh_net_uni_range_get()
mesh_net_set_window_accuracy()
This removes callback for sending every single access layer packet
since the callback does nothing but print debug satement. This
functionality is mature enough not to require such heavy debugging.
This ensures that every time l_dbus_message_ref() is used to preserve
a message for a pending method reply, there is a matching call to
l_dbus_message_unref().
When a new node is created as a result of successful completion
of either Join() or Create() or Import() methods and has been
confirmed via successful token delivery to the application,
clean up node's D-Bus resources (application path, element paths, etc)
that have been gathered during the initial GetMAnagedObjects() call.
Also, remove the agent instance associaed with the new node.
These resources will be re-populated after the Attach() call
verifies the node's integrity.
This fixes a double-free error when destroying the NVM storage of a mesh node.
Cleanly handle two distinct scenarios:
1. When the node is being deleted at runtime. This causes release of
both dynamic memory and NVM storage.
2. During shutdown, we release dynamic memory only.
This fixes the crash that occurs when a controller used by bluetooth-meshd
is removed and then added back again.
Also, correctly restart scanning when the controller is re-enabled.
Backtrace:
0x00005618e754d040 in ?? ()
0x00005618e6e12d9a in io_ready_callback () at mesh/mesh.c:174
0x00005618e6e3d2c8 in l_queue_foreach () at ell/queue.c:441
0x00005618e6e37927 in request_complete () at src/shared/mgmt.c:261
This removes a redundant call to save node configuration in
add_local_node(): there is a number of unconditional calls to
mesh_config_write_<some_node_Setting>() within this function
which would result in the node configuration being saved implicitly.
This allows to update settings of the following composition fields
when an existing node (application) attaches to the daemon:
Company ID (CID), Product ID (PID), Versioin ID (VID),
CRPL (replay protection depth)
This modifies miscellaneous utility functions in mesh-config-json.c:
when writing a new value to a node configuration file, delete
the existing field containing an old value first.
This fixes a case when a configuration server receives a virtual
subscription add/overwrite command targeting a vendor model.
Correctly set "vendor" argument before trying to save the updated
subscrition to configuration file.
JoinComplete() dbus method calls are the only time that node tokens are
delivered to client Applications, so if the call fails for any reason
(including time-outs) the daemon has a way to clean-up the stale unused
node data.
This patch changes Import and CreateNetwork API to deliver tokens via
the JoinComplete method call. When application doesn't raise any error
during handling JoinComplete then it is assumed that the token has been
saved, otherwise when application replies with an error message then the
node is removed.
This patch fixes invalid app_path on 'Join' method call - the daemon
tried to use the value of app_root API argument, while it should use
path discovered by scanning result of GetManagedObjects() call.
When daemon receives beacon with IV=n+1, IVU=False it will
start sending messages with new IV and set sequence to 0.
However if daemon receives another beacon with IV=n+1, IVU=True it
will go back to sending messages with old IV=n (IVU set to True).
Because sequence number has been reset those messages will be dropped
by replay protection and node will lose communication.
Once IV is updated daemon should not go back to using the old value.
This patch adds beacon rejection if IV has already been updated.
- Remove application_encrypt/application_decrypt
- Make mesh_crypto_privacy_counter private, add mesh_crypto_pecb
- Make *_nonce functions private and align their implementation to be
more consistent
- Refactor network_encrypt/network_decrypt to use *_nonce functions and
rename them to packet_encrypt/packet_decrypt
- Refactor packet_encode/packet_decode
If node configuration is completely removed from the system,
remove all pending writes to the configuration file.
Fixes the segfault below:
mesh/cfgmod-server.c:node_reset() Node Reset
mesh/mesh-config-json.c:mesh_config_destroy() Delete node config /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c
mesh/util.c:del_fobject() RM /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c/rpl/00000000/0001
mesh/util.c:del_fobject() RMDIR /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c/rpl/00000000
mesh/util.c:del_fobject() RMDIR /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c/rpl
mesh/util.c:del_fobject() RM /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c/node.json.bak
mesh/util.c:del_fobject() RM /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c/node.json
mesh/util.c:del_fobject() RMDIR /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c
Segmentation fault
Program terminated with signal SIGSEGV, Segmentation fault.
0x0000563a35df2ed0 in ?? ()
0x00007fd6b131689f in json_object_to_json_string_length (jso=jso@entry=0x563a35dd8d30, flags=flags@entry=2,
Capabilities need to be zero'd before realtime reading fresh values,
because they are mostly bitmasks, which are set when capabilities are
detected, and never otherwise cleared.
As provisioner's capabilities might change during application lifetime
(e.g. no network link to download OOB key), let's query the agent again
after application calls AddNode().
The following methods are modified to allow for future development:
Interface org.bluez.mesh.Management1:
Old: void UnprovisionedScan(uint16 seconds)
New: void UnprovisionedScan(dict options)
The options parameter is a dictionary with the following keys defined:
uint16 Seconds
Specifies number of seconds for scanning to be active.
If set to 0 or if this key is not present, then the
scanning will continue until UnprovisionedScanCancel()
or AddNode() methods are called.
other keys TBD
Old: void AddNode(array{byte}[16] uuid)
New: void AddNode(array{byte}[16] uuid, dict options)
The options parameter is currently an empty dictionary
Interface org.bluez.mesh.Provisioner1
Old: void ScanResult(int16 rssi, array{byte} data)
New: void ScanResult(int16 rssi, array{byte} data, dict options)
The options parameter is currently an empty dictionary
This patch fixes usage of send_pub_status() when handling publication
set message - mod_id was swapped with pub_addr, resulting in malformed
message being sent back to the Config Client.
Provision complete callback is handled in provision failure case.
If link closed received abruptly with reason success, triggered
provision complete callback. Removed session timeout and session
free as they are handled in pb_adv_unreg.
4.4.1.2.9 of Mesh Profile Bluetooth specification:
When an element receives a Config NetKey Delete message that
identifies a NetKey that is not in the NetKey List, it
responds with Success, because the result of deleting the
key that does not exist in the NetKey List will be the same
as if the key was deleted from the NetKey List.
For added reliability, it is legal to send short messages as "single
segment" segmented messages, which require transport layer
acknowledgement. This feature is intended for heavy usage in the future
so I am adding it now.
Further, to support this functionality, an additional queue has been
added to allow multiple SAR messages to the same DST to be queued and
sent serially.
This fixes a condition when a node continues processing messages
after it has been reset by a remote configuration client.
Upon receiving Config Node Reset message, node removal happens after
a grace interval to allow sending of Config Node Reset Status reply.
This removes unused ttl parameter from mesh_model_rx(). The TTL value
is not processed at the access layer, so there is no need to pass it
to a model.
Also, remove "uint32_t dst" parameter from the typedef of
mesh_model_recv_cb: providing a just destination address is sufficient
for internally implemented models (currently, it's only Config Server)
Future versions of Mesh will introduce new advertising packets, which
do not fit in the limited and rigid filtering currently used. This minor
rewrite allows registering and receiving of *any* AD types, including
the filtering on multiple octets of the incoming AD parts.
This fixes a bug when a virtual label and its size hasn't been passed
to a decryption function: instead of always using NULL pointer for
label and 0 for lable size, use actual virtual label info if decrypting
a payload addressed to a virtual destination.
This fixes how app key files are accessed when finalizing
Key Refresh procedure. Instead of using open(entry->d_name, ...)
to get file descriptor, use openat(dir_fd, entry->d_name, ...)
since entry->d_name contains a relative app key filename, not an
absolute path.
This handles a case when a Key Refresh procedure is in place with
no application keys stored in the keyring. When KR procedure is
finalized, the check for the presence of AppKeys storage directory
does not return failure if the directory does not exist.
Also, remove duplicate include.
Re-arranged for efficiency. Replay Protection was set up as an atomic
check-and-add operation. Now we check the message early so we can
discard it without taking further action, and only add it to the RPL
once fully verified that it was authorized and addressed to us.
Mesh specification requires that Replay Protection be preserved
across node restarts. This adds that storage in
<node_uuid>/rpl/<iv_index>/<src>
Realtime access remains in an l_queue structure, and stored as
messages are processed.
Replay Protection was only being applied against Application Keys,
but messages with Device Keys are just as vulnerable, and need to be
checked as well.
Scrub of Sequence Number handling of OB messages to account for in-node
delivery of segmented messages, so that each discrete message has a
unique sequence number for the RPL.
The specification calls for a flatter Replay Protection List that
applies to all processed messages, regardless of which credentials
were used to secure them. So storage and checking is now centralized
in mesh/net.c
In Public Key OOB case, when provisioner receives public key via
OOB, provisioner has to send it's public key to remote node and
and then proceed for authentication.
Handle invalid keys case.
Provisioning agent interface methods PublicKey, PrivateKey and
Cancel do not accept any parameters. So, while invoking them
explicitly set the parameters to "".
Any packet that may be handled internally by the daemon must be sent in
it's own idle_oneshot context, to prevent multiple nodes from handling
and responding in the same context, eventually corrupting memory.
This addresses the following crash:
Program terminated with signal SIGSEGV, Segmentation fault.
0 tcache_get (tc_idx=0) at malloc.c:2951
2951 tcache->entries[tc_idx] = e->next;
(gdb) bt
0 tcache_get (tc_idx=0) at malloc.c:2951
1 __GI___libc_malloc (bytes=bytes@entry=16) at malloc.c:3058
2 0x0000564cff9bc1de in l_malloc (size=size@entry=16) at ell/util.c:62
3 0x0000564cff9bd46b in l_queue_push_tail (queue=0x564d000c9710, data=data@entry=0x564d000d0d60) at ell/queue.c:136
4 0x0000564cff9beabd in idle_add (callback=callback@entry=0x564cff9be4e0 <oneshot_callback>, user_data=user_data@entry=0x564d000d4700,
flags=flags@entry=268435456, destroy=destroy@entry=0x564cff9be4c0 <idle_destroy>) at ell/main.c:292
5 0x0000564cff9be5f7 in l_idle_oneshot (callback=callback@entry=0x564cff998bc0 <tx_worker>, user_data=user_data@entry=0x564d000d83f0,
destroy=destroy@entry=0x0) at ell/idle.c:144
6 0x0000564cff998326 in send_tx (io=<optimized out>, info=0x7ffd035503f4, data=<optimized out>, len=<optimized out>)
at mesh/mesh-io-generic.c:637
7 0x0000564cff99675a in send_network_beacon (key=0x564d000cfee0) at mesh/net-keys.c:355
8 snb_timeout (timeout=0x564d000dd730, user_data=0x564d000cfee0) at mesh/net-keys.c:364
9 0x0000564cff9bdca2 in timeout_callback (fd=<optimized out>, events=<optimized out>, user_data=0x564d000dd730) at ell/timeout.c:81
10 timeout_callback (fd=<optimized out>, events=<optimized out>, user_data=0x564d000dd730) at ell/timeout.c:70
11 0x0000564cff9bedcd in l_main_iterate (timeout=<optimized out>) at ell/main.c:473
12 0x0000564cff9bee7c in l_main_run () at ell/main.c:520
13 l_main_run () at ell/main.c:502
14 0x0000564cff9bf08c in l_main_run_with_signal (callback=<optimized out>, user_data=0x0) at ell/main.c:642
15 0x0000564cff994b64 in main (argc=<optimized out>, argv=0x7ffd03550668) at mesh/main.c:268
This allows specifying io type and options when invoking the daemon.
When no "-i" is passed, meshd still runs with MESH_IO_TYPE_GENERIC and
tries to attach to the first available HCI interface.
Options "-i <n>" and "-i hci<n>" are just shortcuts for
"--io=generic:<n>" and "--io=generic:hci<n>", respectively.
When responding with NetKey List Status, packed NetKey indices into
3 octets per pair. If number of NetKeys is odd, append the last key
index as a 2-octet value.
First valid SNB received from the network should cause the node to
switch into IV_UPD_NORMAL state.
Otherwise, it will never try to enter IV Update procedure when sequence
number approaches the IV_UPDATE_SEQ_TRIGGER, because that's only allowed
in IV_UPD_NORMAL.
After introducing "remote" flag for DevKeyMessageReceived in
c8cd5b04cc, we can now allow applications
to received DevKey messages from external addresses as well as from
local ones.
This enables applications to properly implement models using DevKey
security, by accepting only requests with "remote" flag set to false.
When a netkey is deleted all the appkeys bound to this key has
to be deleted as well. This fixes app_key queue manipulation to
avoid issues caused by modifying the queue while iterating over it:
instead of iteration over all the entries, find a first bound key,
delete it, find next... and so on, until there are no bound keys
left in the app_keys queue.
When deleting an AppKey from a node, call mesh_config_app_key_del()
only from appkey level (i.e., keep it contained in appkey.c and
remove the duplicate call in node.c)
Also, simplify the node_app_key_delete() argument list.
This patch fixes saving IV received in SNB to storage.
Previously after creating new node with IV 0 (or loading node with
IV > 0 but after long inactivity) first received SNB should update IV
(and reset sequence number to 0 if necessary).
The bug would prevent new IV being saved in storage which resulted in
sequence number being set to 0 on first SNB received after every daemon
reset but IV never being updated.
5.3.2 of Mesh Profile Bluetooth specification:
To open a link, the provisioner shall start the link establishment
timer, set to 60 seconds, and then shall start sending Link Open
messages.
On timeout, close indication will be sent. Provisioner cancels the
Link Establishment timer, when the link is open i.e. in pb_adv_tx().
This removes a roundabout logic that was required to delete
a json entry from a json array using libjsonc utilities.
A new API function, json_object_array_del_idx(), implemented in
json-c version 0.13 simplifies array entry removal to one call.
Also, add requirement to configure.ac for json-c version >= 0.13
D-Bus spec mandates that GetManagedObjects method of
org.freedesktop.DBus.ObjectManager interface returns *children* only:
https://dbus.freedesktop.org/doc/dbus-specification.html
> All returned object paths are children of the object path implementing
> this interface, i.e. their object paths start with the ObjectManager's
> object path plus '/'
Both test scripts and ELL abuse this by returning application interfaces
via ObjectManager attached to the same path, but other D-Bus
implementations do not, making Attach() fail because mandatory
interfaces cannot be found.
This patch fixes the issue by scanning hierarchy returned by
GetManagedObjects for object implementing org.bluez.mesh.Application1
interface and keeping that as node's app_path.
This adds key file with default settings for the mesh daemon.
The following settings are included:
Beacon: Default setting for to indicate whether
secure network beaconing is enabled for a
node whose Beacon state hasn't been configured
by a configuration client, i.e., this setting
apllies to a newly provisioned, created or
imported node.
Relay: Default setting for supporting relay
Friendship: Default setting for supporting Friendship
CRPL: Default depth of replay protection list.
FriendQueueSize: Default size of friend queue: the number
of messages that each Friend node can store
for the Low Power node.
ProvTimeout: Provisioning timeout in seconds.
The daemon handles multiple nodes, that may or may not be on the same
mesh network. While each node my be seperately configured to beacon or
not beacon, there is nothing gained (except redundent traffic) for each
node to beacon seperately. Beaconing is therefore centralized with the
Network Key the SNB represents, with each *received* beacon delivered
to each node. But for SNBs generated, we keep a count of how many nodes
want beacons sent for a specific key. If 1 or more, we beacon, if 0
nodes want the beacon sent, then we do not beacon.
This adds consistency checks for mandatory properties on
org.bluez.mesh.Element1 interface:
- disallow duplicate models on the same element
- disallow elements with duplicate indices
- disallow configuration server model on any element but primary