The main reason is allowing to run on 6LoWPAN devices, though also to
demonstrate IPv6 support with BSD Sockets in general.
Tested on 96b_carbon.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Setting just IPv4 address as was allowed before isn't enough for
real-world usage (e.g. accessing DNS and outside servers in general).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Per LwM2M spec (7.3.2.4 Operation on Object):
"If the payload (New Value) conveys an Object Instance ID in conflict
with one already present in the LwM2M Client, the complete request
MUST be rejected and a "Bad Request" error code MUST be sent back."
Let's do that.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Per LwM2M specification 7.3.2.4, "Optional Resources MAY be conveyed
in the "New Value" parameter as well; the LwM2M Client MAY ignore the
optional resources it doesn't support."
Update TLV/JSON writer to ignore error when object fields are not
found (treated as optional resource). This will allow the resources
supported being written.
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
[michael.scott@linaro.org: re-worked patch post addition of CREATE
operation.]
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Prior to this patch, a CREATE operation was handled as a WRITE operation
after the object instance was created. This becomes problematic when
handling of optional resources differs between these 2 operations.
Let's introduce an actual CREATE operation and use it later to create
these differences.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
We are returning EINVAL from content format write ops when an object
field definition is not found (an optional field which is not
implemented). Instead, return ENOENT which lets the LwM2M engine
know to send ZOAP_RESPONSE_CODE_NOT_FOUND to the LwM2M server at the
end of handle_request().
NOTE: This behavior is not correct when we call the writer right after
a CREATE operation where the data is assigned to resources for the
first time. This case will be handled in a follow-up patch once we're
able to distinguish between a WRITE and a CREATE in the write op
handler.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Esp-idf defines the BIT macro that is also defined in Zephyr's
misc/util.h. Fix the issue by including the esp-idf headers first, so
that a check in util.h won't redefine the macro if it's already
defined.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The `z` vector was not initialized in the call to
uECC_vli_nativeToBytes(), resulting in undefined behavior. Use the
properly initialized `exp_z` array instead.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Zeroing out 2*NUM_ECC_WORDS bytes starting from the `p2` pointer would
not only write 16 bytes to an 8-byte array allocated on the stack, but
also not clear out important arrays such as `_private` and `tmp`.
Moreover, no memory was cleared out before returning from the function,
and there are two exit points.
Properly memset() all private data and use an empty assembly block
referencing the memory region to avoid the memset() calls to be elided
by the compiler.
Ideally, in the future, all stack-allocated variables that contains
sensitive information should be marked with __attribute__((cleanup)), a
GCC extension that calls a function when the variable exits the scope.
This will not only reduce code size, but for other functions with
multiple exit points, also ensure that sensitive data is always
cleared.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
POSIX requires struct sockaddr's field to be named "sa_family"
(not just "family"):
http://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/socket.h.html
This change allows to port POSIX apps easier (including writing
portable apps using BSD Sockets compatible API).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
POSIX doesn't guarantee that "legacy" struct sockaddr is large enough
for all usages, e.g. IPv6 addresses, and instead requires use of
struct sockaddr_storage:
http://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/socket.h.html
... shall define the sockaddr_storage structure. This structure
shall be:
Large enough to accommodate all supported protocol-specific
address structures
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Simplify top-level table of contents and create the user guide which
includes the application development primer and other guides and
refereces instead of having them at the top-level.
Also move glossary section away from top-level TOC and remove broken
search link.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This patch adds the capability to include yaml files in other yaml
files that reside in dts/common/yaml.
Fixes#1149
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Fix controller assert due to a bug introduced in commit
07270e52ba ("Bluetooth: controller: Coding style and
refactoring").
This reverts implementation to original way it was and the
calculation of the ticker expiry will now not overflow the
range of the RTC peripheral, which is a 24 bit counter.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
net_pkt_get_reserve_data ignores the timeout parameter when in isr,
using K_NO_WAIT instead, which can lead to invalid fragment.
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
While we're working on doc publishing that separates
kernel docs that are release-specific from project docs
that aren't, (temporarily) put the security documents
here so they'll be published with the 1.9 release.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Normalizing variables names and make sure tag handling behavior, which
might be different among backends, does not make the test failing.
Also, improving debug logs in case of error.
Change-Id: Ic317948aab459bfa75c9a72ac48cb2d12a0d0706
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This exposes the CCM operations through generic Crypto API.
Change-Id: I09346e77bf8821c208305a7aa2805cf49cb42d71
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
If the encryption/decryption failed there is no need to procceed
further.
Change-Id: If450e40ed6fd601b698b74c56ae21fc7f903d087
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
'pad' parameter controls whether crc16() should add padding at the end
of input bytes or not. This allows to compute CRC16 for data stored in
non-contiguous buffers where CRC value is calculated using subsequent
calls to crc16() with padding added only for last chunk.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
This patch fixes the size and address cells yaml generation. Due to
the leading #, the yaml generation incorrectly parses the property
name. Adding quotes around the property name fixes this.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Per LwM2M specification 5.3.1 Register, report "ct=11543" when JSON is
supported. Also, report the resource type as rt="oma.lwm2m" when "ct="
presents.
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
Per LwM2M specification 5.3.1 Register. When object instances are
available, object ID can be ignored in registration message
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
According to LwM2M specification 5.2.7.3 Bootstrap DISOCVER,
security object is only reported to the bootstrap server.
Correct the behavior to (1) report server object to the server
(2) do not report security object at registration time
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
Fix checks for BT_HCI_RAW and move default range after the other range
options, required by Kconfig to avoid overwriting other options.
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
This is how it's called in the main docs, so use this same phrase in
Kconfig and samples too.
Also, added some articles to docs.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
data_addr is not guaranteed to be word-aligned so we need to read it in
a safe way, otherwise this can trigger hardfault on nRF51.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
This reverts commit e1382cc7d6.
Due to restrictive simplelink host driver source licensing.
This also reverts commits based on the simplelink wifi host
driver:
Revert "ext: simplelink: host driver: depend on multithreading"
commit: 4d912b004b
Revert "ext: simplelink: Enable SimpleLink to use Zephyr __errno"
commit: 4e022f7b28
Revert "ext: simplelink: Add SimpleLink DPL porting layer to Zephyr"
commit: 4bc51e67d4
Revert "ext: simplelink: Enable build of the SimpleLink host driver."
commit: 2d2615a49a
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
The values returned by the controller are Identity Roots and not
Identity Resolving Key. To avoid confusion, and since IRK is commonly
associated with the latter, use "ir" instead.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
In order to allow for the controller to report the RSSI of a received
Scan Request, include the field inside the Scan Request Received
Vendor-Specific Event.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The RSSI value is an 8-bit signed integer. Since the Link Layer works
only with positive unsigned integers, translate into a negative number
at the HCI layer.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>