`otPlatRadioFrameUpdated()` is declared not to access any state within
OpenThread. However, the current implementation does read the extended
address. This commit moves the AES process into `Mac::TxFrame`, which
is free of `otInstance` and eliminates the current deep callback
stacks when the radio driver wants to process tx AES from interrupt
context.
Recent updates to the Thread Group Test Harness have caused 5.2.3,
5.5.2 tests to fail.
This commit:
- adds more delay interval to address the Test Harness' change in
delays
- merge Test Harness' OpenThread THCI change for updateRouterStatus
The reduction in ping delay and joinNetwork delay have caused test
5.5.2 to fail by side affects described in DEV-2008. Even though it is
a Test Harness validation issue rather than an OpenThread THCI issue,
we increase the ping & joinNetwork delay so that we have a more stable
regression environment.
Both 5.2.3 and 5.5.2 pass on Harness 2.0.0 with this commit.
This commit simplifies the `VerifyOrExit()`/`ExitNow()` failure
checks in `DatasetManager::HandleSet()` by starting the `state`
as `kReject` and setting to `kAccept` after all checks are passed.
This test verifies that address cache entry associated with a SED
child addresses is removed from new parent node ensuring we would not
have a routing loop.
This commit contains the following changes:
- Changes `TaskletScheduler` to use a circular linked list.
- Adds `Tasklet::IsPosted()` which indicates whether a tasklet
is posted or not (by checking `mNext` pointer against NULL).
- Simplifies processing of tasklets from `ProcessQueuedTasklets()`
by creating a copy of current list and clearing the main list
(this way, a newly posted tasklet would automatically trigger
a call to `otTaskletsSignalPending()`).
Add check to see if Active Timestamp already exists in the Active
Operational Dataset. If Active Timestamp exists, do not generate
Active Operational Dataset again.
This commits removes deprecated EID-to-RLOC cache if there is entry for
the unicast address registered by MTD child in case this child switches
its parent.
This commit adds helper methods in `Timer` class which cover commonly
repeated use patterns by other modules.
Method `FireAt()` allows a timer to be started with a given fire time.
`FireAtIfEarlier()` (re-)schedules the timer with a given a fire time
only if the timer is not running or if the new given fire time is
earlier than the current fire time.
Modules mle, coap, ip6-mpl, joiner-router, dns-clinet, and sntp-client
are updated to use the new methods.
Previously simple CC310 cryptographic accelerator library was used
with the glue layer using MbedTLS _ALT function substitution mechanism.
This solution wasn't well tested from a security point of view.
The new cryptographic library is built from the nrf_security project:
https://github.com/NordicPlayground/nrfxlib/tree/master/nrf_security.
It provides both CC310 libraries with MbedTLS API and special glue layers
for situations where both hardware and software implementation is used
(i.e for AES as the hardware supports only 128bit keys so software is used
for 256bit keys).
The new library is based on the CC312 codebase in a version stated
to be ready for production, however the Nordic Semiconductor ASA
port to make the code base work for CC310 devices is currently given out
in an experimental state. The new library is based on CC312 codebase
because it introduces mbed TLS integration for HW cryptographic
features in Arm CryptoCell devices.
This commit fixes an issue that indirect messages for sleepy child are
not correctly cleared in some cases.
This issue can cause sleepy nodes unable to reattach for a long time,
or even forever.
This commit adds support in NCP/spinel for clearing counters. It also
adds new `PROP_CNTR_ALL_IP_COUNTERS` property to get all IPv6
counters. All (MAC, MLE, IPv6, and NCP) counters can be cleared by
writing (`PROP_VALUE_SET` with any value) to `SPINEL_PROP_CNTR_RESET`
property. A specific subset of counters (MAC, MLE, IP) can be cleared
by writing (any value) to the corresponding spinel property
(`ROP_CNTR_ALL_MAC_COUNTERS`, `PROP_CNTR_MLE_COUNTERS`, or
`PROP_CNTR_ALL_IP_COUNTERS`).
This commit adds new method in `Mac` namely `SetTemporaryChannel()`
and `ClearTemporaryChannel()` to allow user to temporarily change the
radio channel and use a different channel (during receive) instead of
the PAN channel (from `SetPanChannel()`). A subsequent call to
`ClearTemporaryChannel()` would clear the temporary channel and adopt
the PAN channel again. The new implementation replaces and simplifies
the previous `<Acquire/Release>RadioChannel()` model.
This commit adds a helper function `Mac::GenerateRandomPanId()` which
generates a random PAN Identifier (excluding the broadcast PAN Id
`kPanIdBroadcast`).
This commit adds a new `Notifier::Update()` method which performs a
commonly used pattern in the code where a variable is updated with a
new given value and if the variable value does change a related
notifier `OT_CHANGED_<NAME>` is signaled.
Add MAC option to change number of direct TX retries:
- add member variable containing maximum number of direct TX retries
- add getter/setter methods
Add public API for direct and indirect TX retries
- otLinkGetMaxFrameRetriesDirect
- otLinkSetMaxFrameRetriesDirect
- otLinkGetMaxFrameRetriesIndirect
- otLinkSetMaxFrameRetriesIndirect
Add NCP support for direct and indirect TX retry configuration.
Rename config definition for direct and direct TX retries.
Add cli command handler for direct and indirect TX retries.
This commit add `mac_types` module which includes definitions for
different MAC types such as PanID, Address, Extended PAN Identifier,
Network Name, etc. These definitions are moved from `mac_frame` into
new the newly added files.
The TxDone callbacks can be invoked with `OT_ERROR_ABORT` from two
different paths: Either when OpenThread itself cannot prepare the tx
frame (e.g., message was removed while waiting for MAC to handle a tx
request and ask next layers to prepare the frame) or when the radio
platform itself need to abort the tx.
This commit changes the code such that in the first case, the frame
length is set to zero to mark it as empty. The empty frame helps
differentiate between the two cases and ensures that a previously tx
frame is not incorrectly used from the TxDone callbacks.
The TxDone callback handlers (in `MeshForwarder`, `DataPollHanlder`,
`IndirectSender` and `DataPollHandler` are updated to check for frame
not being empty when processing the frame.
Changes:
- Radio interface simply passes calls to platform functions
- Platform implementation for nRF52840 and nRF52833
- Placeholders for other platforms (resulting with
OT_ERROR_NOT_IMPLEMENTED)
- Spinel property configuration handlers
Method ResponsesQueue::EnqueueResponse was using
GetMatchedResponseCopy to check if matched response already exists in
the cache. The code might clone message only to release it right away,
which is not efficient.
This commit:
1. Adds a new method ResponsesQueue::FindMatchedResponse which tries
to find and return the matched response in the queue, without
cloning the message
2. Optimize EnqueueResponse by using FindMatchedResponse
3. Re-implements GetMatchedResponseCopy using FindMatchedResponse to
to reduce code redundancy.
Message ID is managed by CoAP agent. Allowing user setting it may
result in invalid usage. This commit removes this API and adds a new
API to initialize CoAP response message.
1. add new role support for border router and its 8 cases 7.1.x
2. update cases referring to Test Harness v50.x
3. for version larger than R1.4.0, not trigger saving results
web-operation since it will auto save.
4. use "python3 -m black -l 119 -S" to format harness-automation
directory
5. correct required golden device numbers
- Move updating link quality ahead of updating routes to fix potential
wrong routing path switch
- In each do-while loop, the method traverse each router id and
update the routing path to the router (RU) according to new
Route64 TLV received from the neighbor, and also update link
quality out to the neighbor (LU) when the router id is that of the
receiver. So, there could be RUs before LU and also after LU. The
RUs before LU are using wrong link quality to the neighbor for
comparison, thus could cause lower cost routing path be replaced
by higher cost routing path or even lost.
- This commit moves LU ahead of RUs to make sure all RUs are using
correct link quality to the neighbor for calculation.
- Remove the unnecessary do-while loop
- The do-while loop is unnecessary after LU is moved.
- For each RU, the calculation depends on following factors:
- F1: Routing cost to the router using current nexthop
- F2: Routing cost to the router using the neighbor as nexthop
- So, each RU is independent of each other, and all RUs can be
updated in one loop.
- Skip RU when router == neighbor is satisfied
- The original RU code actually do nothing when router == neighbor
is satisfied. Real routing updates only happen in if (router !=
neighbor) blocks.
- Logically speaking, the routing path to the neighbor can not be
updated by processing Route64 TLV from the neighbor itself.
- By skipping earlier, the code is more clear and easier to
understand.
- Replace (cost + mRouterTable.GetLinkCost(*neighbor) <=
kMaxRouteCost) with (cost + mRouterTable.GetLinkCost(*neighbor) <
kMaxRouteCost)
- Even through the routing path with cost == kMaxRotueCost can be
established, it will never be utilized in the current OT
implementation. In method MleRouter::GetNextHop, nexthop is only
used if ((routeCost + GetLinkCost(router->GetNextHop())) <
linkCost). Since linkCost <= kMaxRouteCost, nexthop with routing
path cost >= kMaxRouteCost will never be used.
- Use cost < kMaxRouteCost to indicate finite routing cost and cost
>= kMaxRouteCost to indicate infinite routing cost for consistency
This commit adds `Time` class which represents an instance of time
(it is a simple wrapper over a `uint32_t` corresponding to a
numerical time value). The `Time` class provides helpful operator
overloads:
- Operators `+` and `-` with a `Time` instance and a `Duration` to
get a `Time` instance after or before.
- Operator `-` with two `Time` instances to calculate the `Duration`
duration between two time instances.
- Operators `<`, `<=`, `>`,'>=', '==' and `!=` to compare two `Time`
instances. They correctly handle the wrapping of numeric time value.
The core modules are updated to use the new `Time` and `Duration`
types which help make the code simpler. This commit also updates the
unit test `test_timer` to add test cases for newly added types.
This commit introduces serial and BLE DFU bootloader support
* Added new linker script for serial and BLE DFU bootloaders
* Added new nRF52840 switches (BOOTLOADER_USB/UART/BLE)
* Deprecated BOOTLOADER=1 switch
If all of COMMISSIONER/JOINER/TIME_SYNC switches are not enabled and
CC310 is not disabled, RNG always produces the same values (even after
issuing a reset). This is caused by mbed TLS library which by default
uses 256 keys internally but CC310 AES module can handle only 128 bit
keys. We can enable NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT options for
all configurations to enable software implementation when keys longer
than 128 bits are used.
This commit ensures to prioritize a pending poll tx request after
handling a (direct) frame tx request. This addresses the situation
where back-to-back frame tx requests could have delayed a data poll
tx request.
Merged nrf528xx sub-directories to simplify maintenance and porting of
new nrf528xx family platforms in the future.
Crucial changes:
- Moved all source files to common 'src' directory
- Merged all *.c files and treated platform specific fragments of code
with conditional compilation
- Created simple automake file
[examples/platforms/nrf528xx/Makefile.am] that includes
conditional-include blocks
This commit updates how the `Commissioner` stores the Provisioning URL
(now saved as null terminated string). It also updates the related
APIs (including the public `otCommissionerGetProvisioningUrl`) and its
use in `NcpBase`.
This commit adds missing definitions in configure.ac to fix configure
with options like `--disable-FEATURE`. This is because some features
are enabled by default, if missing defining as `0`, the
`--disable-FEATURE` will not work.
This commit adds `Mac::NetworkName` class as C++ wrapper over the
`otNetworkName`. It also adds `NetworkName::Data` to represent the
network name as a pointer to a char array buffer (not necessarily null
terminated) with a given length. This representation is used by
`Mac::BeaconPlayload` and `MeshCop::NetworkNameTlv`. This commit also
adds a unit test for `Mac::NetworkName` class.
This commit adds a `Pskc` as a wrapper over `otPskc` and also
renames all the uses of `PSK` into `Psk` to follow our variable
and type naming convention which treats an acronym as a whole
word.
- Add a configuration flag that enables the reception of 802.15.4
radio frames by way of a hardware interrupt so that frames are not
missed whilst the CPU is busy processing something else.
- Move otPlatRadioGetPromiscuous into separate function. The only
place `readFrame` uses `aInstance` is when calling
`otPlatRadioGetPromiscuous`, which then ignores `aInstance` anyway.
So make a private function that reads the hardware register which
`readFrame` and `otPlatRadioGetPromiscuous` can call.
- Use cc2538RadioGetPromiscuous in readFrame. This allows us to drop
the problematic `aInstance` pointer. Whilst we're here, make the
function `static` since nothing else outside of `radio.c` calls it.
- Call readFrame on incoming data. If the interrupt fires, call
`readFrame` to pull that data in. When polling, also check (with the
interrupts disabled) just in case.
- Enable correct NVIC interrupt. `startup-gcc.c` enables alternate
interrupt mappings, which places the radio receive interrupt at number
26; which is in the very first register.
- Avoid debug logs in receiveFrame. If we call this method from an
interrupt handler, we want to avoid calling `snprintf` and similar
functions as these are generally not interrupt-safe. Instead, use an
extra byte of RAM to store the number of bytes dropped so we can log
it from a safe context. This is only needed when both interrupts _and_
platform logging are enabled.
This commit aims at adding the filename when die.
Other enhancements:
- Enable PLATFORM region by default for posix-app
- Disable warning for zero variadic macro arguments
- Use VerifyOrExit to implement other assert utilities
- Do not call fprintf() and print exit code in assert utility
To print dying message to stderr, add -v when launching the app.
To get the exit code, use echo $? just after the app died.
This commit fixes a crash issue triggered by system command ifconfig
down. This is because OpenThread's tries removing addresses when the
platform network interface is already down.
This commit contains the following change in `Tlv` class:
- Changes `GetSize()`, `GetValue()` and `GetNext()` to ensure they
work correctly independent of whether the TLV is an Extended TLV
or not.
- Defines a new common private static method `Tlv::Find()` which
is then used to simplify `Tlv::Get()` and `Tlv::GetOffset()` and
`Tlv::GetValueOffset()` implementations.
- This change also ensures `Tlv::Get()` (which finds and reads a
TLV of a given type within a message) work correctly for Extended
TLVs.
This commit fixes Thread Certification Test Case Router_5_7_3 where
Child Table TLV was damaged.
This commit also ensures that only Base TLV format is used.
The bug was introduced introduced in d796b0.
This commit ensures that a Child ID/Update Response message always
includes an Address Registration TLV when the Child ID/Update Request
message includes an Address Registration TLV, even when there are no
IPv6 addresses to include.
This commit reverts a change in commit 1133983.
This commit add a method to read entry from ChildTableTlv. The
GetEntry() cannot be used because the current read ChildTableTlv
operation doesn't read child table entries.
This commit updates `Mac::ExtAddress` and `Mac::Address` to add
helper methods to copy address from/to a byte array in normal or
reverse bye order. This commit also adds a unit test for the two
Address classes.
If platform uses MbedTLS feature to add entropy source during context
init (by platform entropy, HAVEGE or MBEDTLS_ENTROPY_HARDWARE_ALT) we
shouldn't add second entropy source. This saves time and power as we
don't have to poll two different entropy sources/poll same entropy
source twice.
This commit adds a `toranj` test-case. This test covers the situation
where the data poll interval is set to a value larger than child's
timeout interval. The test verifies that the sleepy child would send a
data poll within its timeout interval (ensuring that child stays in
parent's child table).
This commit changes the `DataPollSender` to ensure that a child device
will always send a data poll within its timeout interval. This
addresses an issue where a large user-specified poll period could
cause the device to adopt a poll period longer than the default child
timeout (causing parent to kick the child out of its child table).
This commit also simplifies the selection code for a new poll period
by adding a helper `UpdateIfLarger()` method to update the period only
if it's larger than a given new value.
This commit changes the `NetworkDiagnostic::FillRequestedTlvs()` to
directly use the child timeout value in appended `TimeoutTlv`. This
addresses an issue where a user-specified long data poll interval
could cause the timeout TLV in diags response to be set higher than
actual child's timeout value.
This commit removes the extra check remaining from before the change
from #3785 and the related follow-ups. Before having the "Acked with
FP" feature, we relied on number of indirect msg in queue (for the
child) or state of src-match-table to determine/guess if the data poll
was acked with fp or not. That is now redundant and can be incorrect
(e.g., if a message was removed/evicted after data poll was acked with
fp set).
If the data poll is acked with "frame pending" flag set, the child
would stay in rx expecting a frame from parent. If we have no frame
for the child, parent would send an empty frame to let the child know
that it can go to sleep (and avoid the child having a data timeout and
retx the data poll).
This change is required for new platform abstractions like Thread over
BLE (ToBLE) where we may not have the ack or frame-pending notion at
the link layer and rely on next layer to follow a "data poll" with
empty frame (when there is no pending frame).
The commit addresses the issue that running "commissioner start"
command when device role is detached will cause commissioner not be
able to start or stop.
Reasons for this the change:
- Namespace/scope variables under Mac class only.
- Allow us in future to potentially break mac.cpp into multiple files
(e.g. mac_ftd?).
Test Case 8.1.1 on cc2538 OT TB has a fail probability of 19% due to
DTLS handshake failure. This commit fixes this issue by increasing
heap size by 128B (6144B -> 6272B), resulting in 100% Pass.
This commit fixes a bug where setXpanId might raise exception when
called with xPanId of length 16.
This commit also renames __convertLongToString to __convertLongToHex
to better reflect its functionality and optimizes its implementation.
This commit provides a simple implementation of app_error_handler(),
which resolves the link error with DEBUG=1.
This commit also adds DEBUG=1 flag in CI tests of nrf52840 platform to
prevent this error from happening again.
This commit updates MLE to continue to process a repeated
"Parent Response" from current parent candidate to ensure that the
challenge and frame counter are correctly updated.
* Simplified posix-app logging
* typedef otLogLevel to signed int so that when dynamic logging and
reference_device is enabled, there will not be always true error.
This commit changes the `SubMac::BeginTrasnmit()` by moving the call
to `Transmit()` on radio platform after the state change to
`kStateTransmit` (and pcap callback). This relaxes the requirement for
radio platform implementation and allow it to invoke `TxDone` callback
directly from the `Transmit()` call itself (instead of requiring
`TxDone` to be called only after the `Transmit()` call returns).
This commit introduces a new API call otHeapSetCAllocFree
The API is available to the application from `heap.h` header and is
enabled when `EXTERNAL_HEAP` common switch is set. The call must be
invoked before the OpenThread instance is initialized.
This allows the OpenThread to use an external heap for allocation, for
example from FreeRTOS.
This commit makes it easier to OpenThread POSIX-app as a library.
* Remove ot prefix from non-public platform-specific APIs.
* Avoid main() calls non-public platform APIs.
* Parse arguments outside of POSIX-app library.
* Add option to log to stderr.
* Add LOG_OUTPUT flag
* Delete assert() in RadioSpinel::Receive()
This commit combines the pretty checks between C/C++ and python into
one job to reduce the number of jobs and save Travis time overall.
This commit also moves pretty check and size report logic from Travis
scripts into a separate script to improve overall usability and
maintainability.
This commit removes an assumption in the border agent that COM_PET.rsp
from the leader 1is CHANGED. It is possible for the leader to return
a 4.XX error response. In that case, the border agent should forward
the error response.
Thread defines a mesh-local scope for IPv6 unicast addresses. However,
the mesh-local scope can only be inferred by inclusion of the
mesh-local prefix.
This commit updates the IPv6 source address selection to infer the
destination address scope based on a prefix match with currently
assigned addresses.
Added a fallback to the efr32mg12 where if an alarm set with an
absolute expiry time (t0 + dt) has failed to start then we fallback to
using a relative timer (dt).
It has been observed in testing that alarms have stopped working on
the efr32mg12. This has caused other issues such as buffers not being
freed or the network splitting as no further alarms are scheduled.
The cause is due to an alarm being set to expire slightly in the
past. In this case we fallback to using a relative timer using only
the dt value. For the cases where it fails it will be set to 1ms into
the future from the time the RAIL_SetTimer is called.
RAIL maintains time in microseconds but is being rounded down for the
time returned in milliseconds by otPlatAlarmMilliGetNow. We used a 1ms
minimum delta to ensure that the absolute time would be in the next
millisecond but this could still fail. We therefore use a relative
timer in this case which on the cases where it fails should be 1ms
ahead of current time.
This commit ensures to save the network info in non-volatile settings
when the MLE device mode is changed (`Mle::SetDevcieMode()`)
independent of whether the device is currently attached or not. This
helps address the situation where there is a single router/leader
device in network and user changes the MLE thread mode to make it a
sleepy (where due to device being the only node in the network it
would not attach). Then, later upon device reset (without the change
in this commit) the device would have started again as router/leader.
Note that network info is saved/updated in non-volatile memory after a
successful attach.
This commit updates helper error message in `core-config-check.h`
file and adds some of the missing changed config option. It also adds
a comment to indicate that error message is intended as a hint to
what the new configuration parameter name may be.
This commit removes the unused duplicate definition in `tmf.h` for
`OPENTHREAD_CONFIG_INFORM_PREVIOUS_PARENT_ON_REATTACH` (this is
defined in `config/mle.h`). Also updates the comment/documentation
for `DHCP6_SERVER_NUM_PREFIXES` and `JOINER_MAX_CANDIDATES`.
The new model handles the case where frame retries are not handled
by sub-mac layer (e.g., delegated to radio platform).
This helps improve the log message in posix-app model where the retx
is handled by the RCP and not on the host side.
This commit adds a `Radio::Callback` class which provides all the
callbacks (as C++ methods) mirroring the radio platform layer
callbacks (including the diags related radio callbacks).
This commit adds a a `Radio` class which provides all `otPlatRadio`
platform APIs (as C++ methods). All OT core modules use the new
`Radio` methods to interact with radio platform APIs.
This commit renames existing `phy` folder into `radio`. It also
renames some of the related files in this folder. It also moves
all default/weak `otPlatRadio` implementations to a common
`radio_platform_defaults.cpp` file.
* Removed assert if RAIL_StartTx() fails. It will report the error and continue
* Updated Makefile.am to fix missing header and prettified radio.c
* Added OPENTHREAD_CONFIG_NCP_UART_ENABLE to efr32mg12 config
This commit fixes the problem with initializing the NCP with
wpantund. The bug was apparent when the NCP image was built with the
FULL_LOGS switch set.
The reason for the bug was that after the pseudo reset the OpenThread
stack wrote logs to NCP's otPlatLog implementation that used the not
yet initialized NCP object. This put the mUartSendTask and
mUpdateChangedPropsTask to the TaskletScheduler linked list.
Later when the NCP itself was initialized, the mNext pointer in the
tasklets mUartSendTask and mUpdateChangedPropsTask was set to null,
causing all tasklets scheduled after the mUartSendTask to be lost. The
NCP reset status could not be in such case sent to the wpantund. The
wpantund then retried resetting the NCP, which repeated the process
until the wpantund gave up.
This commit changes data poll handler to log an indirect tx failure
only when the tx attempt counter is increased (i.e., when there is a
no-ack error).
This commit changes the get handler for `SPINEL_PROP_HWADDR` to
use the public OT link API `otLinkGetFactoryAssignedIeeeEui64`
instead of the platform API. It also adds implementation of
this API under `OPENTREAD_RADIO` mode (for RCP build).
This commit adds a `FrameContext` type (containing all info that need
to be saved along with a prepared frame for indirect transmission) and
its support in `IndirectSender` and `DataPollHandler`. While the
`FrameContext` is defined by the `IndirectSender`, the lower-layer
`DataPollHandler` is expected to provide the buffer/object for it to
be stored (when the frame is prepared). This model allows different
implementations of `DataPollHandler` to adopt different strategies on
how to store the context.
This commit removes the extra logging of spinel error status on
tx done callback. The error will be logged from `LogIfFail()` at
the exit of the `HandleTransmitDone()`.
This commit defines RxFrame for receiving frames and TxFrame for
transmitting frames. The motivation is to prevent invalid uses of
Mac::Frame methods, because some of them are only available for rx
frames and some only for tx frames.
Message buffers store pointers which have different sizes on different
system. Setting message buffer size according to the CPU word length
so that message buffer size will be doubled on 64bit system compared
to that on 32bit system. As a result, the first message always have
some bytes left for small packets.
This commit simplifies boolean checks containing `== false` to use the
`!` operator instead, and removes redundant `== true` checks. This
commit aims to harmonize the boolean checks across core modules.
This change seems to make the test_diag case stable. The root cause
may be that distcheck enables address sanitizer, which may cause the
program to respond slower.
This commit changes the default timestamp of rx frames to be 64bit,
which is aimed to ensure the timestamp never wraps. This commit
changes the protocol of spinel.
NOTE: Changing spinel protocol is not allowed normally. However, since
the timestamp is only used by sniffer, an exception is made due to the
improved efficiency. Pyspinel is also updated accordingly.
This commit adds a `Mle::DeviceMode` class which is warpper over
a device mode bitmask (`uint8_t`) and provides the common helper
functions like `IsRxOnWhenIdle()`, `IsFullThreadDevice()`, etc.
This commit replaces mSec and mUsec in otRadioFrame with a single
mTimestamp to record when the frame is received.
The timestamp MUST be the time when SFD was received when TIME_SYNC or
CSL (Thread 1.2) is enabled, otherwise, it is the time when rx was
done.
This change reduces memory required to represent a radio frame.
The CC2650 only has hardware acceleration for 128-bit AES keys. The
CC1352 and CC2652 have hardware acceleration for 128- and 256-bit keys.
However, the current driver does not implement larger than 128-bit keys.
This commit changes `MeshForwarder` to drop a direct supervision
message. A direct supervision message is possible in the case where a
sleepy child switches its mode (becomes non-sleepy) while there is a
pending indirect supervision message in the send queue for it. The
message would be then converted to a direct tx. This commit also
removes the definitions/methods (e.g. `SendEmptyFrame()`) that were
being used for prepartion of supervision message which are no longer
needed.
A call to `mbedtls_ssl_set_client_transport_id()` is necessary when using
the SSL Server module. This commit ensures a call to the aforementioned
function when using CoAP Secure with PSK cipher suite.
This commit changes the interaction of `Mac` and `DataPollSender` such
that the selection of a data poll destination MAC address is delegated
to `DataPollSender` (related code is moved into `DataPollSender` from
`Mac`).
This commit allows the CLI to flush its transmit buffer of pending
data so that it can resume writing to the buffer.
This allows for reducing the size of the transmit buffer used for the
CLI whilst still retaining the ability to transmit long blocks of text
(which is required by the Thread certification tests) without locking
up the use of that memory on constrained devices like CC2538.
This commit updates `test-027-child-mode-change` to verify the
behavior of a parent node related to conversion of queued messages
(indirect to direct tx) upon the child's mode change from sleepy to
non-sleepy).
This commit ensures all queued messages for a child are accordingly
converted (indirect to direct transmission) when a child switches its
mode from sleepy to non-sleepy.
Fixes build error on efr32mg12/brd4304a that resulted in a conflicting
define of BSP_LED_POLARITY. Removed hal-config-board.h from sleepy
demo and moved some definitions into each hal-config.h in order to
build.
This commit uses multicast to simulate radio transmissions. This
avoids sending a frame multiple times and avoids duplicated packets in
captures.
This implementation uses two separate sockets for tx and rx. The
current implementation of thread-cert requires the sniffer to report
the sender of each packet. This issue can be addressed by stateful
tracking state of each node, but left for future work.
This commit adds a new class `DataPollHandler` which sits between
`Mac` layer and `IndirectSender`. It interfaces to `Mac` to handle any
received data poll and perform indirect frame transmission including
the re-transmission logic of frames (per poll). All state info (per
child) for handling of indirect frame retransmission is now defined
and managed by the `DataPollHanlder` class itself. This commit updates
the `IndiretSender` to interface with the `DataPollHandler` class and
handle preparation of frames from `Message` for indirect transmission.
This commit refactors and updates the existing code to add a generic
method `MeshForwarder::PrepareDataFrame()`. This method constructs a
MAC data from from a given IPv6 message at the offset set in the
message. This method enables link security when message is MLE type
and requires fragmentation.
This commit adds a new operation for indirect data frame transmission
in `Mac` class (only available on FTD build). The indirect tx request
is handled before a direct tx request. This commit also changes how
the number of retries and CMSA attempts (for a frame) are determined
`Mac` class itself now sets these according to request type.
This commit defines `IndirectSender::ChildInfo` class in child sender
module which contains all the info needed to store (per child) for
handling of indirect transmissions to the child. The `Child` class
inherits from the new class. This helps keep the indirect tx info in
the same file.
This commit adds a new module/class `IndirectSender` for handling
of the indirect transmission to sleepy children. The commit just
moves the existing code form `MeshForwarder` into the new class.
This commit changes the sub-mac callback model to simplify it such
that `SubMac::Callback` is itself an `InstanceLocator` and directly
calls into the correct next layers (`Mac` or `LinkRaw`). This model
relaxes the need for the other classes to sub-class the `Callback`
and will have `SubMac` itself define a `mCallbacks` instance (which
is an empty class) instead of tracking a reference to a callback
object.
This commit adds the *_CLOEXEC flags when opening files. This ensures
files are closed when spawning new processes.
* use LOG_DAEMON as syslog facility
* remove setenv() when forkpty
This commit prevents the CoAP stack from sending automatic 'Not
Found' responses to multicast CoAP requests, as suggested in RFC7252
8.2:
When a server is aware that a request arrived via multicast, the
server MAY always ignore the request, in particular if it doesn't
have anything useful to respond (e.g., if it only has an empty
payload or an error response).
This commit also allows CoAP requests that are sent to multicast
addresses to receive multiple responses, which will all be processed
by the same handler callback (For instance, a multicast GET to
discover network resources).
* [cli] ensure legacy callback APIs are defined as `OT_TOOL_WEAK`
* [posix-app] simplify the makefile (link in ncp lib).
This commit simplifies the posix-app makefiles by removing the
`inc_<module>` source files (which included certain modules from
the `ncp` folder). Instead the library `libopenthread-ncp-ftd.a`
is included when linking thethe final posix-app executables
`ot-ncp`, `ot-cli` and/or, `o-daemon`.
* [posix-app] ensure header files from ncp folder have "ncp/" prefix
This commit changes the posix-app platform makefile such that
the header files from `src/ncp` folder require "ncp/" prefix.
Currently, the Setting file won't be closed after ot-ncp is reset.
Once ot-ncp receives a RESET command from wpantund, it will reopen
the Setting file and create a new file Id.
This commit closes the Setting file when ot-ncp is reset.
This commit moves all the related code for managing entropy and crypto
and non-crypto random number generation into the `RandomManager`
class. This helps simplify the initialization process by having all
modules use a shared common init counter (`sInitCount`). This commit
also ensures that the shared instance of the non-crypto pseudo random
number generator is seeded only once.
* renamed efr32 in two for mg12 and mg21 and radio changes for mg12
Change to radio interface code, check the txBusy flag before
attempting to transmit a packet Cleaner auto state transition code and
safer event handling Use HAL_PA_VOLTAGE in all hal-config.h files
* uart flow control mode is configured from board /hal-config.h
Allows a different flow control mode for each EFR32 board as
necessary. (hw flow control is not presently implemented on
Thunderboard Sense so HAL_USART_FLOW_CONTROL_NONE mode should be used
for BRD4166A, other boards use HAL_USART_FLOW_CONTROL_HWUART)
By default, posix-app disables platform region logs. Even when
platform logs are enabled, logs are sent to syslog without printing to
stderr.
This commit prints error information to stderr on exit, providing the
user more direct information about failures. This commit also
eliminates the "wait no child process" error message.
Adding the SendPetition error handling in Start and moving it before
updating the state fixes the potential issue of locking up the
commissioner in the OT_COMMISSIONER_STATE_PETITION state without
having actually sent the petition.
This commit enhances the microsecond timer implementation with POSIX
timer API. This only enhances simulation on Linux because the API is
not supported on macOS.
The call to timer_settime() schedules a microsecond precision alarm.
When the alarm fires, the process is signalled with
OPENTHREAD_CONFIG_MICRO_TIMER_SIGNAL. The signal handler does nothing,
but the process will resume and the existing micro timer process can
be performed on time.
This commit ensures to clear the indirect message pointer on all
children and reset the indirect message count (which in turn clear the
source match table) from `MeshForwarder::Stop()`. This addresses the
issue where on an `Stop()`/`Start()` call the source match table can
become out of sync with the send queue and/or a child may hold on to
an already freed `Message`.
In #3284, the source for network diagnostic is explicitly specified as RLOC.
However when link-local address is the destination, link-local source is
preferred.
This commit remove the logic in `DataPollManager` related to handling
the `NO_BUFS` error case when sending a data poll. This logic is no
longer needed since the data poll tx logic is now handled by `Mac`
layer directly and there is no need to allocate/use a `Message` instance
for data poll (which could lead to `NO_BUFs` error situation).
This commit squashes the approved updates, mainly include
1) bug fix or enhancement
- make pollperiod take effect
- fix the issue in finding the address of the specific address
(case-sensitive issue introduced in #3639)
- make `__sendCommand` more robust for possible extra serial output
3) Update along with master code and other minor updates
- the command used to find specific address (#3856)
- the IP6Prefix string len (from 20 to 19)
- correct typos
2) Code Style
- use single quotes for code
- update to use `print ()` and format `%`
- format via with `black` tool locally
`python3 -m black -l 79 -S tools/harness-thci -t py27`
- add travis python check example for THCI with `flake8` tool
notes: require OT code with #3856 (get specific address) and #3862 (`joiner id`)
This commit changes the `ActiveDataset::CreateNewNetwork()` to select
a random channel from the preferred channel mask if it is not empty,
otherwise a random channel from the supported mask is picked.
- Update Coap::Message::SetToken() to return error.
- Update Coap::Message::SetDefaultResponseHeader() to return error.
- Add error checking around calls to the above.
This commit adds `spinel_validate_utf8()` function which verifies
whether a given (null terminated) sequence of bytes (string) follows
the UTF8 encoding format. This function is then used to check any
decoded/unpacked spinel UTF8 type. This commit also adds test-cases
in spinel to check the behavior of the new function with a set of
UTF8 valid and invalid strings.
This commit adds a new property `SPINEL_PROP_THREAD_NEW_DATASET` in
spinel to create a new Operational Dataset to use when forming a new
network. This property maps to `otDatasetCreateNewNetwork()`
This commit removes the all-messages queue from `MessagePool`. This
simplifies the `Message` header `MessageInfo` and allow a message
to be inserted into one linked list.
This commit updates order of member variable definitions in the
Instance class to ensure that objects that may be used by others are
initialized first. In particular, Tasklet and Timer Schedulers, and
RandomManager are initialized first. On FTD/MTD, this is followed by
Notifier, Settings, and MessagePool objects.
This commit updates the `MultiFrameBuffer` class implementation mainly
how the saved frames in buffer are read. The new code allows a user to
re-read the frames again. This change makes the implementation simpler
and more flexible. The corresponding unit test is also updated to
verify new behavior.
This commit changes the `Mle::Store()` behavior such that if a device
is not attached and there is no previously saved `NetworkInfo`
(indicating that the device has never been attached before) we skip
saving/updating the `NetworkInfo`. Note that on a device reset the
MLE/MAC frame counters (which are part of `NetworkInfo`) would reset
but device would also start with a new randomly generated extended
address (so the security nonces would not be repeated).
This commit changes preparation of "Child Update Response" (on a
child) such that only the mesh-local address is included in Address
Registration TLV. If the child has more addresses to register it
follows up with its own "Child Update Request".
6b6a11dc Changed the bootstrap shebang from sh to bash to address a bashism that arrived at 1.6.10.
e97e9053 Merge pull request #22 from nestlabs/feature/improve-bootstrap-diagnostics
e367ac5d Added additional up-front checks to the bootstrap script to ensure the required executables are available. On failure to find those executables, offer users actionable steps to resolve the error.
299a9e4e Added additional up-front checks to ensure the required executables are available. On failure to find those executables, offer users actionable steps to resolve the error.
3c6f52e3 Fixed spaces / tab issue.
806f45ec Merge pull request #21 from nestlabs/bug/do-not-use-default-goal-in-headers
4f0cbeb1 Now that both automake and pure make headers and footers are co-mingled, address an issues in which the .DEFAULT_GOAL specifications in the repos.mak footer were conflicting with makefiles that wanted a different default goal by moving those .DEFAULT_GOAL specifications to Makefile-bootstrap.
d5901db8 Merge pull request #20 from nestlabs/feature/downrev-m4
f589293b Added content for and updated default version to 1.6.8.
6edebaaa Rebased several automake header macros implementations on their pure make equivalents.
a64a84c5 Reworked how verbose progress is handled to simplify specification of progress macros.
13b17fcb Leverage both automake and pure make headers and footers by including the latter in the former.
a50c3fe6 Downgraded m4 from 1.4.17 to 1.4.5 since 1.4.5 seems to be the last version of m4 that does not abort on invocation in the m4 *rintf and friends compatibility and portability library.
987a35b7 Merge pull request #19 from nestlabs/bug/fix-nl-filtered-canonical
690d12e0 * Addressed issues with NL_FILTERED_CANONICAL in which the desired content to be filtered was not filtering correctly and in which the desired filtered canonical variables were not emitted in makefiles.
c141c281 Addressed an issue with _NL_FILTERED_CANONICAL in which the desired filtered canonical variables were not emitted in makefiles.
1a22c8f0 Addressed an issue with _NL_FILTERED_CANONICAL in which the desired content to be filtered was not filtering correctly.
git-subtree-dir: third_party/nlbuild-autotools/repo
git-subtree-split: 6b6a11dc98c6cc1f2faf2e729d0971704a5b5f28
Bug was introdcued in 5a7faa5.
A device performing MLE attach first sends an MLE Parent Request looking
for routers. If no MLE Parent Response is received from a neighboring router
where the link quality is 3 in both directions, the device shall send a
second MLE Parent Request that includes both routers and REEDs.
This commit adds the bi-directional link quality check to determine whether
a second MLE Parent Request should be sent.
This commit changes the emitted properties from NCP such that the
mesh-local address (and prefix) are emitted before the entire IP
address table. This ensures that a host driver is aware of the
mesh-local prefix when it receives the full address table and can
correctly filter RLOC addresses (if desired).
This commit updates `NcpBase` to emit `VALUE_INSERTED/REMOVED` spinel
message to host for `PROP_NEIGHBOR_TABLE` when a router neighbor entry
is added or removed.
This commit updates the neighbor table callback to signal when
either a child or a router neighbor entry is being added or removed.
This change replaces and enhances the previous APIs relalted to child
table callback.
This commit removes unnecessary features of OpenThread on Android platform.
This commit also removes features disabled in openthread-config-android.h so
that these definitions can be overridden in Android.mk without warning.
This commit changes the `NcpFrameBuffer` and `SpinelEncoder` classes
to include the support for adding of `otMessage` to the buffer and the
related APIs in the FTD/MTD builds (exclude it from the RADIO (RCP)
build).
Remove `Message` related source files from radio mode Makefile.
This commit addresses the attach failure issue by an SED child trying
to register multiple IPv6 addresses in MLE "Child ID Request" message.
If the MLE "Child ID Request" requires fragmentation at 6LoWPAN layer,
this commit changes the code to abort the transmission and drop the
message and instead signal to MLE layer to prepare a shorter "Child ID
Request" by only including the mesh-local address in the `Address
Registration TLV`. After the child attaches, the new code will ensure
to trigger a "Child Update Request" exchange for the child to register
the remaining IPv6 addresses with its parents.
This commit enhances both posix-app and posix simulation to use the clock
CLOCK_MONOTONIC_RAW, which is supported on Linux and macOS. However, if
this clock is not available, it will fall back to CLOCK_MONOTONIC (for
BSD system).
On windows, it continues to use `gettimeofday()`.
This commit adds option `--no-reset` to OpenThread POSIX app to suppress
sending soft reset command when initializing OpenThread radio on host.
This is for NCP SPI bus scenario, where spi-hdlc-adapter is involved who
will trigger hardware reset at start.
This commit triggers resetting NCP/RCP on exit, which ensures NCP/RCP
get back to uninitialized state so that they will not respond to 15.4
messages.
Note, host should disable soft reset by passing `--no-reset` for RCP.
Thus OpenThread POSIX app doesn't need to reset RCP when it exits.
This commit fixes a bug in the commissioner when a joiner's expiration
time has alerady elapsed.
This commit also introduces convenience methods for computing time
elapsed and diffs.
- No longer queue 2x 32-byte buffers for UART receive. Upon
investigation, the RAIL library switches these buffers in software
(within the same ISR context as `receiveDone`), so it seems to be
pointless from a performance perspective in queuing multiple
buffers. Instead, now work with 64-byte buffers.
- Refactored `updateReceiveProgress` so that extra variable
`mLastCount` isn't required.
- Extensive testing at higher baud rates revealed race conditions and
some issues with detecting buffer full conditions.
- Added comments to clarify the logic
- Removed asserts after returning from RAIL library
functions. Contrary to my previous arguments, if the behaviour of
the RAIL library functions changes in the future (with regards to
the errors it returns), then somebody would have to remember to
check these asserts were still appropriate.
When a partial dataset is stored, the device will attempt to attach to a
Thread network using the limited parameters available. If the device
successfully attaches, the device will then obtain the complete Active
Dataset from its Parent. If the device is router-capable, it will not
become a Router/Leader until it has successfully retrieved a complete Active
Dataset.
Saving a partial dataset supports out-of-band commissioning scenarios.
This commit ensures that if the passed-in string args (vendor name,
model, sw version, data or provisioning URL) in `Joiner::Start()`
are too long, they are clipped to the max size defined by the
corresponding TLVs.
`BeaconPayload::GetNetworkName()` does not return a NULL-terminated string.
This commit fixes `BeaconPayload::ToInfoString()` to pass a NULL-terminated
string to the string formatter.
When generating a new Active Dataset, the current PSKc value is used. Because
the PSKc is initialized to all zeros, new Active Datasets have a default
PSKc value of all zeros.
This commit checks if the PSKc has been set (i.e. not all zeros) and, if not
set, generates a random PSKc when creating a new Active Dataset.
This commit updates `SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING`
definition to allow vendor info (name, model, sw version, data) to be
specified. All new parameters are optional and if not specified in the
spinel frame (or an empty string is given), OpenThread default values
will be used instead.
This change in `SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING` format keeps
it backward compatible with previous definition, ensuring any driver
using the previous format will be parsed in the same way.
This commit adds a new method `AppendTlv` to `Message` class which
appends a fully formed TLV to the message. This commit also changes
the core modules to use the new method when appending a TLV.
- Return OT_ERROR_PARSE when encountering mal-formatted headers.
- Return OT_ERROR_NO_ROUTE when there is no route to host.
- Document possible return values for `otIp6Send()`.
This commit updates the `Joiner` class implementation to remove the
requirement for `Start()` vendor related parameters (vendor name,
model, sw version, data) to be static (string). This is done without
requiring the `Joiner` class to use member variables to store/copy
the strings by preparing the "Joiner Finalize" message early on (note
that these parameters are included in this message) and keeping track
of the dynamically allocated `Coap::Message` pointer instead.
This commit contains the following improvements in
`spi-hdlc-adapter`:
- It changes the default syslog log level to `LOG_WARNING`.
- It enhances the `--verbose[=num]` option to allow negative values
to reduce the log level. Note that this change keeps the behavior
backward compatible (it is an add-on).
- It updates the `print_help()` and the `README.md` files to document
new behavior of `--verbose` option.
There's missing error definition for otPlatRadioDisable(). This commit adds
an error case OT_ERROR_INVALID_STATE to make sure this is only called
when the radio is in sleep mode.
Add new radio platform APIs:
* otPlatRadioGetSupportedChannelMask(); // supported channel mask: the device is allowed to be on;
* otPlatRadioGetPreferredChannelMask(); // preferred channel mask: the device prefers to form on.
Implement some default radio platform APIs.
Add spinel property `SPINEL_PROP_PHY_CHAN_PREFERRED` to retrieve Preferred ChannelMask.
This commit parses rx timestamp of radio frame received by RCP, no matter
data frames or ACK frames.
* add OT_NUM_ERRORS as number of defined errors.
* allow empty SPINEL_DATATYPE_DATA and SPINEL_DATATYPE_DATA_WLEN when
parsing spinel packets.
This commit updates the `test-001` to allow extra properties to
be verified when running under posix-app model. The new test
ensures "POSIXApp:RCPVersion" is gettable.
This commit contains the following changes to `Joiner` class
implementations:
- Notifier events are signaled on all `Joiner` state changes
and are logged (through use of `Joiner::SetState()`).
- Discover scan during join uses filtering (removes the need
to perform filtering by the `Joiner` class itself).
- `Joiner::Stop()` is changed to allow it to be called at any
stage of join process and it correctly cleans all states.
- Priority assignment to discovered networks is updated/fixed
(prioritizing networks with an exact match of Joiner ID in their
Steering Data compared to ones that allow all joiners, and
sub-prioritize based on signal strength).
- Logs are updated.
This commit makes improvements to MLE Discover Scan implementation,
mainly the steering data filtering logic:
- The SHA-256 of EUI64 (Joiner ID) and then the related bloom filter
CRC-CCIT and CRC-ANSI indexes are calculated and saved at start of
scan operation (removing the need to re-calculate them on every scan
result).
- When filtering is enabled, a Discover Scan result with no Steering
Data is now rejected.
- `Mle` class member variables related to discover scan operation
are renamed to start with `mDisocver` prefix.
This commit updates `RadioSpinel::RadioTrasnmit()` to include the
`otRadioFrame` parameters (max CSMA backoffs, max frame retries, and
CSMA-CA enabled flag) as part of meta-data in `PROP_STREAM_RAW`
property `VALUE_SET` command.
This commit adds logic to decode and use the optional meta-data fields
in a `VALUE_SET` command (frame tx request) for `PROP_STREAM_RAW` in
raw-link or radio only (RCP) mode. The optional meta-data fields map
to definitions in `otRadioFrame` to specify number of CSMA backoffs
attempts, frame retry attempts, whether to enable CSMA-CA for this
frame or not. If any optional field is not included, default value
is used instead. This aligns the implementation with specification
of `PROP_STREAM_RAW` in `spinel.h`.
Current posix app uses gettimeofday() to get time, which will be affected
by system time changes, and results in alarm not fired. This commit uses
clock_gettime() instead to avoid this issue.
This commit improves the `Mac::Filter` implementation. It mainly
removes the internally used `mFiltered` variable from the public
`otMacFilterEntry` definition and moves it inside `Mac::Filter`
private definitions.
This commit changes how the objects in OpenThread access each other.
It adds a template `Get<Type>()` method in `InstanceLocator`. This
method returns a reference to a given `Type` object belonging to the
OpenThread instance (e.g. `Get<MeshForwarder>()` returns a reference
to `MeshForwarder` object on the OpenThread instance). The
`InstanceLocator` is used as base class of all OpenThread classes so
every class can easily access any other object. This commit also
changes how the main instance is retrieved in `InstanceLocator` for
the single-instance case. The method `GetInstance()` directly uses the
raw buffer `gInstanceRaw`. This change helps make the `GetInstance()`
and in turn all `Get<Type>()` methods in-line. This commit also
removes the existing getters across all classes to use the new
`Get<Type>()` model.
This commit renames methods in `DatasetLocal`, `DatasetManager`,
'ActiveDataset' and `PendingDataset` to use `Read()` and `Save()`
in place of `Get()` and `Set()` respectively. This aligns the
names with `Setting` class indicating that these method do
read/save Dataset info in non-volatile memory.
* [examples] add software implementation of source match table
* [efr32] modify radio driver to use generic implementation of source match table
* [efr32] configure soft source match table PAN ID
1. Add new test case **Cert_9_2_02**. Since the test case contains 2
topologies, added 2 new files:
- `Cert_9_2_02A_MGMTCommissionerSet.py`,
- `Cert_9_2_02B_MGMTCommissionerSet.py`.
2. Add mesh_cop tlvs parsing. The corresponding file is
`mesh_cop.py`. The mesh_cop tlvs are used in many cases. For example,
`CommissionerSessionId` is used in both the parsing of **Commissioning
Data**(in mle) and the parsing of **CoAP**. Collected all mesh_cop
tlvs refered in Thread into this file with some unused tlvs
unimplemented.
3. Reuse `SubTlvsFactory` in `network_data.py`. `SubTlvsFactory` are
used to choose the corresponding factory of specific tlv and do the
parsing of it. The `NetworkLayerTlvsFactory` in `network_layer.py` had
exactly the same function with it (almost the same code). Moved the
`SubTlvsFactory` into a new file `tlvs_parsing.py` and change the
usage in `network_data.py` and `network_layer.py`. This helps us
remove some redundant code.
4. Some format issues. Remove some trailing spaces.
This commit updates and renames the existing `test-026-slaac-address`
to indicate that it covers the behavior of `wpantund` related to
SLAAC address management (in `test-026` we disable NCP SLAAC module).
It adds a new test `test-030-slaac-address-ncp` to cover behavior of
OpenThread/NCP SLAAC module:
- Verify that adding prefix (with SLAAC flag) causes a corresponding
SLAAC IPv6 address to be added.
- Verify that removing the prefix would remove the SLAAC address.
- Verify behavior when same prefix is added and removed on multiple nodes
(with or without SLAAC flag).
- Check behavior when an IPv6 address with the same prefix already exists.
- Check behavior when the address with same prefix is removed (SLAAC module
should add a SLAAC address upon removal of the address).
- Verify that removal of prefix does not remove user-added addresses with
same prefix.
- Verify disabling SLAAC module removes any previously added SLAAC
addresses, and re-enabling it adds them back (with same IID).
- Check behavior when prefix is added while SLAAC module is disabled and
then enabled later.
This commit adds `SPINEL_CAP_SLAAC` which indicates to host whether
SLAAC feature is supported. It also adds `SPINEL_PROP_SLAAC_ENABLED`
spinel property to let host enable/disable SLAAC module at run-time.
This commit enhances the SLAAC support in OpenThread core. It contains
the following changes and features:
The `Utils::Slaac` class is updated to include all the related code
for managing SLAAC addresses (e.g., `Slaac` class maintains the
address buffer and directly subscribes to `Notifier` to listen for
Network Data changes to update SLAAC addresses).
The SLAAC address module is changed to support and use semantically
opaque IID generation algorithm (RFC 7217) instead of random IID
generation. This ensures that SLAAC addresses are random but stable
(i.e., the same SLAAC address is added on a device for the same
prefix) and aligns the implementation with Thread specification
requirement.
The semantically opaque IID generation logic is updated to follow RFC
7217 with SHA-256 as the pseudo-random function, and a 256 bit secret
key (generated once using true random number generator and saved in
non-volatile settings).
A new feature is added to allow SLAAC support to be enabled or
disabled during network operation. When enabled, SLAAC addresses are
generated and added to the interface. When disabled, any previously
added SLAAC address is removed.
This commit also adds "SLAAC prefix filter" feature which allows
OpenThread users to register a filter handler with SLAAC module. The
handler is invoked by SLAAC module when it is about to add a SLAAC
address based on a prefix. The returned boolean value from the handler
determines whether the address should be filtered or not.
bInterfaceProtocol descriptor previously indicated that AT V.250 commands
were supported by the device. This could cause issues with applications
managing modems.
`CoapSecure` is always used by joiner, border agent or commissioner.
DTLS should not be shared with the application `CoapSecure`.
This commit includes the following changes:
* allow multiple DTLS by using `TimerMilliContext`
* move `CoAP::mSocket` into `Dtls`
* move `ThreadNetif::mDtls` into `CoapSecure`
* remove unnecessary getters of `Dtls` and `CoapSecure`
This commit adds a simple internal helper class `RouterIdSet` in
`RouterTable` to store the allocated router IDs bitset. This commit
also renames the `for` loop variable names (`routerId` when iterating
over all router IDs and `index` used for `mRouters` array index)
* Define parameter for RSSI offset.
This defines the RSSI offset as an overridable parameter in the CC2538
configuration for users that have installed a CC2592 on their board but
have hard-wired the HGM pin either to `VDD` or `GND`.
* Calibrate RSSI according to HGM state.
I had actually misread the datasheet a little bit, having gotten
sensitivity and RSSI offset confused. The values I needed for the
sensitivity were actually in the table *above* where I got the original
figures here from.
This puts the *correct* figures in place, and also defines a function
that returns the RSSI offset based on the state of the HGM pin (or
returns a static value if we omit CC2592 support or disable HGM
control).
* Expose RSSI offset setting in Makefile
* Document RSSI offset parameter
* refactor for energy scan API
* rename enum, init status in init func, tidy up and fix issue in GetRssi
* add cast and fix start energy scan error return
Add support for testing commissioning process, including:
1. Add DTLS, Thread Discovery and commissioning messages(JOIN_FIN.req etc) parsing;
2. Support parsing log from UART response, and construct decrypted messages;
3. Common commands for commissioning related verification;
Processing a message may trigger an Address Solicit message to be sent.
Because Thread control messages have higher priority, it is possible for the
Address Solicit message to evict the data message that caused the generation
of the Address Solicit message.
This commit present a message that's being processed from being evicted.
Credit to OSS-Fuzz.
* [cc2538] Define registers for control of CC2592.
In order to set up the signals needed to drive the CC2592 front-end, we
need to expose a few registers in the radio module that route internal
module signals to pins on Port C.
TI also recommend hooking the HGM pin of the CC2592 to a GPIO pin so
that the high-gain mode can be software-controlled. It can be connected
to any GPIO pin, but they call out PD2 specifically for this, so we need
to configure GPIO port C & D. Since we're here, we'll add B as well.
Some macros of convenience are also added for accessing the Nth element
in an array of 32-bit registers, as well as computing the bit mask of
the Nth GPIO pin.
* [cc2538] Define configuration settings for CC2592.
By default, we disable support for the CC2592 as we do not wish to break
existing OpenThread instances. The configuration parameters allow
customisation of the locations for the `PA_EN`, `LNA_EN` and `HGM`
signals (within the constraints of the CC2538) for cases where people
have moved the signals around on custom boards.
The defaults work with designs derived off the CC2538-CC2592 EM
reference design.
* [cc2538] Define control interface for HGM pin.
Since the `HGM` signal is under software control, we need to be able to
allow the software to turn it on or off as required. This exposes two
functions, one of which queries the current state (by looking at the
GPIO register bit-mask), and the other provides a means to change the
state.
* [cc2538] Implement control and calibration of the CC2592.
This implements the control functions defined earlier and adds the
necessary logic for initialising the CC2592.
The transmit and receive power levels are also calibrated.
* [cc2538] Define CC2592 options in Makefile.
This allows building of a CC2538-CC2592 EM image by specifying
`CC2592=1` on the command line.
This commit adds `OPENTHREAD_CONFIG_ENABLE_SLAAC` as a build
configuration option to enable/disable SLAAC support within
OpenThread. This feature is disabled by default. This commit also
adds `SLAAC` to `common-switches` list to allow builds to enable
this feature easily.
This commit guards using mbedTLS's buffer allocator API with a more accurate
macro, so that even in single instance mode, we can use other memory
allocator.
In daemon mode, UART write should be processed even when no client
is connected. This commit writes UART to STDERR in such situation.
* add test for daemon mode
* remove useless code for UART restore
* fix a typo of assert
* set FD_CLOEXEC flag to better support reset.
Add DISABLE_TRANSPORTS switch which disables build of all transports and examples using them.
Disable compilation of USB and UART transports if NCP_SPI switch is set. This also disables
the build of CLI example.
This commit changes the behavior of `Mle` to skip the saving of
network info (to non-volatile memory) on role change to detached. Note
that `Store()` does only update the MAC/MLE counters if device is not
attached. The MAC/MLE counters update is tracked already by
`KeyManager`.
This commit adds new check in `settings.cpp` for saving of
`NetworkInfo` and `ParentInfo` in non-volatile memory to verify that
the new value is different from previously saved content. This reduces
number of writes after a device reboot.
This commit adds code to ensure `SETTINGS_CONFIG_PAGE_NUM` is at
least two. This helps simplify the code and also address
Coverity warnings for unreachable code.
Currently SETTINGS_CONFIG_PAGE_NAME is defined indirectly by addresses of
__d_nv_mem_start and __d_nv_mem_end. But such definition doesn't allow to
perform compile time sanity check. Define this macro with const value 16.
Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
OT doesn't always call otPlatRadioReceive to set rx state explicitly. It
causes RF is in wrong state in some cases. SAMR21 RF is switched to
rx state internally when tx is finished and OT platform radio state should
be updated accordingly. This fix is set sState to OT_RADIO_STATE_RECEIVE
when tx is done.
Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
samr21 has HW aes-128 module. It couldn't be used before as mbedtls uses
256 bit random generator. Recently mbedtls introduces
MBEDTLS_CTR_DRBG_USE_128_BIT_KEY flag which makes mbedtls to use 128 bit
random generator. It limits the security of generated keys but allows
to use HW aes-128 module for encrypt/decrypt 802.15.4 frames.
Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
By default Makefile-samr21 builds for SAM R21 Xplained Pro board. Another
board can be specified with BOARD variable through command line:
make -f examples/Makefile-samr21 BOARD=<TARGET_BOARD>
Currently supported following boards: SAMR21_XPLAINED_PRO,
SAMR21G18_MODULE, SAMR21B18_MODULE.
Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
samr21 rf driver requires that first byte of transmit buffer should be
psdu length. The psdu was copied to a local buffer with one byte shift then
the local buffer was passed to rf driver. This copying is removed by
extending length of sTransmitPsdu by 1 byte and use &sTransmitPsdu[1] as
transmit frame psdu.
Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
Internal compiler.h defines __always_inline macro and includes cdefs.h
indirectly. cdefs.h also defines this macro. As result we have redefined
macro error which can't be suppressed. The fix is to use custom compiler.h
which is copy of ASF compiler.h bu defines __always_inline only if it is
not yet defined.
Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
The attach state `kAttachStateSynchronize` was intended for sending
"Child Update Requests" after a reset (if device was previously
attached) using the `mAttachTimer` for retransmissions. However,
"Child Update" transmissions use `mMessageTransmissionTimer`
instead.
This commit changes `SetStateChild()` to stop `mAttachTimer`. This
ensures that as the `mAttachState` is set to idle, the attach timer is
also stopped (note that the attach timer callback asserts on idle
attach state). This addresses a rare issue where an inopportune device
mode change request on an already attached device while it is
performing periodic parent search (or possibly delaying processing of
a received announce) could cause an assert; `SetDeviceMode()` would
call `SetStateChild()` setting the attach state to idle while attach
timer would continue to run.
This commit enables a node serve as the border agent of native commissioner
by adding the border agent UDP port to unsecure port when the security
policy allows.
To fully test verify this commit, we need a native commissioner, which I
will submit a separate commit to enable that.
mDidTx indicates whether a frame is received or transmitted, which is
only useful for capturing packets. This commit removes this field, and makes
this flag an argument to the pcap callback.
This commit changes the `SendOutOfBandFrameRequest()` implementation
to check `mOperation` and `mPending<>` state variables to determine
if MAC layer is still busy with a previous OOB tx request (instead of
using the `mOobFrame` pointer variable). This change makes the OOB tx
implementation behave similarly to other APIs (e.g., `ActiveScan()`
or `SendFrameRequest()`). This commit also enhances the documentation
for the OOB Send APIs in header files.
This commit fixes a bug that `alarm.c` misses definition of
OPENTHREAD_ENABLE_DIAG for not including `openthread-core-config.h`.
This commit adds the `openthread-core-config.h` to every platform sources.
Also, this commit enhances the `test_diag.py` to make sure diag can send
packets out.
This commit changes the `const` methods in `Mac::Frame` class
returning a pointer type to return a pointer to `const`. It also
changes the implementation of non-`const` methods (e.g., `GetPayload()`
and `GetFooter()`) to re-use the corresponding `const` methods.
Current implementation of GetOwner function for single-instance CLI
assumed that `cli_uart` backend is used. This caused application
crash when different backend was used and `cli_uart` was not
initialized (and in result sUartServer static pointer was not set).
This commit fixes the issue by moving static CLI Server pointer and
the mInterpreter field to the to the base Server class and providing
getter method to obtain the Interpreter instance. With this approach,
any backend derived from the Server class will be able to initialize
the static pointer and will provide a valid reference to the
Interpreter class instance.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit changes the SLAAC policy so that if there is an existing address
with of a prefix, no new address will be created for this SLAAC enabled
prefix.
This commit simplifies the `Mle::Start()` by combining its parameters.
With the new definition `Start()` would always try to reattach using
any saved active/pending dataset unless it is asked to attach on an
announced network (i.e., `aAnnounceAttach` is `true`).
Currently Coap::Receive and CoapSecure::Receive process different
messages. The former CoAP payload, while the latter DTLS payload.
This commit tries to reduce the confusion so that Coap*::Receive always
processes CoAP messages, just like Coap*::Send. With this commit,
CoapBase handles pure CoAP messages without knowledge of the
underlying transport. And the transport layer can also do its job without
processing CoAP message.
Also, this commit also removes virtual methods from Coap::*.
And here are the changes:
* UdpSocket is moved into sub-classes instead of the base class.
* CoapBase::Receive is now non-virtual method.
* CaopBase::Send is now non-virtual method, replaced by a function
pointer of sub-class of CoapBase.
And the new class relationship is as follows:
```
CoAP layer: CoapBase
/ \
/ \
/ \
Transport Layer: Coap CoapSecure
```
This commit refines Coap::Header into Coap::Message to avoid declaring
the big Coap::Header in stack which was causing problems in low-memory
systems such as CC2538.
A UDP reserves 56 bytes by default, which will not be used before an
outbound message goes down to transport layer and after an inbound
message is delievered to CoAP agent. To get better performance, this commit
utilizes these reserved bytes of cache basic header of CoAP message
including CoAP version, code, message ID and token. These cached data
are parsed when CoAP agent receives a CoAP message and are dumped into
the correct place of a CoAP Message before sending by lower layer.
To make sure there is enough reserved bytes for an inbound message, This
commit removes headers in UDP layer before delivering a ot::Message to
handlers.
This commit changes `NetworkData` to use an enumeration `Type` to
specify whether a `NetworkData` instance represents local network
data or leader network data.
This commit changes `SetRxOnWhenIdle()` to stop the timer (data poll
timeout) if there is a pending `kOperationWaitingForData` when rx-on-
when-idle is being enabled. This addresses an issue where the timer
could remain active if the `SetRxOnwhenIdle(true)` is called before
the operation `kOperationWaitingForData` actually starts. Note that
the data poll timeout timer gets started while current operation is
`kOperationTransmitData` (from `HandleTransmitDone()` on a successful
data request frame transmission with a received ack indicating a
pending frame).
`Cli::Uart::OutputFormat()` current only supports output
`OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH` bytes, which isn't enough
for command *diag* by default. This PR removes that restriction
by using `Cli::Uart::Output`.
I think this is just a quick fix, an overall enhancement of Cli is
needed so that we can use small stack size but also get better
performance.
75faaf5f Addressed an issue in which the failure to make the 'repos-warning' target order-only caused dependent repo paths to be repeatedly and unnecessarily remade which, in turn, caused git operations and the configuration or build to fail.
1d4fff8c Merge pull request #16 from nestlabs/feature/repos-with-clone
7233d998 Added support for pulling down remote package dependencies using git clone (default) or git submodule depending on the setting of pull.method in repos.conf.
1debcf62 Added support for coverage-local and check-local targets.
4699860c Merge pull request #15 from nestlabs/feature/check-coverage-local
79923820 Added support for coverage-local and check-local targets. Added documentation for all coverage-related targets.
d46f42a9 Addressed a spelling typo identified during code review.
b6a6c1ac Take a different approach to version flapping against 'make distcheck' by leaving VERSION_FILE as an immediate (:=) variable and instead creating a two-level <PACKAGE>_VERSION variable, the first of which is set from VERSION_FILE by default at make recursion level zero (0).
bf97ef6e Address an issue with VERSION_FILE on clean source code control clones or unarchived distribution in which 'make dist' or 'make distcheck' fail. VERSION_FILE should be and is intentionally a deferred (=) rather than an immediate (:=) variable to ensure late evaluation AFTER .local-version MAY be created rather than when the makefile containing it is parsed.
ae96d615 Fixed a typo.
74c4da2c Added support to repos.conf for a 'commit' key such that a hash or tag other than HEAD for a given repository and branch may be synchronized and checked out.
0d8afe93 When the verbose flag is asserted, prnt out the actual series of action commands that will be invoked.
8663c890 * Address a number of issues with building the prepackaged GNU autotools subset included in nlbuild-autotools for Ubuntu Bionic.
f2cdbac1 Add support, if necessary, for patching an expanded package.
35a238ed Only attempt to remove libtoolize if the effective user id matches that of the user executing the script.
7a899e8f Update the default version and change log for 1.5.2 and related changes.
48564b57 Since the '--name-only' option only appears in git-2.6 and later and there are production systems using git version as old as git-1.9, do not use '--name-only'.
7479acdf Fix a comment typo.
6c647b1d White space consistency clean-up.
60f989ea Incorporated a formatting suggestion from code review.
638a0c08 Fixed a typo.
33e0c7fc Addressed a number of typos and grammatical errors in comments and help output.
412d0e50 Fixed a typo.
4063134b Merge branch 'master' of github.com:nestlabs/nlbuild-autotools
4946bd54 Updated the date for 1.5.0.
90743059 Added a populate command for 'repos.conf'.
9bbf84f5 Added boilerplate examples for remote repository integration that package integrators can uncomment, adapt, or delete.
7418afd3 Initial revision.
0f9f1217 Ensure 'rm' explicitly includes -f should 'MAKEFLAGS' with '-R' be asserted in the environment.
2e6471f9 Add another clarifying example of building package-local tools from an integrated project.
bad99a91 Added content for and updated default version to 1.5.0.
b556c134 Added support for pulling down remote package dependencies using git submodule.
b9c6ca41 Restore prior change introduced at b07c9c034bc039f41336f447b55a4640c466d2bc.
e05e4fc4 Added a populate command to add 'Makefile-bootstrap' to the project top-level directory.
8ba67ce3 Added a populate command to add 'Makefile-bootstrap' to the project top-level directory.
git-subtree-dir: third_party/nlbuild-autotools/repo
git-subtree-split: 75faaf5f7b87cdd15c5d78ec61e8327e551a2a79
The `SetRxOnWhenIdle()` is changed such that if it needs to stop
operation `WaitingForData`, the next operation gets started from
the `mOperationTask` tasklet. This change makes the behavior of
the `SetRxOnWhenIdle()` consistent with other MAC APIs (i.e.,
new operations are started only from tasklet or from a radio/timer
callback and not from any MAC APIs). This commit also updates the
`HandleTimer()` to check for operation being `kOperationIdle` when
timer is used for delaying sleep.
This commit replaces `1U` constants with `1UL` in bit shift
statements like `1U << shift` when dealing with a variable shift
value that can be larger than 15. This helps make it explicit to the
complier that the constant should be considered as a `uint32_t`.
This change avoids the use of (potentially) undefined "1U << 32"
when calculating the backoff delay for attach re-attempt in MLE.
Credit for this bug goes to Coverity.
This commit moves the definition of legacy related member variable
in `NcpBase` into a `#if OPENTHREAD_MTD || OPENTHREAD_FTD` block.
This addresses Coverity warning for un-initialized member variables
from constructor.
This commit changes the `Hdlc::Decoder` implementation to report
non-zero length received frames shorter than FCS size as an error
`OT_ERROR_PARSE` (instead of ignoring such frames during decoding).
Since the recent changes in `Hdlc::Decoder` buffer model delegates
the management of the frame buffer to the user of `Decoder`,
clearing frame buffer after an error should be be performed by the
`Decoder` user from the `FrameHandler` callback. The change in this
commit addresses an issue where a small (single-byte) frame would
not have been cleared from the decoder buffer and included in the
next frame. This commit also updates the `test_hdlc` unit test to
cover small frame error.
This commit changes the `HdlcInterface::HandleHdlcFrame()` callback
which handles a received and decoded HDLC frame such that it
discards a bad/incorrect frame from the multi frame buffer (i.e,
discard the frame on any error).
This commit updates the `HdlcInterface` and `RadioSpinel` to use the
new HDLC buffer model. In particular, for received spinel frames the
decoder uses an `Hdlc::MultiFrameBuffer` which is capable of storing
multiple frames in a FIFO queue manner.
With this model, the received and decoded spinel frames are directly
placed in the FIFO buffer. This allows `RadioSpinel` code during
`WaitResponse()` (when waiting for specific Spinel response frame) to
simply save/keep a notification frame in the queue buffer (without
requiring to copy the frame) so that it can read and process the
saved frame later. If a received frame can be processed at the time,
the frame is then simply discarded from the queue buffer.
This commit updates HDLC implementation to harmonize the buffer model
used by `Hdlc::Encoder` and `Hdlc::Decoder`.
The new model defines a common class `Hdlc::FrameWritePointer` which
provides a minimum set of APIs used by `Encoder/Decoder` for writing
frames, while not defining the underlying buffer space or how the
buffer is managed. `Encoder` or `Decoder` users are expected to use
sub-classes of `FrameWritePointer` to add the buffer space and
implement the frame buffer management scheme.
Two sub-classes `Hdlc::FrameBuffer` and `Hdlc::MultiFrameBuffer` are
also provided which respectively allow storing a single frame or
multiple frames (FIFO queue of frames) in a buffer of given size.
This commit also updates the `NcpUart` code to use the new buffer
model.
Finally, this commit adds an HDLC unit test `test_hdlc.cpp` which
covers the following:
- Verify behavior of `Hdlc::FrameBuffer` (single frame buffer),
- Verify behavior of `Hdlc::MultiFrameBuffer` (FIFO queue),
- Verify behavior of `Hdlc::Encoder` and `Hdlc::Decoder`,
- Test encoder/decoder with randomly generated frames (fuzz test).
In the observed deepest CoAP process when handling JOIN_FIN, the large
local variables in the nested calls may take up to 2.5K, among with
the three local CoAP headers would add about extra 1K since #3210 which
increases CoAP header from 128 to 512.
This commit adjusts stack to be of 5K by increasing 1K to help commissioning
process goes correctly.
In #3210, CoAP header is increased from 128 to 512. Multiple
local CoAP header variables are declared in nested calls during
CoAP process, easily causing limited stack space overflow.
This commit tries to reuse existing local header variable to
reduce stack usage.
This commit changes the logs from `LinkRaw` class. With this change
the logs use debug log level and MAC log region. This change helps
reduce the spinel log traffic from RCP (NCP in radio-only mode).
This commit simplifies the COAP modules by renaming `CoapBase` to
`Coap` and removing the now unnecessary sub-classes `ApplicationCoap`
and `ApplicationCoapSecure`.
This commit simplifies `ResponseQueue`, `CoapBase`, `CoapSecure` to
use `TimerMilliContext` and `TaskeltContext`. This change removes
the need for sub-classes to provide the timer and tasklet callback
handlers.
This commit ensures to not re-start the `mStateUpdateTimer` from its
callback, when router role is disabled. This addresses the issue where
a mode change (disabling router role) could cause the timer to
continue to fire indefinitely, further causing device to attempt to
reattach from each timer callback.
Thanks to Conor O'Neill (@conormoneill) for discovering and debugging
this issue.
This commit changes/simplifies the `SourceMatchController` class to
use the `Mac::Address` class API to reverse an extended address
when adding/clearing an address.
This commit moves the logging of a message transmission status and
updating of the counters in `MeshForwarder::HandleSentFrameToChild()`
inside an `if` block checking for the message to be indirect. This
change addresses an issue where message transmissions to a non-sleepy
child could be logged and counted twice from both `HandleSentFrame()`
and `HandleSentFrameToChild()`.
This commit adds new spinel capability definitions to specify the
FTD, MTD or RADIO build configurations. Depending on the OpenThread
build configurations the corresponding capability is included in
`SPINEL_PROP_CAPS` list.
The leader does not maintain network data in non-volatile memeory. As a
result, it is necessary for a recently-restored leader to obtain network
data from a neighboring device.
Add OPENTHREAD_CONFIG_INTIIAL_LOG_LEVEL config setting to enable
starting OpenThread with a lower log level that the maximum compile-time
setting. Useful when OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL is
defined to 1.
This commit removes the call to clear the `mRouterTable` from
`SetStateRouter()` and instead performs it before processing of a
received RouteTlv (before `ProcessRouteTlv()`). This ensures that
router table and router id allocation list are not deleted after a
router node reset recovery.
This change addresses a rare subtle issue where if a router node and a
leader node are reset sequentially within a short time interval, the
router node upon reset can delete the router id allocation list
(RouteTlv) which in turn causes the leader to ignore "MLE Link Accept"
message it receives from router (after leader resets and tries to
recover) and thus cause the leader to form a new partition. This can
potentially lead to a situation where the two nodes stay in two
partitions without merging.
This commit introduces sub-MAC layer (class `Mac::SubMac`) in
OpenThread implementing a subset of IEEE802.15.4 MAC primitives which
are shared by both MAC layer (in FTD/MTD modes) and Raw Link (Radio
only mode).
The sub-MAC layer handles the following (if not provided by radio
platform):
- Ack timeout for frame transmission,
- CSMA backoff logic,
- Frame re-transmissions,
- Energy scan on a single channel and RSSI sampling.
It also act as the interface (to radio platform) for setting/getting
radio configurations such as short or extended addresses and PAN Id.
In addition, this commit contains following improvements in `Mac`:
- The implementation of `STAY_AWAKE_BETWEEN_FRAGMENTS` (delay sleep)
feature is simplified by adding a new state variable tracking if
sleep is being delayed and canceling sleep delay on start of any
operation.
- Member variables in `Mac` class are re-ordered to avoid alignment
gaps.
- `Mac` timers are combined into one which is used for Active Scan,
Data Poll timeout, and delaying sleep.
556d7d9 Merge pull request #532 from sbutcher-arm/version-2.14.0
c1b9892 Update library version number to 2.14.0
b35e59d Refine the language in the ChangeLog
681edee Fix language and formatting in ChangeLog
06d80cf Fix merge of Changelog 128bit CTR_DRBG entry
de13963 Merge remote-tracking branch 'restricted/pr/520' into development-restricted-proposed
cdd1a6c Merge remote-tracking branch 'restricted/pr/510' into development-restricted-proposed
2ab14bb Clarified new platform errors in the ChangeLog
e51d4b3 Merge remote-tracking branch 'public/pr/2054' into development-proposed
6aa9fb4 Add ChangeLog entry
9924bdc Deprecate hardware acceleration errors
bcca58c Add common feature unavailable error
d83448b Merge remote-tracking branch 'public/pr/2052' into development-restricted-proposed
53b45ec Merge remote-tracking branch 'public/pr/2079' into development-restricted-proposed
bbc31b4 Merge remote-tracking branch 'public/pr/2085' into development-restricted-proposed
93a9b49 Merge remote-tracking branch 'public/pr/2077' into development-restricted-proposed
361ce6c Merge remote-tracking branch 'public/pr/2127' into development-restricted-proposed
c818131 Merge remote-tracking branch 'public/pr/2140' into development-restricted-proposed
241823a Merge remote-tracking branch 'public/pr/1641' into development-restricted-proposed
42ab4ae Merge remote-tracking branch 'public/pr/2167' into development-restricted-proposed
51b6abb Merge remote-tracking branch 'public/pr/2165' into development-proposed
f143a78 Adapt ChangeLog
7213744 Fix typo in comment
2981d8f Change to positive flow for all cases
93ace01 Revert positive flow check
b430d9f Change to positive checks
19779c4 Some style and documentation fixes
5ed8c1e Avoid using restartable and alternative ECP imp.
d3445da Adapt ChangeLog
b75ffb5 Don't perform binary comparison of CRL issuer and CA subject
1f8527f Move static x509_name_cmp() in library/x509_crt.c
a8b13d7 Add tests for relaxed CRL-CA name comparison
06f88e9 Merge remote-tracking branch 'public/pr/2007' into development-proposed
76646a4 Merge remote-tracking branch 'public/pr/1777' into development-proposed
2705bea Merge remote-tracking branch 'public/pr/2095' into development-proposed
710f203 Merge branch 'iotssl-1770' into development_thomas_dee
5517755 Improve wording and formatting of ASN.1 write module documentation
cec1c26 Break overly long line in library/x509_create.c
ee334a3 Remove Doxygen tags from documentation of private structure
beffcd8 Update hardcoded certificates in library/certs.c
6e1adee Regenerate test files
381c77c Change serial in test-ca.crt from 0 to 3 to circumvent ASN.1 bug
b12fd31 Adapt ChangeLog
cb93813 Don't perform binary comparison of CRL issuer and CA subject
0f6903d Move static x509_name_cmp() in library/x509_crt.c
52acdb5 Add tests for relaxed CRL-CA name comparison
b963081 Generate tests/data_files/test-ca_cat[12|21].crt from Makefile
386f99c Generate cli-rsa* CSRs and CRTs through Mbed TLS applications
0dd1139 Generate server5.req.ku.sha1 through Mbed TLS application
ebc1f40 Generate server2* CSRs and CRTs through Mbed TLS applications
b837775 Generate test-ca* CSRs and CRTs through Mbed TLS applications
50cb93a Generate server1* CRTs and CSRs through Mbed TLS applications
56e8463 Add 'password' cmd line parameter to cert_req example program
f745733 Add 'md' cmd line parameter to cert_req example program
2b161c3 Fix compilation issue
936d284 Minor fixes
8493f80 conditionaly compile ECDH and ECDSA alt functions
2b5be1e Fix ChangeLog entry for #2069
0bb204c Adapt ChangeLog
7904f94 Merge remote-tracking branch 'public/pr/1099' into development-proposed
4a865ef Add ChangeLog entry for PR #1618 - ARM DSP instruction support
d5bf428 Merge remote-tracking branch 'public/pr/1618' into development-proposed
5706452 Merge remote-tracking branch 'public/pr/2056' into development-proposed
b4e5451 Merge remote-tracking branch 'public/pr/2070' into development-proposed
17a0fab Merge remote-tracking branch 'public/pr/2111' into development-proposed
02ef525 Merge remote-tracking branch 'public/pr/2107' into development-proposed
a07d86e Merge remote-tracking branch 'public/pr/1902' into development
ef263eb Merge remote-tracking branch 'public/pr/1993' into development
3869384 Merge remote-tracking branch 'public/pr/2031' into development
da09561 Merge remote-tracking branch 'public/pr/2142' into development
ddc9e26 Merge remote-tracking branch 'public/pr/1627' into development
78dd2e5 Merge remote-tracking branch 'public/pr/1806' into development
1daecb4 Merge remote-tracking branch 'public/pr/1281' into development
e783f4a Merge remote-tracking branch 'public/pr/1609' into development
b10c660 Detect unsigned integer overflow in mbedtls_ecp_check_budget()
abdf67e Cast number of operations to `uint` in MBEDTLS_ECP_BUDGET
0eb8fb8 Correct typo in documentation of MBEDTLS_SSL_RENEGOTIATION
76cf60b Remove merge conflict marker in ssl-opt.sh
e4f965d Adapt ChangeLog
169712e Merge remote-tracking branch 'restricted/pr/390' into development
a74faba aes: xts: Correct NIST 80-38E to 800-38E
8381fcb aes: xts: Update inaccurate comments
cc40d86 Improve documentation of mbedtls_ssl_get_verify_result()
a966fde Fix some documentation typos and improve a comment
c774e32 Merge remote-tracking branch 'restricted/pr/517' into development
837f821 Merge remote-tracking branch 'public/pr/1990' into development
ca29fdf Fix some typos in documentation and comments
bcedb92 Merge branch 'development' into iotssl-1260-non-blocking-ecc-restricted
c028afb Merge pull request #2121 from dgreen-arm/mbedtls-jenkinsfile
b51e267 Add Jenkinsfile for PR job
f24c336 Adapt ChangeLog
dd3ab13 Fail when encountering invalid CBC padding in EtM records
198611d Add missing return value check in ECDSA test suite
96f3b4e Remove yotta support from check-files.py
b25cb60 Add a comment to clarify code flow
a5a3e40 Fix missing dereference.
7a28e99 Expand test to ensure no assumption on output
90f31b7 Improve readability by moving counter decrement
a58e011 Fix alignment in a macro definition
b843b15 Fix function name to fit conventions
c0edc96 Add comment on internal function API
d8b73f2 Remove unnecessary calls to init() from free()
c37423f Fix misleading sub-state name and comments
5267b62 Change error description
a27190b Rename platform error code and value
25781f9 Fix missing check in example client
ee68cff Fix or improve some comments (and whitespace)
32df911 Fix documentation of what functions restart when
7e1f3be Adapt ChangeLog
f0bbd7e Misc documentation fixes/improvements.
6346a75 Merge branch 'development' into iotssl-1260-non-blocking-ecc-restricted
0b44d5c Zeroize sensitive data in aescrypt2 and crypt_and_hash examples
805f2e1 Add missing zeroization of buffered handshake messages
9580528 ssl-opt.sh: fix typo in mtu settings
b459346 ssl-opt.sh: add a check for i686 targets
7782605 ssl-opt.sh: add comments regarding ciphersuite forcing
748face ssl_tls: fix maximum output length
7c6df83 ssl-opt.sh: revert unnecessary "autoreduction" checks
7311c78 ssl-opt.sh: force ciphersuites to reduce mtu size
780f0a4 Reinitialize PK ctx in mbedtls_pk_parse_key before reuse are free
cfa2e33 Omit runtime configuration of calloc/free if macro config enabled
e5fecec Add test for MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO to all.sh
8df1023 Add explicit unsigned-to-signed integer conversion
ac2ead0 Improve deterministic test for prime testing
e3f95ed Fix bias in random number generation in Miller-Rabin test
e0e7ddf Changelog: Add entry for prime validation fix
a0b67c2 Bignum: Deprecate mbedtls_mpi_is_prime()
da31fa1 Bignum: Fix prime validation vulnerability
64eca05 Bignum: Add tests for primality testing
b728c29 Bignum: Remove dead code
3332937 Changelog: Add entry for prime test improvement
b8fc1b0 RSA: Use MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR
a3cb7eb Bignum: Add test for improved prime generation
f301d23 Bignum: Improve primality test for FIPS primes
35f2f30 ssl-opt.sh: change expected pattern from 'resend' to 'autoreduction'
ef43ce6 Dtls: change the way unlimited mtu is set for client hello messages
abe6003 Adapt ChangeLog
095d9cf Fix ordering of free()ing of internal structures in ssl_server2
0fc9cf4 ssl-opt.sh: increase proxy mtu sizes to contain entire datagrams
1624e2e Avoid overly long lines X.509 DN attr array def in x509_create.c
35b6854 Replace reference to RFC 3280 by reference to newer RFC 5280
cfc47ba Correct some indentation and line lengths in x509_create.c
d355e69 Rename `tag` to `default_tag` in x509_attr_descriptor_t
d0e21fb Improve documentation of ASN.1 string-writing functions
d2c9009 Improve documentation of x509_attr_descriptor_t
dc71ef8 Adapt ChangeLog
0c161d1 Fix bounds check in ssl_parse_server_psk_hint()
948fe80 ssl-opt.sh: adjust test timeouts to fit slower targets
6290dae Disable dtls fragmentation for ClientHello messages
52f8491 ssl-opt.sh: adjust tests to fit slower targets
617a321 Adapt ChangeLog
30a9510 Fix memory leak and freeing without initialization in cert_write
16b1bd8 bn_mul.h: add ARM DSP optimized MULADDC code
d264258 Make inclusion of stdio.h conditional in x509_crt.c
95c5575 check-files: exclude .git and third-party files
404aa65 Add ChangeLog entry for Windows threading fix
6e3606e Fix run-test-suites.pl to screen for files
427df37 Don't try to disable ASLR
5c39d7a Remove redundant check in all.sh
bd90a8c In keep-going mode, don't hard-fail on some tests
a9daa5c Look for documentation only in specific directories
65593d2 rsa: pss: Add no possible salt size tests
80d99ea rsa: pss: Extend tests for variable salt length
3725bb2 rsa: pss: Enable use of big hashes with small keys
0592ea7 Merge remote-tracking branch 'public/pr/1140' into development
1afc767 Merge remote-tracking branch 'public/pr/1758' into development
c86993e Merge remote-tracking branch 'public/pr/1970' into development
c0514bf Added ChangeLog entry for yotta support removal
3ad2efd Remove Yotta support from the docs, tests and build scripts
487cdf5 In keep-going mode, don't hard-fail on some auxiliary script
2561a50 Fix "make WINDOWS_BUILD=1 clean" on non-Windows hosts
7c025a9 Generalize dh_flag in mbedtls_mpi_gen_prime
eba6c9b changes requested by @hanno-arm - renamed `mbedtls_asn1_write_any_string` to `mbedtls_asn1_write_tagged_string` - renamed `x509_at_oid_from_name` to `x509_attr_descr_from_name`
54a7c62 Minor style changes
5a481f1 Update error.h count for SSL
12e4a8b Improve documentation wording and formatting
1c1c20e Fix some whitespace issues
ff21572 rsa: pss: Use size_t when computing signatures
125af94 Merge branch 'development-restricted' into iotssl-1260-non-blocking-ecc-restricted
53546ea Update library version number to 2.13.1
5d40f67 Merge remote-tracking branch 'public/pr/1927' into development-restricted
d2ef254 Don't define _POSIX_C_SOURCE in header file
f5106d5 Don't declare and define gmtime()-mutex on Windows platforms
323d801 Correct preprocessor guards determining use of gmtime()
03b2bd4 Correct documentation of mbedtls_platform_gmtime_r()
a50fed9 Correct typo in documentation of mbedtls_platform_gmtime_r()
6f70581 Correct POSIX version check to determine presence of gmtime_r()
c52ef40 Improve documentation of mbedtls_platform_gmtime_r()
7dd82b4 platform_utils.{c/h} -> platform_util.{c/h}
5a7fe14 Don't include platform_time.h if !MBEDTLS_HAVE_TIME
9fbbf1c Improve wording of documentation of MBEDTLS_PLATFORM_GMTIME_R_ALT
c946888 Fix typo in documentation of MBEDTLS_PLATFORM_GMTIME_R_ALT
921b76d Replace 'thread safe' by 'thread-safe' in the documentation
9a51d01 Improve documentation of MBEDTLS_HAVE_TIME_DATE
acef292 ChangeLog: Add missing renamings gmtime -> gmtime_r
4e67cca Improve documentation of MBEDTLS_HAVE_TIME_DATE
48a816f Minor documentation improvements
651d586 Style: Add missing period in documentation in threading.h
6a73978 Rename mbedtls_platform_gmtime() to mbedtls_platform_gmtime_r()
be2e4bd Guard decl and use of gmtime mutex by HAVE_TIME_DATE and !GMTIME_ALT
5f95c79 Remove another mentioning of IAR from config.h
272675f Correct documentation of mbedtls_platform_gmtime()
cfeb70c gmtime: Remove special treatment for IAR
94b540a Avoid redefining _POSIX_C_SOURCE
45e3020 Document that IAR gmtime_s() is auto selected
433f911 Check for IAR in gmtime macros
e58088e Clarify docs for MBEDTLS_HAVE_TIME_DATE
c29c34c Improve wording of gmtime feature in ChangeLog
3c9733a Fix typo in comment for gmtime macro defines
193fe89 Add missing _POSIX_C_SOURCE define in threading.h
ca04a01 Document shorthand gmtime macros
8c9a620 Fix missing word in ChangeLog entry for gmtime()
2099606 Use gmtime_s() for IAR
e9b10b2 Define _POSIX_C_SOURCE in threading.c before POSIX detection
c2f948b Fix grammar in docs for MBEDTLS_HAVE_TIME_DATE
43e4ff0 Make definitions easier to understand
521e8a9 Fix to comment to correct module description
82986c1 Disable 3d test with no good openssl version
c1eda67 Disable fragmentation tests with openssl bugs
da642d9 Implicit _endthread call: comment changed
e1b82ad Added spaces after type casts
acedc91 Fix build issue on clang
e46c329 restore missing operation to CMakeLists.txt
85fcb58 Refactor test code for CTR DRBG to clarify test functions
b0ad581 Remove the invalid input for platform module
0ff4e0b Add platform error codes
6275be3 Re-factor test functions and add support for data_t parameters
b7ebbca compile time warning of 128bit ctr_drbg keys and standardized warnings
ce266e4 use single define for 128bit key for ctr_drbg and update test dependencies
6a4f224 ssl-opt.sh: change expected output for large srv packet test with SSLv3
a658d7d Fix style for mbedtls_platform_gmtime()
c99b12b Fix documentation for MBEDTLS_HAVE_DATE_TIME
5e863e0 Adapt ChangeLog
aa71500 Fix bug in SSL ticket implementation removing keys of age < 1s
1d73993 ssl-opt.sh: Add DTLS session resumption tests
aecf8c9 adding more ctr_drbg test vectors (CAVP 14.3)
e4b77b9 ctr_drbg: add a few test vectors from CAVP 14.3
cfc1de7 ctr_drbg: sample vectors from NIST
5ef5a9a ctr_drbg tests: unify validate functions
4c78665 ctr_drbg tests: new validation function that doesn't reseed
ef0624f ctr_drbg tests: make input sizes flexible
ed7da59 ctr_drbg: add comments relating the code with the NIST specification
954f987 change warning about 128bit keys to print
eb73f7a fix trailing white spaces
04354b0 add ChangeLog entry
c9547cc add NIST test vector for 128 bit keys (not passing yet).
604e60d add default value for CTR DRBG key size
a4588d4 enable the use of variable size keys in ctr_drbg (was hard-coded 256bit before)
248e27c Remove redundant statement from x509_get_current_time
a7b9f15 Add ChangeLog entry for configurable gmtime() in platform
1abb368 Make gmtime() configurable at compile-time
ffbdc61 Add test/zeroize.c
0b54419 More grammar alignment
d717743 Fix check-names.sh fail with USE_GMTIME macro
97f3ecb Document dependency on gmtime, gmtime_r & gmtime_s
824dfb3 Add ChangeLog entry for use of gmtime
ce6eebb Use gmtime when target is not windows or posix
aa22030 Further wording improvements
27a0460 Unify the grammar of descriptions
c2e5cdd Explain aescrypt2 better and warn that it doesn't do things properly
6b9cbb8 Copyediting
bb4bbbb Resolve PR review comments
6f90ed8 Fix CI failure
4e64e0b Fix after PR comments
7b01244 Add tests for mbedtls_cipher_crypt API
604ccc6 Add ChangeLog entry
636179a Fix typo
278af45 Fix hmac_drbg failure in benchmark, with threading
c8c12b6 Add NULL pointer check for consistency
78d7e8c Rename internal variable for consistency
4edb9cb Justify some max_ops settings in test_suite_pk
823c915 Fix mis-merged ChangeLog
597dbf8 Adds a filter to run-test-suites.pl to exclude data files
42c73a9 Merge remote-tracking branch 'origin/development' into development
755890f Remove trailing whitespace
e931d0e Replace Windows API threading with CRT functions
5c7e76e Remove trailing whitespace
da4029d ssl_server2: add buffer overhead for a termination character
95e2eca Fix IAR warning
c19fc55 Add missing large and small packet tests for ssl_server2
30e731d Added buffer_size and response_size options for ssl-server2. Added appropriate tests.
79d9b50 Merge branch 'development' into iotssl-1260-non-blocking-ecc-restricted
558da9c Make SSL error code more generic
b5d668a post-merge: adapt ssl-opt.sh to new error values
d0a66cc post-merge: fix ECDSA test vector testing
da19f4c Merge branch 'development' into iotssl-1260-non-blocking-ecc-restricted
020c823 fixed segmentation fault
c150f0d fixed missing initializer
c5c9aaf Merge branch 'development' of https://github.com/thomas-dee/mbedtls into development
23f954d Fix string downcast to `PrintableString` as issued in #1033
3efa888 Update ChangeLog with dtls sample IPv6 change
6fd96ad Change the default IP addresses for DTLS samples
ceb7b12 Readme with a short description of each sample program
a4dd783 Fix some typos in comments
bb216bd Fix MSVC 64-bit warnings
196d133 Fix uninitialised variable in some configs
46ba7f3 Avoid running useless code in tests
fd87e35 Improve comments on parity trick
95aedfe Remove redundant test on curve type
11556e2 Clarify initialization of T in mul_comb()
0b23f16 SSL: rework restart state handling
6348181 Explicit state assignments in ecdsa too
4ed1dab ECP: move state changes closer to operations
c9efa00 ECP: Use explicit state assignments
db4a8eb Use ECP_RS_ENTER/LEAVE() macros, as in ECDSA
b948f7d Don't bother to free NULL subcontexts
bfa1972 Remove redundant checks, save a few muls
28d1628 Avoid unnecessary xxx_copy() calls
5bd38b1 Replace memset() calls with xxx_init() calls
92cceb2 Make some names more consistent
ebac5d3 Fix some whitespace & style issues
eaf55be Misc documentation fixes/improvements
7037e22 Improve comments and doc for ECP
daf0491 Rework state saving for verify_chain()
a968843 Improve some comments in verify_chain()
3627a8b Clarify state handling in find_parent(_in)()
83e923b Better initialisation of ver_chain
8b7b96b Fix typo
d55f776 Skip context allocation if restart disabled
aaa9814 Uniformize ifdefs to ECDSA_C+ECP_RESTARTABLE
fe68770 Keep PK layer context in the PK layer
0bbc66c Dynamically allocate/free restart subcontext in PK
15d7df2 Introduce mbedtls_pk_restart_ctx and use it
98a6778 Better document some function arguments
b889d3e Clarify & uniformise test comments
5faafa7 Update X.509 test certs' Readme
c9e16a9 Disable restartable ECC by default
9897cc9 Update ChangeLog
3bf49c4 Enable restart for certificate verify
fed37ed Extract some code to separate function
39eda87 Make more auto variables const
6b7301c Change restart context type.
d27d1a5 Clean up existing SSL restartable ECC code
8b59049 Make verify() actually restartable
c11e4ba Rework type for verify chain
18547b5 Refactor find_parent() to merge two call sites
a4a5d1d Adapt function signatures to rs_ctx + ret
be4ff42 Call crt_check_signature from one place only
d19a41d Add tests for verify_restartable()
bc3f44a Introduce mbedtls_x509_crt_verify_restartable()
21b7719 Add ChangeLog entry for current progress
32033da Test some more handshake flows
23e4162 ECDH: not restartable unless explicitly enabled
1f1f2a1 Adapt ServerKeyEchange processing to restart
862cde5 Add restart support for ECDSA client auth
2350b4e Adapt ECDHE_ECDSA key exchange to restartable EC
b3c8307 Adapt ssl_client2 to restartable EC
171a481 Add a ChangeLog entry for changes so far
31f0ef7 Fix style issues introduced earlier
1f59606 Make PK EC sign/verify actually restartable
c4ee9ac Add tests for restartable PK sign/verify
82cb27b PK: declare restartable sign/verify functions
fd838da Comment cosmetics
66ba48a Make ECDH functions actually restartable
71b2c53 Add tests for restartable ECDH
c90d3b0 Update doc for restartable ECDH functions
af081f5 Make ECDSA sign actually restartable
50b63ba Use ecp_gen_privkey() in ECDSA sign
6754396 Improve sign/key_tries handling
b90883d Prepare infra for restartable sign
eb402f3 Add test for restartable signature
addb10e Create functions for restartable sign
5314f23 Make verify_restartable() actually restartable
a0c5bcc Add infrastructure for ecdsa_verify_restartable()
722e515 Add test for ecdsa_read_signature_restartable()
32aa437 Declare ecdsa_read_signature_restartable()
1ed2505 Add some negative testing for ecdsa_verify()
c751148 Make some macros/functions public
b5a50e7 Always declare restartable function variants
0ff17df Fix ECDSA test descriptions
4b9c51e Rename EARLY_RETURN -> RESTARTABLE
411079f Rm obsolete comment
a7937f9 Add public function generating private keys
1631d63 Make muladd_restartable() actually restartable
54dd652 Introduce muladd_restartable() and its sub-context
a08cd1a Avoid re-checking argument on restart
3a25612 Reset ops_done at the right time
53fbd63 Remove redundant check
884569c Avoid code duplication in ecp_mul()
646393b Move ops count to top-level context
8467e68 Stop checking for argument change
3cade22 Switch to restart context internally
8f28add Update documentation for new design/API
b739a71 Start moving to new design/API
45fd016 Rename multiplication-specific restart context
e58f65a Expand documentation with notes and warnings
e685449 Scale ops count for larger curves
d3a0ca8 Add tests about number of restarts
9c5c78f Fix indicative values of ops counts
1c678e0 Update doc about minimum max_ops value
213541a Make the first precomp loop restartable
ae55707 Turn double loop into single loop
e2d7cb3 Start splitting precompute_comb()
67c83fb Give a constant a name
fc3e0be Separate auxiliary array in precompute_comb()
07bf6f5 Tune T ownership code + comments
085b1df Allow T to be computed in multiple steps
c9c0aa6 Remember precomputed table
c5d844b Full restart support in ecp_mul_comb_core()
2fad7ae Start actually splitting computation
8962ddb Don't write to destination until we're done
78d564a Add check for changing arguments
77af79a Add proper allocation of restart context
62738e9 Further restrict variable scope by moving code
391f441 Move more code to separate function
24be795 Group related code together
4b2336d Move some more code to new function
22be635 Re-order some more code
ec5606a Extract code to separate function
7306dff Group related code together
510d5ca Add early return test + fake implementation
054433c Add mbedtls_ecp_set_max_ops()
5e3c62f Add MBEDTLS_ERR_ECP_IN_PROGRESS
c3a3bc7 Add config flag MBEDTLS_ECP_EARLY_RETURN
225b37a Fix typos in comment
git-subtree-dir: third_party/mbedtls/repo
git-subtree-split: f00d4bea1709e24c6f407b6aa296e8d283bca684
This commit changes `RadioSpinel` to determine if Ack is present
directly from the received spinel TxDone frame (i.e. check the
remaining unparsed length of spinel frame to determine if ack frame is
included by Radio Co-Processor (RCP)). This change helps simplify the
code by removing the requirement for `RadioSpinel` as the layer
between OpenThread core and RCP to parse the 15.4 frame.
It introduces a way that user can define product specific configuration
for OpenThread build in Android Environment.
Also ensure that ot-cli and ot-ncp use the same mbedtls config with
ot-core.
This commit changes the logic in `RadioSpinel` such that the HDLC
socket is always added to read fd set in `UpdateFdSet()` replacing
the existing code where read was not allowed during an ongoing 15.4
frame transmission. Note that during a frame transmission, radio can
potentially receive a frame (e.g. during CSMA backoffs). Also other
spinel frames such as logs can be received during tx.
Since RFC-7252 a number of additions have been made to the CoAP
Content-Format registry which is maintained by the IANA. This patch
updates the list in OpenThread. Notably:
- Standards references are made for each entry
- Some invalid assignments have been removed (notably PKCS10, PKCS7 and
JWS)
- New entries have been added for COSE, JSON patches, merge patches,
CBOR, CWT, CoAP groups, SENML and SENSML.
This commit defines as new set of `State` enumerations which
combines the two state variables `otRadioState` and `TxState`
into a single `mState` variable.
This commit changes `HdlcInterface::Read()` method to ignore `errno`
`EINTR` (interrupt by a signal) during socket `read()`. It also
uses `exit()` on error.
This commit changes `HdlcInterface` method `SendFrame()` to handle
the case where the socket associated with the HDLC interface is
not immediately ready to accept the frame. With the change in this
commit `SendFrame()` will block and wait for socket to become
writable within a timeout interval.
This commit uses a separate frame buffer (`mAckRadioFrame`) for saving
acks instead of using `mRxRadioFrame` (which is used for received
frames).
This ensures that the ack frame won't be overwritten by a subsequently
received frame.
- Ack frame is read and saved in `HandleTransmitDone()` (which we get
to from `HandleSpinelFrame() -> HandleResponse() ->
HandleTransmitDone()`).
- But note that the saved ack frame is not immediately used, it is
passed from `RadioSpinel::Process()` to next layer using
`otPlatRadioTxDone()` callback.
- We can technically read and decode multiple spinel frames from a
single call to `mHdlcInterface.Read()`:
- So we can possibly get a TxDone spinel frame response where we
read and save the ack frame;
- And before getting the chance to get to `Process()`, from the same
`mHdlcInterface.Read()` we can get a `VALUE_IS(STREAM_RAW)` spinel
frame (i.e., receive a frame) which would then overwrite the ack
frame (assuming we use `mRxRadioFrame` to save the ack)
- Using a separate ack frame (`mAckRadioFrame`) addresses this issue.
This commit removes the destination address and PAN Id checks in
`RadioSpinel::RadioReceive()` method. Radio Co-Processor (RCP)
typically provides such filtering. If not, the same checks are
performed by OpenThread core in `Mac:: HandleReceivedFrame()`.
This commit adds a new class `HdlcInterface` under POSIX App which
performs HDLC encoding/decoding and read/write operations on the
interface to Radio Co-Processor (RCP). `RadioSpinel` is updated to
use the new class.
This commit adds a new spinel property `SPINEL_PROP_PHY_PCAP_ENABLED`
to allow packet capture (pcap) to be enabled independently of
link-raw mode. This allows pcap to be used on NCPs while running full
Thread protocol.
Thread defines UDP proxy as a feature to allow secure, two-way
communication of Thread Management Commands between the Commissioner
and any Thread Device in the Thread Network via the Border Agent.
This commit renames the existing UDP proxy feature which forwards UDP
packets back and forth between Host and NCP to UDP forward.
c0a63bd Remove duplication of some entries in the ChangeLog
b70158b Merge pull request #505 from sbutcher-arm/mbedtls-version-2.13.0
4d075cd Update library version number to 2.13.0
b5afb97 Revised and clarified ChangeLog
0bbb4fc Merge branch 'development' into development
552754a Merge remote-tracking branch 'public/pr/1988' into development
68dbc94 Merge remote-tracking branch 'public/pr/1951' into development
e50128a Merge remote-tracking branch 'public/pr/1994' into development
07de4c0 Merge remote-tracking branch 'public/pr/1920' into development
822a9cc Merge remote-tracking branch 'public/pr/1994' into development-restricted
108992e Add MTU auto-reduction test with valgrind
37029eb Skip MTU auto-reduction test when running valgrind
f34a4c1 UDP proxy: Correct debug output for delay_srv option
a591c48 Correct typo in debug message
83ab41c Correct typo in comment
cd9dcda Add const qualifier to handshake header reading functions
39b8bc9 Change wording of debug message
ef7afdf Rename another_record_in_datagram to next_record_is_in_datagram
c573ac3 Fix typos in debug message and comment in ssl-tls.c
7c48dd1 ssl-opt.sh: Add function extracting val or default val from config.h
dc1e950 DTLS reordering: Add test for buffering a proper fragment
8a552cf Merge remote-tracking branch 'public/pr/1920' into development-restricted
3af567d Merge remote-tracking branch 'restricted/pr/437' into development-restricted
129fa82 Merge remote-tracking branch 'restricted/pr/470' into development-restricted
7f85563 Merge remote-tracking branch 'restricted/pr/491' into development-restricted
97a1c13 Correct typo in documentation of MBEDTLS_SSL_DTLS_MAX_BUFFERING
02f6f5a Adapt ChangeLog
9ce5160 Merge remote-tracking branch 'public/pr/1965' into development
676d3fd Merge remote-tracking branch 'public/pr/1129' into development
9d5a9e1 Merge remote-tracking branch 'public/pr/1625' into development
14dac09 Merge remote-tracking branch 'public/pr/1918' into development
1846e40 Merge remote-tracking branch 'public/pr/1939' into development
9598845 Merge remote-tracking branch 'public/pr/1955' into development
4613772 Merge remote-tracking branch 'public/pr/1915' into development
e604556 ssl-opt.sh: Don't hardcode varname in requires_config_value_xxx()
4103810 Style: Correct indentation in UDP proxy code
eefe084 Style: Spell out PMTU in ssl.h
0207e53 Style: Correct typo in ssl-tls.c
b841b4f ssl-opt.sh: Remove reference to Github issue
3b8b40c ssl-opt.sh: Add function to skip next test
6f032a6 Merge remote-tracking branch 'public/pr/1963' into development
badeb07 Merge remote-tracking branch 'public/pr/1967' into development
b9a0086 ssl-opt.sh: Explain use of --insecure in GnuTLS client tests
ea85848 Merge remote-tracking branch 'public/pr/1979' into development
bc2498a Style: Add numerous comments indicating condition guarded by #endif
cf46945 Style: Add empty line before comment in UDP proxy code
d584777 Style: Group buffering-related forward declarations in ssl_tls.c
360bef3 Reordering: Document that only HS and CCS msgs are buffered
4f432ad Style: Don't use abbreviations in comments
b8f5014 Add explicit MBEDTLS_DEBUG_C-guard around debugging code
f0da667 Style: Add braces around if-branch where else-branch has them
ecbdf1c Style: Correct indentation of debug msgs in mbedtls_ssl_write_record
3f7b973 Correct typo in mbedtls_ssl_flight_transmit()
2800751 DTLS Reordering: Improve doc of MBEDTLS_SSL_DTLS_MAX_BUFFERING
159a37f config.h: Don't use arithmetical exp for SSL_DTLS_MAX_BUFFERING
2f5aa4c all.sh: Add builds allowing to test dropping buffered messages
a1adcca ssl-opt.sh: Add tests exercising freeing of buffered messages
5cd017f ssl-opt.sh: Allow numerical constraints for tests
6e12c1e Enhance debugging output
0e96585 Merge branch 'datagram_packing' into message_reordering
69ca0ad ssl-opt.sh: Remove wrong test exercising MTU implications of MFL
6b6f602 Merge branch 'iotssl-165-dtls-hs-fragmentation-new' into datagram_packing
c92b5c8 ssl-opt.sh: Add tests checking that MFL implies bounds on MTU
eb57008 Fix typo in documentation of mbedtls_ssl_set_datagram_packing()
1841b0a Rename ssl_conf_datagram_packing() to ssl_set_datagram_packing()
f4b010e Limit MTU by maximum fragment length setting
283f5ef Buffering: Free future record epoch after each flight
081bd81 ssl_write_handshake_msg(): Always append CCS messages to flights
c83d2b3 ssl_write_handshake_msg(): Allow alert on client-side SSLv3
34aa187 Force IPv4 for gnutls-cli DTLS tests
a63c1c3 pk_encrypt: Uniformize debugging output
25d882b Fix typos in programs/x509/cert_write.c
ae513a5 Minor formatting improvements in pk_encrypt and pk_decrypt examples
a70fb95 Adapt ChangeLog
bd336c1 Correct memory leak in pk_decrypt example program
55c11ba Correct memory-leak in pk_encrypt example program
b309b92 ssl_buffering_free_slot(): Double-check validity of slot index
12b72c1 UDP proxy: Fix bug in freeing delayed messages
65dc885 Use size_t for msg_len argument in ssl_get_reassembly_buffer_size()
1b20e8e Merge branch 'datagram_packing' into message_reordering
554b0af Fix assertion in mbedtls_ssl_write_record()
7428d4f Merge branch 'datagram_packing' into message_reordering
551835d ssl_write_handshake_msg(): Always append CCS messages to flights
2c98db2 ssl_write_handshake_msg(): Allow alert on client-side SSLv3
6353134 Merge branch 'datagram_packing' into message_reordering
11682cc Uniformly treat MTU as size_t
98081a0 Don't use uint8_t for bitfields
aa24937 Adapt ChangeLog
3546201 Merge branch 'datagram_packing' into message_reordering
a67dee2 Merge branch 'iotssl-2402-basic-pmtu-adaptation' into datagram_packing
f47a4af Fix a typo in comments
b8eec19 Implement PMTU auto-reduction in handshake
170e2d8 Merge branch 'iotssl-165-dtls-hs-fragmentation-new' into datagram_packing
68ae351 Fix some whitespace in documentation
c1d54b7 Add tests with non-blocking I/O
3d183ce Allow client-side resend in proxy MTU tests
903ee3d Merge branch 'datagram_packing' into message_reordering
01315ea Account for future epoch records in the total buffering size
a02b0b4 Add function making space for current message reassembly
175cb8f ssl-opt.sh: Allow resend in DTLS session resumption tests, cont'd
e180139 Add another debug message to ssl_buffer_message()
e356705 ssl-opt.sh: Add test for reassembly after reordering
101bcba UDP proxy: Allow more than one message to be delayed
55e9e2a Free future buffers if next handshake messages can't be reassembled
e605b19 Add function to free a particular buffering slot
96a6c69 Correct bounds check in ssl_buffer_message()
e0b150f Allow limiting the total amount of heap allocations for buffering
2a97b0e Introduce function to return size of buffer needed for reassembly
5bcf2b0 ssl-opt.sh: Allow spurious resend in DTLS session resumption test
e678eaa Reject invalid CCS records early
6b13afe Fix indentation
47db877 ssl_write_record: Consider setting flush variable only if unset
1f5a15d Check retval of remaining_payload_in_datagram in ssl_write_record()
ecff205 Remove stray bracket if MBEDTLS_ZLIB_SUPPORT is defined
f61ff4e ssl_server2: Remove redundant new line
d22c1b2 Merge remote-tracking branch 'upstream-public/pr/1932' into development
2f2d902 Add delay in test to avoid race condition
6611035 Try to further clarify documentation
000281e Fix "unused parameter" warning in small configs
f2f1d40 Improve wording in ChangeLog and documentation
6151298 Add missing requires_gnutls guards
9434713 Move the assertion
6aeaa05 Merge branch 'iotssl-165-dtls-hs-fragmentation-new' into datagram_packing
f362c29 ssl-opt.sh Add dependency on gnutls in two fragmentation tests
7be2e5b ssl-opt.sh: Preserve proxy log, too, if --preserve-logs is specified
4e1a9c1 ssl-opt.sh: Preserve proxy log, too, if --preserve-logs is specified
513815a Fix typo in debugging output
4cb782d Return from ssl_load_buffered_record early if no record is buffered
a1071a5 Compute record expansion at the right time
4532329 Add proxy-enforcement to a MTU test
9829315 Add missing dependency in ssl-opt.sh
58e9dc3 Allow GNUTLS_NEXT_CLI / GNUTLS_NEXT_SERV to be unset in ssl-opt.sh
050dd6a Improve documentation of ssl_set_mtu().
065a2a3 Fix some typos and links in comments and doc
02f3a8a Adjust timeout values for 3d test
caf8741 Fix typo in documentation of UDP proxy argument 'delay_cli'
3a0aad1 Rename `update_digest` to `update_hs_digest`
4422bbb Whitespace fixes
e00ae37 Omit debug output in ssl_load_buffered_message outside a handshake
6e7aaca Move MTU setting to SSL context, not config
0d4b376 Return through cleanup section in ssl_load_buffered_message()
34b03ef Remove redundant `else` statement
56cdfd1 Refine reordering tests
01ea778 UDP proxy: Add option to delay specific handshake messages
56d5eaa Mark SSL ctx unused in ssl_prepare_reassembly_buffer() if !DEBUG
8727304 Disable datagram packing in reordering tests
d488b9e Increase maximum number of buffered handshake messages
f103542 Adapt ChangeLog
b063a5f Update error codes
b34149c Add test for buffering of record from next epoch
5f066e7 Implement future record buffering
e384221 Add test for reordering of handshake messages
37f9532 Implement future message buffering and loading
6d97ef5 Use uniform treatment for future messages and proper HS fragments
44650b7 Introduce function checking sanity of the DTLS HS header
12555c6 Introduce function to parse total handshake length
0271f96 Introduce buffering structure for handshake messages
d7f8ae2 Introduce sub-structure of ssl_handshake_params for buffering
e25e3b7 Add function to check is HS msg is a proper fragment
d07df86 Make allocation of reassembly bitmap optional
56e205e Prepare handshake reassembly in separate function
9e1ec22 Return MBEDTLS_ERR_SSL_EARLY_MESSAGE for future HS messages
aa5d0c4 Add test for buffering out-of-order CCS
2ed6bcc Implement support for remembering CCS messages
40f5084 Add frame for loading and storing buffered messages
e74d556 Introduce function to indicate if record is fully processed
2699459 Move call to ssl_consume_current_message()
1097b34 Extract message-consuming code-path to separate function
4162b11 Make mbedtls_ssl_read_record_layer() static
a4b143a Remove nested loop in mbedtls_ssl_read_record()
02f5907 Correct misleading debugging output
327c93b Add parameter to ssl_read_record() controlling checksum update
e1dcb03 Don't send empty fragments of nonempty handshake messages
4a9d006 Add missing dependency in ssl-opt.sh
bc73e4a Allow GNUTLS_NEXT_CLI / GNUTLS_NEXT_SERV to be unset in ssl-opt.sh
d87a59c Adapt ChangeLog
7ae8a76 Add tests for datagram packing option to ssl-opt.sh
1c9a24c Disable datagram packing for various UDP proxy tests
c430523 Re-enable delayed CCS test
4d61591 Add cmd line option to ssl_client2 for datagram packing
e7675d0 Add cmd line option to ssl_server2 for datagram packing
04da189 Make datagram packing dynamically configurable
12405e7 Increase max_frag_len / MTU in fragmentation ref tests
7e77213 Fix unused variable warning in ssl_session_reset_int()
0defedb Fix unused variable warning in mbedtls_ssl_get_max_record_payload
f29d470 Reset in/out pointers on SSL session reset
4ccbf06 Minor improvements in ssl_session_reset_int()
2a43f6f Introduce function to reset in/out pointers
111fa49 TEST-ONLY: Remove delayed CCS test
b50a253 Move size check for records
67bc7c3 Don't immediately flush datagram after preparing a record
2b1e354 Increase record buffer pointer after preparing a record
3b23590 Log calls to ssl_flight_append() in debugging output
0448462 Increment record sequence number in ssl_write_record()
1985947 Store outgoing record sequence number outside record buffer
5aa4e2c Move deduction of internal record buffer pointers to function
3136ede Compute record expansion in steps to ease readability
141e767 Merge remote-tracking branch 'upstream-public/pr/1942' into development
6fba810 Merge remote-tracking branch 'upstream-public/pr/1938' into development
38110df Add interop test with unreliable connection
d26bb20 Add tests for empty CA list in CertificateRequest, TLS 1.0 & 1.1
0794d49 Skip some tests with valgrind (spurious resend)
1218bc0 Add simple interop tests (reliable connection)
3879fdf Merge remote-tracking branch 'public/pr/1955' into iotssl-165-dtls-hs-fragmentation-new
eb2b15a Improve ChangeLog wording for the commmit that Fixes#1954.
ad0fe92 Adapt ChangeLog
ad17fe9 Fix overly strict bounds check in ssl_parse_certificate_request()
aa9f3fd Merge remote-tracking branch 'upstream-public/pr/930' into development
2d56f0d Add test with unreliable connection
19c62f9 Add test for session resumption
7e89c17 Fix two typos in comments
72c2707 Add tests for MTU with renegotiation
b747c6c Add basic first tests for MTU setting
637e234 Merge remote-tracking branch 'public/pr/1915' into iotssl-165-dtls-hs-fragmentation-new
9468ff1 Implement support for MTU setting
0b1d9b2 Declare ssl_conf_mtu()
01ec4af Add ChangeLog entry
2cb17e2 Make handshake fragmentation follow max_frag_len
28f4bea Start implementing fragmentation
87a346f Always save flight first, (re)send later
9c3a8ca Clarify code a bit in write_handshake_msg()
31c1586 Start separating handshake from record writing
2c069df Fix typo in test_suite_entropy.function
08a4aeb HKDF: Add warning to partial functions
d0a78e9 HKDF: Fix style issue
9dc3be7 Improve wording in ChangeLog
9ebdcff Fix Wformat-overflow warning in ssl_mail_client.c
361f254 Adapt ChangeLog
7864090 Reset session_in/out pointers in ssl_session_reset_int()
446227a Enhance nist_kw with some NULL buffers tests
d1a4762 Use mbedtls_printf instead of printf
d8f4169 Merge remote-tracking branch 'upstream-public/pr/1598' into development
03bd484 Merge remote-tracking branch 'upstream-public/pr/1861' into development
cac0c1a Merge remote-tracking branch 'upstream-public/pr/1378' into development
603aee0 Merge remote-tracking branch 'upstream-public/pr/1816' into development
372b50b Add a ChangeLog entry for #1816
f48163a Merge remote-tracking branch 'upstream-public/pr/1834' into development
58e9c18 Fix Wformat-overflow warning in ssl_mail_client.c
5cb7017 Less obscure test suites template
d2d0112 Style fixes
440d873 Fix macro validation regex
ee6529e Add generate_test_code.py unit tests in all.sh
2179810 Pylint tests in all.sh
539aa06 Fix Python 2 & 3 compatibility in test_generate_test_code.py
32cbcda Fix Pylint errors in Python scripts
6302813 Replaced escaped_split() logic with regex
fcdf685 Make test function parsing robust
4084ec7 Fixed unit tests in test_generate_test_code.py
8d686bf Incorporated code revoew comments.
b31aa44 Fix style errors reported by pylint
aee05bb Add test suite framework summary
63ab501 Fix generate_test_code.py argument --helpers-file in CMakeLists.txt
27a35e7 Wildcard possible targets and document
5fcca46 Rename HexParam_t -> data_t for consistent coding style
62a5d7d Document status/error codes in helper.function
951a2c8 Improve documentation in mbedtls_test.py
e3b26af Improve documentation in generate_test_code.py
b98e6ee Replace asserts with exceptions in mbedtls_test.py
040b6a2 Wrap code to 79 character limit
936ea93 Strip whitespaces added by decode() function
00c4b09 Change intermediate data file extension to .datax
ff560f2 Rename makefile target gen-embedded-test - generate-target-tests
cfd8342 Use integer instead of string as test result
53faf5c Widen the test app columns
8a3628f Set PYTHON using ?= syntax
8f6e8cf Print line number with data file error
3b06f22 Replace asserts with exceptions in generate_test_code.py
c3521df Fix generate_test_code.py unit tests
0fa3504 Add missing MSVC typedefs
667f7f8 Fix generation of #line directives in Python 2
7776141 Don't generate lines with only whitespace
9b06f37 Give execute permissions to Python scripts
b73159d Remove white spaces caught by check-files.py
ddde34c Remove git conflict marker from test_suite_timing.function
7613534 Fix gcc-7 -Wformat-truncation warning
1ec7e6f Python3 compatible generate_test_code.py
78befd9 Rename generate_code.py -> generate_test_code.py
7eb5568 Set OS specific python executable name
b522929 Add support for per test suite helper functions
05d83fa Put parentheses around macro arguments
36e5fac Rephrase confusing function description
317efe8 Adapt new test gcm_bad_parameters() to on target testing changes
f0e42fb Add missing documentation and fix file doc strings
9540261 Incorporated code review comments
d61b837 Update unit tests for change in test suites code generator
b1c2d0f Use switch instead if if-else for dependency and expression checks.
d61a438 incorporate code review comment in embedded_test.function
663d470 Incorporate code review suggestions in mbedtls_test.py
599cd24 Update unit tests for code generator and make code generator more testable.
acc5473 Use FileWrapper class in place of file where line number is required
5e2ac1f Updated generate_code.py unit tests
4b54323 Unit test generate_copy.py
13c6bfb Gaurd test suite headers with suite dependency
8c4d5ba Update CMakeList.txt with new test suites code generator
cf32c45 Add missing headers and fix name change issues
1de892b Update code as old template and generator is replaced with new one
191e904 Replace old template and code generator with new ones. Keep names
975d97e Remove old test suite template and code generator script
2397bba Update test generator for use of struct for hex parameters
d30ca13 Combine hex parameters in a struct
5cfc068 Fix name conflict in function params after hexify/unhexify change
3e5d000 Update Greentea API header
47b4060 Fix RSA test suite bugged by hexify/unhexify change
392267a Fix missing data in the RSA test vectors file
b3a103c Put else in it's own line
d59391a Add support for sending hex parameters
46c9b1f Fix test functions and data after moving hexify/unhexify out
5e7f8df Print Greentea __testcase_name indicator for Greentea to mark the test
a57a420 Add hex parameter dispatch
184447e Add proper handling of hex data
f1aaec9 Intermediate hexify out change
9079170 Adapt code for scripting out hexify/unhexify code
3499a9e Add hex comparison function
0574632 Update Greentea client API calls
ee6c018 Unify test setup errors for sending to host
ec02448 Fix line no. directive
67735d5 Fix name conflict and implicit use of functions from string.h
7a0d84f On target test host test script
fff4904 mbed-os test code generator
1f29be7 Make target for on mbed testing
94aefaf Optimise makefile targets
4481464 Adapt ChangeLog
5b559ac Fix mbedtls_ssl_get_record_expansion() for ChaChaPoly and CBC
9f7798e Revert change of a return variable name
b363382 Add ChangeLog entry for bug #1890
f1124c9 Merge remote-tracking branch 'public/pr/1891' into HEAD
1b9b217 enforce input and output of ccm selftest on stack
5f26b11 Change test dependencies to RC4 from DES
c796573 Add Chacha dependency to the stream cipher field
608a487 Fix memory leak in ecp_mul_comb() if ecp_precompute_comb() fails
6c34268 Merge remote-tracking branch 'restricted/pr/501' into development-restricted
f11a7cd Clarify Changelog entries
193c864 Update version to 2.12.0
37b9fd5 Merge remote-tracking branch 'restricted/pr/490' into development
34acd3c Merge remote-tracking branch 'public/pr/1868' into development
269e999 Remove unnecessary newlines in CONTRIBUTING.md
ee3ded0 Merge remote-tracking branch 'public/pr/1832' into development
729d781 Merge remote-tracking branch 'public/pr/779' into development
2c92949 Merge remote-tracking branch 'public/pr/1198' into development
c88c627 Merge remote-tracking branch 'public/pr/1658' into development
4ed32d0 cpp_dummy_build: Add NIST key wrapping header
488fd08 Add aes KW OIDs as defined
8dd03cd Add tests for the nist key wrapping feature
9cf0d53 Add ChangeLog
9ab746c Add selftests
cb349ac Implement the KW and KWP algorithm
466a57f Key wrapping API definition
5ca06c7 Merge remote-tracking branch 'public/pr/1724' into development
fb3b032 Merge remote-tracking branch 'public/pr/919' into development
ccb43df Merge remote-tracking branch 'public/pr/927' into development
dad05b7 Merge remote-tracking branch 'public/pr/1844' into development
0533054 Revise ChangeLog entry for empty data records fixes
c9a5f02 Move comment to a separate line
116ac43 Merge remote-tracking branch 'public/pr/1852' into development
bdf80d0 Merge remote-tracking branch 'public/pr/1810' into development
463928a Fix code formatting
fced1f2 Merge remote-tracking branch 'public/pr/1854' into development
ecb635e Add ChangeLog entry for #1098 fix.
428cc52 Allow to forward declare of public structs #1215
4072aae Merge remote-tracking branch 'public/pr/1875' into development
a7b3543 Merge remote-tracking branch 'public/pr/1871' into development
6965f77 Fix use of Knowledge Base in documentation
4736e96 add myself to changelog
ca2ea4e Fix issue if salt = NULL and salt_len !=0 in mbedtls_hkdf_extract()
5a5d03f Add test guidelines to CONTRIBUTING.md
10f9663 Added clarification to CONTRIBUTING.md
5cf4d06 Refine the definition of net_sockets.h
cce68be Add a macro to define the memory size in ssl_server2.c
e459f07 Correct logic to exclude i386 inline assenbly when -O0
8e6a22a Add additional i386 tests to all.sh
7a6da6e Expand i386 all.sh tests to full config ASan builds
ccbd464 Increase the memory buffer size for ssl_server2.c
4c761fa Add test for empty app data records to ssl-opt.sh
81f0633 Add ChangeLog entry for empty app data fix
ce6fbac Fix ssl_client2 to send 0-length app data
1a7a17e Check for invalid short Alert messages
3481792 TLSv1.2: Treat zero-length fragments as invalid, unless they are application data
b512bc1 CBC mode: Allow zero-length message fragments (100% padding)
7870ec1 Add API/ABI section to CONTRIBUTING.md
7c1258d all.sh: Return error on keep-going failure
7d728bd Merge remote-tracking branch 'public/pr/1454' into development
922bd1e Merge remote-tracking branch 'public/pr/1752' into development
862e703 Merge remote-tracking branch 'public/pr/921' into development
be685ba Merge remote-tracking branch 'public/pr/1836' into development
4f37bca Fix ChangeLog entry for issue #1663
df15356 Merge remote-tracking branch 'public/pr/1663' into development
fad5470 Merge remote-tracking branch 'public/pr/532' into development
a72098b Merge remote-tracking branch 'public/pr/1778' into development
ca33caf Add definition of purpose and use of networking module
0011503 Repharse comments
6ca436a Update change log
830ce11 Clarify attack conditions in the ChangeLog.
21feae5 Update change log
a47911c Fix memory leak in ssl_setup
0e2c07e Remove unnecessary mark as unused #1098
8744a02 Clarify a few comments
4b9a3ad Disable use of the i386 assembly for option -O0
00af447 Add ChangeLog entry for PR #536
e7aeef0 Merge remote-tracking branch 'public/pr/536' into development
32b0747 Merge remote-tracking branch 'public/pr/1737' into development
727325b Merge remote-tracking branch 'public/pr/1788' into development
24c0dbf Merge remote-tracking branch 'public/pr/1821' into development
cdbb2f2 Merge remote-tracking branch 'public/pr/1563' into development
231d7e5 Add ChangeLog entry for PR #1567.
6331cb0 Fix some whitespace issues in ChangeLog and CMakeLists.txt
d21bd31 Merge remote-tracking branch 'public/pr/1567' into development
6a25cfa Avoid debug message that might leak length
a5fbfd7 Enable snprintf on FreeBSD
a61d123 Minor changes to comments in hkdf.c
cdb5cc5 tests: dhm: Rename Hallman to Hellman
7b42030 Add counter-measure to cache-based Lucky 13
1cc1fb0 Fix Lucky 13 cache attack on MD/SHA padding
382c1db Minor fixes
d50f786 Update the CONTRIBUTING.md file for LTS branches
21f9afe Remove the namespacing from config-no-entropy.h
5ffc220 Documentation error in `mbedtls_ssl_get_session`
991f9fe all_sh: add a check for header inclusion in cpp_dummy_build.cpp
05fa46e Add ChangeLog entry for #992 fix
13dfb4e Revert changes in the configs folder
3fa6c27 Move definition to cipher.h
da2a312 Add entry in ChangeLog
ab8d58c Move definition of MBEDTLS_CIPHER_MODE_STREAM
a931265 Fix ssl-opt.sh not starting when lsof is not available
61fa436 Address review comments - tidy usage of macros to use minimal values
104d858 Add ChangeLog entry
5a9cb61 Use preserve mode to copy headers.
dcae78a Make a buffer limit more specific
470dfba Simplify OID tag parsing in x509_get_cert_ext( )
643df7c Update ssl-opt.sh test to run condition
1ab9b57 Add a ChangeLog entry for memory leak in mbedtls_x509_csr_parse()
034e139 Merge remote-tracking branch 'public/pr/1621' into development
4b6b08e Merge remote-tracking branch 'public/pr/1006' into development
1d97cab Merge remote-tracking branch 'public/pr/1645' into development
bea00bd Merge remote-tracking branch 'public/pr/1783' into development
9e02b97 Add ChangeLog entry for #1257 - key_app_writer writes invalid ASN.1
b056dd8 Remove a redundant dependency clause
19c01ef Merge remote-tracking branch 'public/pr/1258' into development
fd0c240 Merge remote-tracking branch 'public/pr/1793' into development
58093c8 Add ECC extensions test in ssl-opts.sh
05be06c Make the C++ test mandatory by removing the --no-cxx flag from all.sh
45a6719 Add a CXX build to all.sh to execute the C++ dummy test by default
037ec4b Replace tabs with spaces
89c048c Tests: add a test for cpp linking
0211c32 Change the cpp test to be optional
40741f8 Add a test with a cpp executable including all mbed TLS headers
84e62f8 Update ChangeLog
d56654f Update the forum link in the README file
6665b67 Merge remote-tracking branch 'public/pr/1390' into development
9fa21bf Merge remote-tracking branch 'public/pr/1533' into development
95a1c1f Merge remote-tracking branch 'public/pr/1617' into development
bf47099 Adjust to new RSA infrastructure
a522147 Fix compilation errors after updating
4922123 Update the Mbed TLS forum link
7972334 Enable ARIA self test in the unit testing
164b9cd update ChangeLog
b7d39db update ChangeLog
99a3e80 update change log.
1555085 add ChangeLog to this commit.
2682edf Fix build using -std=c99
512b4ee Use gmtime_r to fix thread-safety issue, and use mbedtls_time on Windows
8ee2422 about a issue Replace "new" variable #1782
51d7cfe Fix coverity warnings in benchmark.c
6c34442 Add fix for #1550 and credit to the ChangeLog
6332e36 Fix typo in ChangeLog
6fd941f Remove unneeded namesapcing in header files
7a81426 Fix style issue
6a9257b Add check for return code of bignumber code
5357164 Add ebx to the i386 clobber list for MPI assembly
bf7fe4f Replace check with APPLE with CMAKE_SYSTEM_NAME
5b92352 Document ssl_write_real() behaviour in detail
7ee25d7 Allow 0 as a valid ret value for mbedtls_ssl_write
a562c26 Add ChangeLog entry for mbedtls_ssl_write() docs
3f38cf7 Add entry in ChangeLog
755bb6a Add ecc extensions only if ecc ciphersuite is used
e3402ce Enable APPLE_BUILD in makefile if using system ar
7994766 Fix usage of if_build_succeeded in all.sh zeroize test
21f73b5 Coding style
c51d613 Ensure crosscompiling with make works in Mac OS X
e12f0ac Adapt buffer size for minimal CCM config
1f092b4 Add ChangeLog entry for ChachaPoly ciphersuites
9fece7e Add ChachaPoly ciphersuites to compat.sh
2e58e8e Implement ChachaPoly mode in TLS
c36b432 Add GnuTLS interop for CCM(-8) ciphersuites
ce66d5e Declare ChaCha-Poly ciphersuites
f57bf8b Define specific mode for ChachaPoly
a18034a Adjust to added fields in cipher_base_t
0dadba2 Merge branch 'development' into iotssl-2257-chacha-poly-primitives
8266aca Merge remote-tracking branch 'upstream-restricted/pr/487' into development
2fcd3e4 Change the library version to 2.11.0
925568a Fix version in ChangeLog for fix for #552
c4dd073 test: Add test cases for separately reduced inward/outward buffer sizes
d8213d0 Let MBEDTLS_SSL_MAX_CONTENT_LEN to be split into outward & inward sizes
b6a5bff Add ChangeLog entry for clang version fix. Issue #1072
c7bc9e1 Fix a few typos
cbe248a Merge remote-tracking branch 'public/pr/1727' into development
1f91575 Merge remote-tracking branch 'public/pr/1681' into development
688a456 Merge remote-tracking branch 'public/pr/1734' into development
cdc338b Merge remote-tracking branch 'public/pr/1735' into development
2711ad7 Merge remote-tracking branch 'public/pr/1736' into development
600c5e6 Compilation warning fixes on 32b platfrom with IAR
d9c71da Revert "Turn on MBEDTLS_SSL_ASYNC_PRIVATE by default"
2dbecc0 Merge remote-tracking branch 'public/pr/1602' into development
66a8903 Fix for missing len var when XTS config'd and CTR not
9873696 Merge remote-tracking branch 'public/pr/710' into development
5f57f1e Merge remote-tracking branch 'public/pr/1270' into development
6755905 Merge remote-tracking branch 'public/pr/1602' into development
d5d983e ssl_server2: handle mbedtls_x509_dn_gets failure
6b9bcd6 Remove redundant ret = 1 in dh_client.c
eb8bca6 Add missing platform macro defines in cert_app.c
bce5f78 Add missing platform macro defines in pk_decrypt.c
7d42965 Fix typo in platform macro defines for examples
28abd8e Fix ret code in gen_random_havege.c
25b5af5 Fix ret code in rsa_encrypt.c
7fe4edf Fix ret code in rsa_decrypt.c
7a9d01c Fix ret code in cert_app.c
dabd78f Fix ret code in generic_sum.c
9f3379d Fix ret code in pk_verify.c
82b2726 Fix ret code in pk_sign.c
0a7522c Fix ret code in pk_encrypt.c
5289817 Fix ret code in pk_encrypt.c
f47c9c1 Fix ret code in ecdh_curve25519.c
d905db6 Fix ret code in mpi_demo.c
78dabe0 Fix ret code in pem2der.c
357b0b2 Fix ret code in ssl_cert_test.c
80081a6 Fix ret code in udp_proxy.c
57a0c9b Fix ret code in req_app.c
898b208 Fix ret code in crl_app.c
f9a54d3 Fix ret code in cert_write.c
aacd928 Fix ret code in cert_req.c
67a42ac Fix ret code in ssl_mail_client.c
4be53b5 Fix ret code in ssl_fork_server.c
5517202 Fix ret code in ssl_client1.c
73d4a5f Fix ret code in gen_random_ctr_drbg.c
55a0d56 Fix ret code in gen_entropy.c
a833263 Fix ret code in rsa_verify_pss.c
0a860f6 Fix ret code in rsa_verify.c
3c41e56 Fix ret code in rsa_sign_pss.c
1a66056 Fix ret code in rsa_sign.c
70e1ffd Fix ret code in rsa_genkey.c
ed68488 Fix ret code in key_app_writer.c
0faf1a5 Fix ret code in key_app.c
208c217 Fix ret code in gen_key.c
2602a1f Fix ret code in ecdsa.c
03a992c Fix ret code in dh_server.c
d6bfeff Fix ret code in dh_genprime.c
898841d Fix ret code in dh_client.c
4c47df6 Fix ret code in crypt_and_hash.c
388c1b1 Fix ret code in aescrypt2.c
ace0592 Fix harmless use of uninitialized memory in ssl_parse_encrypted_pms
c306a05 SSL async tests: add a few test cases for error in decrypt
4481744 Fix memory leak in ssl_server2 with SNI + async callback
e247989 SNI + SSL async callback: make all keys async
2636fad ssl_async_resume: free the operation context on error
f5a9996 ssl_server2: get op_name from context in ssl_async_resume as well
ef30742 Clarify "as directed here" in SSL async callback documentation
7457933 SSL async callbacks documentation: clarify resource cleanup
3dae1cf Async callback: use mbedtls_pk_check_pair to compare keys
a668c60 Rename mbedtls_ssl_async_{get,set}_data for clarity
02b86d0 Fix copypasta in the async callback documentation
166ce74 SSL async callback: cert is not always from mbedtls_ssl_conf_own_cert
d6fbfde ssl_async_set_key: detect if ctx->slots overflows
0798158 Fix missing continuation indicator in ssl-opt.sh
20e2bdf SSL async tests: tighten a few log checks in some test cases
94e153a Improve documentation of the async callback's crypto parameters
37d4175 Add test case for SSL async resume after resume
4d9ec4d Fix uninitialized variable in ssl_server2
6331d78 Don't use the printf format %zd
03af7f6 Change boolean bitfield to unsigned
ff2f493 config: List cipher modes in alphabetical order
4ab8acd Merge remote-tracking branch 'public/pr/1075' into development
6ac1cf6 Merge remote-tracking branch 'public/pr/1182' into development
e5cd868 Add ChangeLog entry for PR #1555
c1bf1aa Merge remote-tracking branch 'public/pr/1555' into development
73a4b80 Merge remote-tracking branch 'public/pr/1672' into development
9a8db56 Merge remote-tracking branch 'public/pr/1730' into development
2ff0e52 Fix missing preprocessor condition in AES self-test
c03059d Simplify code in mbedtls_x509_csr_parse
0a8352b Fix harmless use of uninitialized memory in ssl_parse_encrypted_pms
725f1cb SSL async tests: add a few test cases for error in decrypt
3f3ada8 Fix memory leak in ssl_server2 with SNI + async callback
157f6d8 SNI + SSL async callback: make all keys async
d906b81 tests: cipher: Allocate enough space for XTS keys
0931708 benchmark: Add comma at end of help message
f4474e7 ChangeLog: Add an entry for AES-XTS
ed91a79 config: Update documentation for XTS option
c28012a tests: Remove NIST AES-XTS test vectors
142383e aes: xts: Add tests for invalid key sizes
8cfc75f aes: xts: Fix style issues with gf128mul
5f0b06a aes: xts: Fix description of gf128mul
f167deb aes: xts: Add a reference to the standard
c653990 cipher: Add wrappers for AES-XTS
425382d tests: Extend AES-XTS suite
e5c4b07 tests: Make AES-XTS suite more stack friendly
21d79cf aes: Add self test for AES-XTS
cd9fc5e aes: xts: Rename iv to data_unit
d82cd86 aes: xts: Rewrite to avoid use of goto
0a8b020 aes: xts: Enforce NIST SP 800-38E data unit size
5162b93 aes: Use length instead of bits_length in XTS
9366feb aes: xts: Add new context structure
e22ba80 Add XTS test suites to the Makefile
e9ecf00 aes: Remove AES-XEX
010c2cb gf128mul: Inline instead of making a new module
97cc3b1 gf128mul: Remove the jump table
5f77801 Implement AES-XTS mode
380162c Double perf for AES-XEX
daf7045 Add benchmark for AES-XEX
8bb817a Add AES-XEX to the version features
9bbe363 Rename exported symbols to please check-names.sh
fb67fae Add AES-XEX tests cases
75e3661 Add AES-XEX mode to the default config file
0089d36 Implement AES-XEX mode
b053658 Add 2 files for multiplication in GF(128)
9f52aeb tests: Fix name of 33 byte AES cipher tests
1d93759 Conditionally assign APPLE_BUILD var in makefile
c471cd7 Autodetect if running on OS X in makefile
7decfe8 Convert mbedtls_free and mbedtls_calloc into functions
9b04e19 Use grep to detect zeroize test failures on GDB
c06c9ae Add alias APPLE make var of APPLE_BUILD
4ed3880 Fix ChangeLog whitespace errors and add entry for PR #1646
f3987b3 Add ChangeLog entry for CCM*
601144e Add entry to ChangeLog for PR #795
b11de30 Fix braces in mbedtls_memory_buffer_alloc_status()
ae4cafa Merge remote-tracking branch 'public/pr/795' into development
c7638fa Fix ChangeLog entry after merge of HKDF
e47d6fd Merge remote-tracking branch 'public/pr/1497' into development
ebe23ed Fix up the ChangeLog for the new version
f0d7629 Merge remote-tracking branch 'public/pr/1593' into development
ebb6427 Merge remote-tracking branch 'public/pr/1646' into development
263498a Merge remote-tracking branch 'public/pr/1667' into development
dbe80c6 Merge remote-tracking branch 'public/pr/1668' into development
0b11e75 Merge remote-tracking branch 'public/pr/1692' into development
3cde2fc ssl_async_resume: free the operation context on error
4844bf2 Add OFB as additional block mode
cb2c935 aes: Clarify IV requirements for OFB mode
5db1362 Clarify documentation for AES OFB
33cb519 Add decrypt tests to AES OFB Cipher module
b7836e1 Change AES OFB tests to memset sizeof buffer
e416bf9 Reduce stack usage for AES OFB tests
968646c Clarify comments on use of AES OFB block mode
0013144 Fix style and formatting for OFB feature
374bcd4 Add to OFB cipher tests AES-192 and AES-256 OFB
dbe7fbf Remove unused variable in AES OFB test suite
6873c84 Update cipher.h for OFB block mode documentation
ad4e493 Fix AES-OFB support for errors, tests and self-test
7487c5b Add missing OFB entry to null ciphersuite
8c0fd1e Add cipher abstraction and test cases for OFB block mode
0301884 Add test cases for AES OFB block mode
76a5b22 Add OFB block mode to AES-128/192/256
10e0e4d hkdf: Add negative tests
3618962 hkdf: Add tests for extract and expand
798363e Add ChangeLog entry for HKDF
656864b Add an HKDF (RFC 5869) implementation
fcfa4c2 Merge remote-tracking branch 'public/pr/1699' into development
2a1edac Change symlink to hardlink to avoid permission issues
0a0e08a mbedtls_gcm_crypt_and_tag: clarify what each mode does and doesn't do
f30dbdc Update generated file
d75ee64 Fix out-of-tree testing symlinks on Windows
39b1904 Merge branch 'development' into iotssl-2257-chacha-poly-primitives
21a65e0 Fix usage of inline with for some compilers
2adb375 Add option to avoid 64-bit multiplication
80f679b Correct and clarify the documentation of GCM whole-message functions
c041435 Merge remote-tracking branch 'public/pr/1694' into development
d5a09f1 Updated version number to 2.10.0 for release
390641e Merge remote-tracking branch 'public/pr/1693' into development
b5b2543 Fix undefined shifts
ab72727 Add a disabled CMAC define in the no-entropy configuration
1a8ef07 Fix coverity defects
33dd323 Merge remote-tracking branch 'public/pr/1690' into development
d08a2f7 Adapt the ARIA test cases for new ECB function
747fd53 Fixes different off by ones
10438e1 Merge remote-tracking branch 'public/pr/1683' into development
6e962b2 Fix file permissions for ssl.h
d0e55a4 ssl_decrypt_buf: remove code for hashes that aren't used in TLS
94175a5 Refresh generated file
d2db09f Fix typo in documentation
9c82e2c Fix some whitespace issues
e533b22 Fix ordering and repetitions in config.h
3dc62a0 chachapoly: force correct mode for integrated API
26c3b0a Fix return type of internal function
5c38984 Use our habitual INTERNAL_ERROR debug message
a7fe25d Remove tests of #define's that don't exist
1bd9d58 Clarify comment about integer division by a variable
eb6ed71 Merge remote-tracking branch 'public/pr/1267' into development
2041a31 Merge remote-tracking branch 'public/pr/1402' into development
246cb05 Merge remote-tracking branch 'public/pr/1410' into development
b02f789 Merge remote-tracking branch 'public/pr/1470' into development
ba91994 Merge remote-tracking branch 'public/pr/1604' into development
d72700a Add ChangeLog entry for PR#1651
8edf2a3 Merge remote-tracking branch 'public/pr/1654' into development
02b9329 Fix MSan build without MBEDTLS_TIMING_C
0daf4ca Add test vectors for CCM*
4c57939 CCM*: Remove superfluous braces
143b319 CCM*: Make documentation consistent
20b4408 Fix Lucky13 attack protection when using HMAC-SHA-384
997e85c CCM*: Remove nested if
6b4bd3d CCM*: Improve documentation
95ab93d CCM*: Add minimal tests
b5734a2 CCM*: Add implementation
5dc8cfa CCM*: Add public API
45b79cf Treat warnings as errors for IAR
e7d3f8e Fix MicroBlaze register typo.
be78b07 chachapoly: warn against piecewise decryption
fa0c47d Fix typo in doc and copy missing warning
f4f01b6 Check return values from lower modules
1729789 Misc style adjustments
98fae6d ChaCha20: move working state from ctx to stack
9620f9b Rm mbedtls_ prefix form static functions
c22e61a Add ifdef for selftest in header file
fb78c90 Use recently-introduced platform_util module
39f2561 Fix edit mistake in cipher_wrap.c
3798b6b Add some error codes and merge others
234e1ce cipher: add stream test vectors for chacha20(poly1305)
32902e6 cipher: handle ChaCha20 as a stream cipher
c0dfcd4 Simplify selftest functions using macros
ceb1225 chachapoly: add test for state flow
444f711 poly1305: add test with multiple small fragments
59d2c30 chachapoly: add test for parameter validation
a8fa8b8 poly1305: add test for parameter validation
2aca236 chacha20: add test for parameter validation
fce88b2 Fix selftest verbosity in test suites
69767d1 cipher: add chachapoly test vector + unauth case
1465602 poly1305: fix bug in starts() and add test for it
55c0d09 chacha20: fix bug in starts() and add test for it
7296771 chachapoly: add test with unauthentic data
528524b Reduce size of buffers in test suites
d6aea18 Add Chacha20-Poly1305 to benchmark.c
b8bd80a Add FEATURE_NOT_AVAILABLE error codes.
5ef92d3 chachapoly: adjust parameter order
b1ac5e7 poly1305: adjust parameter order
b500f8b Update documentation to match new guidelines.
fe725de cipher: use new functions from chachapoly
346b8d5 chachapoly: split crypt_and_mac() to match GCM API
56206c4 Remove semi-internal chacha20_keystrem_block()
502f189 ChaCha20: allow in-place en/decryption
dca3a5d Rename aead_chacha20_poly1305 to chachapoly
4edd51b Rename poly1305_setkey() to poly1305_starts()
b7e9900 Avoid using %zu in selftest functions
823b7a0 Add missing extern "C" guard to new headers
95d0bdb Adapt the _ALT style to our new standard
ce8314f Add ChangeLog entry for new features.
e6e7968 Minor style and formatting fixes.
b6897f6 Correct signedness of printf specifier in self tests
16b04ce Fix unused function warning under certain configurations.
dca6abb Fix test suite when GCM Is disabled, but AEAD_ChaCha20_Poly1305 is enabled.
6155cc8 Add ChaCha20 test vectors from RFC 7539
4d8f87b Add ChaCha20/Poly1305 ciphers to the selftest program
dedf4a3 Adjust verbose self-test output to match other ciphers.
8fe4701 Add ChaCha20+Poly1305 to the Cipher module
a310c5e Allow some parameters to be NULL if the length is 0.
b8025c5 Implement AEAD-ChaCha20-Poly1305.
adc32c0 Add Poly1305 authenticator algorithm (RFC 7539)
bd92062 Add ChaCha20 to the Cipher module
34b822c Initial implementation of ChaCha20
d0f143b Update CTR doc for the 64-bit block cipher
4f24e95 Update CTR doc for other 128-bit block ciphers
f584286 Slightly tune ARIA CTR documentation
e95092d Change the value of fno-sanitize-recover
a64fba4 Remove double declaration of mbedtls_ssl_list_ciphersuites
2f3a581 Merge remote-tracking branch 'public/pr/1178' into development
f889202 Merge remote-tracking branch 'public/pr/1434' into development
8a1b2c8 Update CTR documentation
8c75421 Add no symbols warning fix to ChangeLog
0e98e88 Silence no symbols warn on apple & Makefile
7f3ef27 silence "no symbols" warnings on apple clang
7124fb6 Use zeroize function from new platform_util
a3712be Merge branch 'development' into iotssl-1941-aria-ciphersuites
0960b80 Move to new header style for ALT implementations
c089312 Add ifdef for selftest in header file
2df4bfe Fix typo in comments
565e4e0 Use more appropriate type for local variable
08c337d Remove useless parameter from function
89924dd Wipe sensitive info from the stack
12e2fbd Style adjustments
d418b0d Fix typo in comment
9d41073 Fix typos from copy-pasting
4d393b9 Add check-files.py to travis.yml
2699de3 Add check-files.py to pre-push.sh
a07039c Add check-files.py to all.sh
10d9ce3 Add script for source integrity checking
c4bd8ec Merge remote-tracking branch 'upstream-public/pr/1446' into development
11999bb Fix minor code style issues
cdd97fd Merge remote-tracking branch 'upstream-public/pr/1433' into development
707e962 Update visualc project files
6087f20 Fix memory leak in mbedtls_x509_csr_parse
a331e0f Merge remote-tracking branch 'upstream-restricted/pr/421' into development-proposed
fb19399 Merge remote-tracking branch 'upstream-public/pr/1498' into development-proposed
09c4e7e Merge remote-tracking branch 'upstream-public/pr/1486' into development-proposed
54306c1 Add more SNI/DTLS tests
f77d3d3 Rename SNI/DTLS tests in ssl-opt.sh script
0b3f00c Avoid -Wformat-truncation warning on gcc7
276b9a6 ssl_server2: get op_name from context in ssl_async_resume as well
9ceae8b Clarify "as directed here" in SSL async callback documentation
ea5fab8 SSL async callbacks documentation: clarify resource cleanup
26d01bc Async callback: use mbedtls_pk_check_pair to compare keys
1febfef Rename mbedtls_ssl_async_{get,set}_data for clarity
6a8cb36 Fix copypasta in the async callback documentation
807d74a SSL async callback: cert is not always from mbedtls_ssl_conf_own_cert
0b53e24 ssl_async_set_key: detect if ctx->slots overflows
deda75a Fix missing continuation indicator in ssl-opt.sh
37289cd SSL async tests: tighten a few log checks in some test cases
20deb01 Improve documentation of the async callback's crypto parameters
12d0cc1 Add test case for SSL async resume after resume
9de55fa Fix uninitialized variable in ssl_server2
5bea9f6 Don't use the printf format %zd
7830073 Change boolean bitfield to unsigned
5ffe41c Turn on MBEDTLS_SSL_ASYNC_PRIVATE by default
ac5e8a3 Document that callbacks must not return arbitrary SSL errors
8f97af7 Don't pass the async config data to async callbacks
e141638 Finish writing an unfinished comment
a36ac4f New wrapper mbedtls_status_is_ssl_in_progress(ret)
0fd90dd ssl_prepare_server_key_exchange: clarify where the signature is written
2481a71 Doxygen formatting improvements
c912572 ssl_server2: merge redundant async_private_error=resume/pk
d326883 Document what the SSL async sign callback needs to do with RSA
ceb541b ssl_server2: rename delay in ssl_async_operation_context_t
22e695f Be more precise about when a variable is unused
ad28bf0 Documentation improvements
168dae8 Comment formatting and whitespace fixes
df13d5c Pass the SSL context to async callbacks
9b562d5 mbedtls_ssl_handshake_free: take the SSL context as argument
2e33337 Fix invalid data being accepted in RSA-decryption-based ciphersuites
b74a1c7 Rename MBEDTLS_SSL_ASYNC_PRIVATE_C to MBEDTLS_SSL_ASYNC_PRIVATE
f112725 Style and grammar fixes
12ab5d4 Don't shadow the variable p
b44692f Merge branch 'mbedtls_ssl_get_key_exchange_md_ssl_tls-return_hashlen' into tls_async_server-2.9
8491406 Remove preprocessor directives around platform_util.h include
6698d2f Fix style for mbedtls_mpi_zeroize()
56e06db Improve mbedtls_platform_zeroize() docs
708c5cb mbedtls_zeroize -> mbedtls_platform_zeroize in docs
d0ef468 Reword config.h docs for MBEDTLS_PLATFORM_ZEROIZE_ALT
bc7bdbf Organize CMakeLists targets in alphabetical order
21b376b Organize output objs in alfabetical order in Makefile
ca1d742 mbedtls_ssl_get_key_exchange_md_tls1_2: return hashlen
0329d72 SSL asynchronous decryption (server side): update ChangeLog
fcca9d8 SSL asynchronous decryption (server side): tests
2c6078e SSL asynchronous decryption (server side)
bcd98a5 ssl_parse_encrypted_pms refactor: prepare, decrypt, return
422ccab ssl_parse_encrypted_pms refactor: prepare for remote private key
d9bfcab SSL asynchronous signature: fix renegotiation tests
e630aed SSL asynchronous signature: ChangeLog entry
dbb14e0 all.sh: run ssl-opt.sh on ECJPAKE, SSL async
9d12b4c SSL asynchronous signature: turn off by default
60ee4ca SSL asynchronous signature: basic test of recovery after error
f9f15ae ssl_write_server_key_exchange refactor: don't use p at all
d3eb061 ssl_write_server_key_exchange refactor: minor cleanup
ebd30ae ssl_write_server_key_exchange refactor: ssl_resume_server_key_exchange
d04d292 Get rid of useless handshake field out_async_start
ab50f83 Improve documentation of async operation start callbacks
7ab013a ssl_write_server_key_exchange refactor: move signature_len out
1004c19 ssl_write_server_key_exchange refactor: don't use p in the signing phase
184a3fa ssl_write_server_key_exchange refactor: create ssl_prepare_server_key_exchange
3ce9b90 ssl_write_server_key_exchange refactor: remove dig_signed_len
3665f1d SSL asynchronous signature: test cases
4bf9a28 SSL asynchronous signature: first implementation
ebd652f ssl_write_server_key_exchange: calculate hashlen explicitly
e1efdf9 ssl_write_server_key_exchange: don't hard-code max hash size
e198df5 ssl_pick_cert: use the public key for can_do
9eb5e9a SSL asynchronous private key operation callbacks: test server
8bf79f6 SSL asynchronous private key operation callbacks: interface
59e83d9 Add conf parameter to mbedtls_ssl_handshake_free
fe1c093 ssl_write_server_key_exchange refactor: remove redundant variable n
81d4e89 Don't rely on private key metadata in SSL
e5b5bd7 Allocate a unique err code for MBEDTLS_ERR_AES_BAD_INPUT_DATA
3f7f817 Check invalid nc_off
14a8b59 Fix doxygen error for MBEDTLS_PLATFORM_ZEROIZE_ALT
c58787f Update docs for MBEDTLS_PLATFORM_ZEROIZE_ALT in config.h
3ea559e Fix alignment in makefile
eecea0e Update zeroize test to use mbedtls_platform_zeroize()
9644983 Add platform_utils and zeroize to visualc files
82934be Do not install zeroize program in CMakeLists
1f6301b Rename mbedtls_zeroize to mbedtls_platform_zeroize
904e1ef Make utils module part of the platform
ae8e306 Fix docs typos for zeroize related features/test
757cd72 Update license headers year and branding
42defd1 Improve docs for zeroize.c and test_zeroize.gdb
1e8ea5f Improve docs for mbedtls_zeroize() and add refs
6606d5c Add config.h docs for MBEDTLS_UTILS_ZEROIZE_ALT
1962405 Justify moving zeroize() to utils in ChangeLog
806f403 Improve detection of program exit code in gdb script
6e34e63 Fix style in programs/test/zeroize.c
7111a0d Change test_zeroize.gdb script breakpoint due to zeroize.c change
88f8f41 Move zeroize func call to end of program in zeroize.c
0bd4237 Fix formatting in utils.c file comment
ecd1891 Change mbedtls_zeroize() to prevent optimizations
2967381 Extend zeroize tests to multiple optimizations
24768bf Improve test_zeroize.gdb breakpoint
b1262a3 Allow compile-time alternate to mbedtls_zeroize()
e32df08 Remove individual copies of mbedtls_zeroize()
d0d7bf6 Add gdb zeroize test when compiling with clang
f2d1792 Document test_zeroize.gdb script
c6b0abd Fix alignment of Makefiles
9a65b1d Add utils.h ChangeLog entry
ddebc49 Add gdb script to test mbedtls_zeroize()
5ab74a1 Add programs/test/zeroize.c to test mbedtls_zeroize
614d9c0 Add a utils.h file that contains common functions
418527b Fix minor issues with command line options
c4ec716 Fix uninitialized var in check-generated-files.sh
dfeda48 Remove VS project files from deleted example apps
5121d4b Remove refs to VS6 from generate_visualc_files.pl
4c1e2ec Check generated-visualc-files in check-generated-files
3c5f949 genereate_visualc_files.pl deletes old files
60bc47d library: Port to Haiku.
8339c8f x509.c: Remove unused includes
df60856 Only redefine _WIN32_WINNT macro when < 0x0501
7869680 Updated abi_check.py docstrings
fe60132 Move a buffer size test before the first relevant read
c33c7c8 Copy DartConfiguration.tcl, needed for make memcheck
533407a Use "#!/usr/bin/env perl" as shebang line.
8d54c06 Use correct version of snprintf on Windows
be03836 Fix some comments regarding what files are symlinked
b2f09c3 Support out-of-tree testing with CMake: add ChangeLog entry.
0114ffc all.sh: Verify out-of-tree testing with CMake
a71d64c all.sh: fix cleanup happening during an out-of-tree build
31b07e2 all.sh: be more conservative when cleaning up CMake artefacts
8405257 Support out-of-tree testing with CMake
38d8165 all.sh: add opposites to all boolean options
8a244c9 all.sh: option parsing: reduce vertical spread
2623296 all.sh: with --no-armcc, don't call armcc from output_env.sh
a6f430f Fix current directory check
127c5af Add copyright to abi_check script
7c2dd58 Add script for ABI compatibility checking
ce5673c Add reference to github issue in compat.sh
b4ef45b all.sh: build with -O -Werror in the full config
df761d5 Fix build with gcc -O -Wall
366e1b0 aria: fix comment on aria_a function
977dc36 aria test suite: uniformize line wrapping
f6b787c Fix typo in documentation (CTR warning)
2166214 aria: improve compiler compat by using __asm
2078725 aria: check arm arch version for asm
8abc349 aria: rationalize buffer sizes in test functions
d82d791 aria: fix more whitespace
906bc90 aria: number of rounds is non-negative
7fc0879 aria: more whitespace fixes
5ad88b6 aria: define constants for block size and max rounds
3c80009 aria: add error codes for hw implementations
f3a46a9 aria: fix some typos in comments
c0bb66f aria: improve compiler inline compatibility
22997b7 block ciphers: improve CTR nonce warning
5aa4e3b aria: align documentation on AES
4231e7f Fix some whitespace and other style issues
fdd4354 config.h: SSL no longer uses ciphers directly
525168c aria: expand config.h entry: ciphersuites & caller
08d1e91 aria: add ChangeLog entry
2268b96 aria: disable by default in config.h
26b54fa aria: document optional asm usage in config.h
377b2b6 aria: optimize byte perms on Arm
fb0e4f0 aria: optimise byte perms on Intel
cac5008 aria: define P3 macro
f205a01 aria: comment implementation of A transform
35ad891 aria: internal names closer to standard document
64744f8 aria: define SLA() as sl(a())
8c76a94 aria: turn macro into static inline function
62e813c Add aria to benchmark program
a41ecda aria: closer to usual comment style
5645393 aria: use mbedtls_zeroize()
c76ceb6 aria: move conditional outside of loop
9cc8924 aria: use unsigned type for bit count
e1ad749 aria: clean up interface of internal macros
a6d639e aria: improve some comments & internal names
442f03b cmake: keep test list in alphabetic order
6b36892 Add compat.sh ARIA run to all.sh
bba6406 compat.sh: add remaining ARIA suites
af37f0f Add remaining ARIA suites to priority list
9decaf5 Document Aria suites as TLS 1.2-only
4db944c Don't declare unsupported ciphersuites
7299dfd compat.sh: add ARIA interop tests with OpenSSL
a0e4708 compat.sh: add self-interop tests for ARIA suites
392c2d2 compat.sh: run 1.2-only tests with DTLS too
841192b fixed a macro to uppercase for a test script (.._TLS_DH_anon_WITH.. -> _DH_ANON_WITH_)
c06e101 ARIA ciphersuites for TLS 1.2
07478d6 something to do with whitespaces
0fb47fe MBEDTLS_ARIA_ALT added as a feature
8df81e0 Test suite for ARIA
6ba68d4 ARIA init and free
3c0b53b ARIA build integration
259fa60 ARIA test vectors for CBC CFB CTR modes
41efbaa ARIA cipher implementation
0afe624 all.sh: add test with MBEDTLS_DEPRECATED_REMOVED
bb51cb3 remove additional zero byte when writing pub der
3d8c907 Compute outgoing MAC in temporary buffer for MAC-then-Encrypt
3f8271e Support only new CLang version
18b3c91 Address Azim's coments
22d989c Suport clang version 3.8
0049f78 check matching issuer crt and key for all algs
9839360 Fix all.sh check_tools function to handle paths
1a83445 Add SNI with DTLS tests to ssl-opt.sh script
git-subtree-dir: third_party/mbedtls/repo
git-subtree-split: 76dc0659f649d5d0eda0ff34322fb3ba7e6492cf
- differentiate serial login scenarios and improve serial login experience
- shorten command sending and validating process
- fix ping issue (no impact on NCP DUT certification)
This commit changes the `Mac` operation scheduling to allow
users to start a new operation from the done callback handler of
a previous operation. For example, calling `Mac::ActiveScan()`
from a previous `mActiveScanHandler` callback handler should
succeed.
This is realized by ensuring to call `FinishOperation()` before
invoking the done callback and after the callback, perform any
pending next operation by calling `PeformNextOperation()`.
This commit updates the `radio.h` header file:
- Re-orders the definitions so keep the related functions close.
- Updates the documentation/comments.
- Uses `otPanId` and `otShortAddress` for function parameter types.
This commit adds method `GenerateRandom()` to `Mac::ExtAddress` to
generate a random IEEE 802.15.4 Extended Address. This method
replaces the `Mac` class `GenerateExtAddress()` method.
This commit contains the following changes:
- It adds code to `RadioSpinel::Init()` to get and check the RCP
capabilities (`SPINEL_PROP_CAPS`) ensuring RCP supports radio/raw
mode (`SPINEL_CAP_MAC_RAW`).
- It adds support for handling stream log `SPINEL_PROP_STREAM_LOG`
property from RCP.
- It moves the existing code checking spinel version and radio
capabilities of RCP into helper methods `CheckSpinelVersion()`
and `CheckRadioCapabilities()`.
This commit changes `Mac` implementation to use direct callbacks into
`MeshForwarder` to inform it of a frame reception or status of a
requested frame transmission. This changes replaces the `Mac::Sender`
and `Mac::Receiver` model.
This commit contains the following changes:
- It adds a new configure option "--with-vendor-extension" allowing
users to add a source file to be built along with OpenThread core
library. `OPENTHREAD_ENABLE_VENDOR_EXTENSION` indicates whether
this feature is enabled or not.
- It adds a class `Extension::ExtensionBase` which defines the hooks
from OpenThread into the vendor extension module. Vendor extension
code should inherit from this class and provide the implementation
of the defined methods.
- A source file `extension_example.cpp` is added to provide an example
on how to implement an OpenThread vendor extension.
- One of the build configuration under Travis CI posix target is
updated to enable the vendor extension feature (using the example
code) and verify the build.
This commit re-uses the `mOperationTask` tasklet (in addition to it
being used for starting a scheduled MAC operation) to invoke the
`HandleTransmitDone()` in case of `OT_ERROR_ABORT` failure. This
ensures that frame retransmission attempt (in case of back-to-back
failures) are not done through the same long call chain.
This commit defines a set of platform APIs to integrate UDP layer of
OpenThread with that of the platform.
With this commit, services and applications developed upon OpenThread can
also be accessed through platform's own network interface, e.g. socket() on
POSIX.
This commit contains the following changes:
- It adds `otPlatRadioGetVersionString()` as an optional radio
platform API. If the radio platform does not implement this
function, OpenThread core provides a default weak implementation
of this function which return the OpenThread version.
- A public OpenThread API `otGetRadioVersionString()` is added which
provides the radio version string.
- POSIX App is updated to get the version from its RCP and provide
`otPlatRadioGetVersionString()`
- A new spinel capability `SPINEL_CAP_POSIX_APP` is added which
corresponds to `ENABLE_POSIX_APP` configuration.
- A new spinel property `SPINEL_PROP_RCP_VERSION` (only available
in POSIX_APP) is added which gets the RCP version.
This commit makes the following changes in `MeshForwarder`:
- It separates the logging of sent direct and indirect messages,
ensuring that for indirect messages the status (success/failure)
is logged after all retry attempts.
- It updates the log message (status of transmission) for a larger
message requiring fragmentation and multiple frame transmissions
when `CONFIG_DROP_MESSAGE_ON_FRAGMENT_TX_FAILURE` is not enabled.
- It fixes managing of `IpCounters` to only account for messages
with type `kTypeIp6`.
This commit changes `MleRouter::HandleChildUpdateRequest()`:
- If the child entry is modified (i.e., timeout value or
device mode changes) on an already attached child, the child
info is updated and saved in the non-volatile settings.
This ensures that after a parent reset the child can be
recovered correctly.
- If the "Child Update Request" causes a mode change from rx-on
to sleepy on a child in `kStateValid` (already attached), the
source match controller is set to perform source address
matching on the short address.
- This commit also adds a log to indicate mode change of a
child.
This commit distinguishes the attach same process during downgrade from
the one caused by losing connectivity as for the former downgrade
scenario, there must be enough active routers to provide connectivity,
and additional benefits is to avoid the impact of possible flooding parent
responses if there are lots of REEDs in large scale thread network.
This commit renames `NODE_ID` to `gNodeId` in posix app and posix
platform example code. It also ensures to use correct encoding (byte
order) to calculate the `gNodeId` (as `uint64_t`) in posix app.
This commit updates `toranj` framework to allow a different mode of
operation where tests are run using posix-app along with an RCP (NCP
in radio only mode) build. This commit also adds a new job for the
new model in travis CI build matrix.
This commit makes changes to ensure the `Leader::RemoveRloc` methods
remove all matching entries from a `BorderRouterTlv` or `HasRouteTlv`
It adds new methods to `BorderRouterTlv` and `HasRouteTlv` to get the
first entry or last entry and allow an easier way to iterate over all
the entries.
This commit also adds a new helper method `RlocMatch()` to simplify
the comparison of RLOC16 values (exact match vs router id match).
This commit adds check in `Leader::RegisterNetworkData()`to validate
the received network data and ensure it only contains entries matching
the RLOC16 of the device registering the network data. It updates
`RlocLookup()` method to add a new mode to allow or not allow any
entries that do not match the given RLOC16.
This commit changes the code to treat Channel Mask TLV from
Operational Dataset and the MAC layer supported channel mask as
two different (unrelated) network parameters. In particular:
- With this commit, the Channel Mask TLV value is ignored when
applying a Dataset from `Dataset:ApplyConfiguration()`.
- However, when we create an Active Operational Dataset as leader in
`ActiveDataset::GenerateLocal()` method, the MAC layer's supported
channel mask is still used for the Dataset Channel Mask TLV value.
- This commit also adds a check in `Mle::SendAnnounce()` to ensure
that MLE Announcements are not sent on channels that are are not
included in the MAC layer's supported channel mask.
This commit adds support for a set of MLE counters (e.g., counters to
track number of times device entered different roles, or counters
tracking number of attach attempts, partition ID or parent changes).
This commit adds a test-case under `toranj` covering multicast
traffic exchange over a multi-hop network to the following multicast
IPv6 addresses: link-local/mesh-local all-nodes address, link-local
/mesh-local all-routers address, link-local/mesh-local all-thread-
nodes address, and user-specified multicast address.
The new test covers the following:
- Verify all nodes (routers/FED/SED) subscribe to:
* Link-local all nodes, realm-local all nodes,
* Link-local all Thread nodes, realm-local all Thread nodes,
* All MPL forwarder realm-local.
- Verify routers also subscribe to:
* Link-local all routers, realm-local all nodes.
- Verify adding/removing multicast addresses on all devices.
This test verifies the behavior of `AddressResolver` module and
entries in address cache table. It also tests the behavior of nodes
when there are topology changes in the network (e.g., a child switches
parent). In particular, the test covers the address cache update
through snooping.
This commit adds a new script `git-squash-merg` which can help with
performing squash merge of a branch into another. The commit message
includes the list of squashed commits. This script is helpful for
synchronization of git repositories that work with gerrit.
This commit updates the `toranj` tests related to forming/joining
a network to cover newly added capabilities to wpanctl `form`/`join`
commands (allowing all parameters to be given as part of the
command itself).
This commit adds a test-case under `toranj` to verify router table
entries on a network with 4 routers: {r1, r2, r3} forming a loop
with r4 connecting to r3.
This commit adds a new test-case under `toranj` for Child Supervision
feature.
This test uses MAC whitelisting to emulate the situation where a child
is removed from parent's child table while the child continues to stay
attached to the parent (since data polls from child are acked at radio
platform layer). Specifically the test verifies that once supervision
check is enabled on the child, the child detects that it is no longer
in the parent's table and tries to re-attach. The test verifies the
behavior of both the parent and the child when supervision is enabled.
It verifies that the parent is periodically sending supervision
messages to the child and that the child is monitoring the messages
from parent. This test also indirectly verify the child timeout
behavior on a parent.
This commit adds a new test-case under `toranj` frame-work to verify
the behavior of devices under the "inform previous parent" feature.
With this feature enabled, when a child attaches to a new parent, it
will send an IP message (with empty payload) to its previous parent.
Upon receiving this message the previous parent would immediately
remove the child from its child table.
The test network topology consists of two routers/parents and a single
sleepy child. The child is first attached a parent and is then forced
to switch its parent. It's then verified that the child is removed
from first parent's child table.
This commit adds support for Commissioner related APIs in spinel and
NCP including starting/stopping Commissioner, setting Provisioning
URL, adding/removing Joiners, and sending Announce Begin, Energy Scan
Query, PAN ID Query, MGMT_GET/MGMT_SET messages.
This commit adds signal handler in posix example platform for
signals SIGHUP and SIGTERM. Upon receiving either signal the
process is terminated using `exit(0)`.
This commit adds a new method `finalize_all_node()` in `wpan.Node`
class to finalize all previously created instances of `wpan.Node`. It
terminates the associated `wpantund` process and wait.
The child/router entries are generally cleared using `memset()` to avoid
explicitly setting all fields to zero. As a result, it is necessary to
explicitly clear the link quality state to properly initialize the last
RSSI reading. The user-specific constructors are also removed.
This commit makes the following changes:
1. A child that is resynchronizing with its parent after reset always
requests the network data to ensure that it has the latest version.
2. When autoconfiguring SLAAC addresses in response to a network data update
always attempt to add the netif address buffer in case the netif
structure was removed (e.g. due to reset).
This commit adds a new test script for `toranj` test frame-work
covering the situation when IPv6 addresses with same prefix are
added/removed on multiple nodes. The test verifies that the on-mesh
prefix list on all nodes stays consistent and updated as the addresses
are added/removed and nodes are reset.
This commit adds a new test-case under `toranj`. The test covers
the following situation:
- A single parent node with three sleepy and two rx-on children.
- Parent node is reset.
- It is verified that all children are recovered and are present
in the parent's child table after reset.
- It is also verified that all children are restored on parent
through "Child Update" exchange process and none of them get
detached.
This commit addresses an bug where the child info was not being
saved in non-volatile settings. It fixes the following cases in
the code where a child id was used to search for a child (using
`FindChild()`) instead of the RLOC16 address:
- `StoreChild()` is changed to accept a `const Child &` as input
parameter avoiding the need to look up the child by ID or RLOC16.
- `SendChildIdResponse()` and `GetChildInfoById()` are updated to
perform the search for a child using its RLOC16.
The MKW41Z Reference Manual Section 44.6.2.7 states:
- "The 802.15.4 Link Layer software prepares data to be transmitted, by
loading the octets, in order, into the Packet Buffer."
This commit maintains a separate buffer for building the transmit frame
then copies the buffer just before the transmit frame is submitted to the
radio.
This commit introduces changes necessary to support long routes (i.e. route
cost >= 16).
This is an experimental feature that requires changes to the route
information communicated in MLE messages. As a result, it is not compatible
with the Thread 1.1 specification.
This feature is disabled by default.
This commit renames the timer used for Child Update transmissions to
`mMessageTransmissionTimer` and allow it to be used for retx of MLE
Data Request messages when there is no pending or active MLE Child
Update Request. It also adds logic to ensure that the device gets
detached after some number of MLE Data Request attempts with no
response.
This allows the underlying wpantund process associated with a `Node`
instance to be executed while we are waiting for it to be initialized.
It also protects against any unexpected termination of an instance.
This change would help with speed of initialization of all nodes
mainly when there are many instances running in parallel.
This commit updates the documentation of spinel property sections
and also adds a new range 0x080 - 0x08F, 0x1800 - 0x18FF allocated
for MeshCop related properties.
Linker will discard libmbedcrypto_a-cc310_mbedtls.o when searching
mbedTLS library, if it finds weak implementation of
nrf5CryptoInit/Deinit before strong ones. Adding additional
symbols to this file will prevent this behavior and make linker
to search libmbedcrypto_a-cc310_mbedtls.o even after weak
implementations are found.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit updates the APIs `otDatasetSendMgmtActiveGet` and
`otDatasetSendMgmtPendingGet` to be similar to MgmtSet APIs and use an
`otOperationalDatasetComponents` as input to specify the Dataset
components to be requested. The implementation of APIs in
`DatasetManager` and their use in in CLI is also updated.
It also defines new spinel properties `MGMT_GET_ACTIVE_DATASET` and
`THREAD_MGMT_GET_PENDING_DATASET` (with their set handlers) to add
support for sending `MGMT_GET` meshcop command for Active/Pending
Operational Dataset. It also renames the existing properties used for
sending `MGMT_SET` (include `MGMT_SET` in the property name).
It also adds a new property to allow an optional destination IPv6
address to be specified (for sending `MGMT_GET` command) as part of
spinel dictionary representation of Dataset instance.
Add a configure option to enable/disable Header IE support: OPENTHREAD_CONFIG_HEADER_IE_SUPPORT
So then the Header IE generation and parsing feature could be enabled separately.
This commit increases the maximim number of entries that can be
supported by `Ncp::ChangePropsSet` to 64 by using `uint64_t` to
save the flags instead of `uint32_t`.
There are some problems if radio is not reinitialized during pseudo reset:
* It may trigger unexpected otPlatRadioTxDone(), and cause the device to hang;
* The uncleared radio timer queue is invalid, it may block the new added timer which has a larger targer time.
Note: The clock init/deinit is disabled during radio init/deinit.
* [cc2538] Add definitions for FSMSTAT0 and RFERRF bits.
This adds a register definition for `RFCORE_XREG_FSMSTAT0` and defines
the bits in `RFCORE_SFR_RFERRF`.
* [cc2538] Check for error conditions on transmit.
The transmit code first waits for an existing transmission to finish,
then sets things up for the next transmission and waits for the radio to
go into receive mode before proceeding.
If, the radio receive buffer overflows during this time, the radio will
enter a RX overflow state (state 0x11 in `FSMSTAT0`) and will block
there until the RX FIFO is flushed.
In such cases, the CC2538 hard-locks due to the while loop waiting for
the `RX_ACTIVE` bit to be set. While waiting for `RX_ACTIVE`, we need
to check for these overflow conditions, handle them, then re-try our
transmitter set-up.
* [cc2538] Re-try transmit set-up on IDLE
If we enter the idle state, then rather than just setting the channel,
re-try our transmitter set-up since we should be in the correct state
to do this at this point.
This commit adds a new function `verify_within` in `toranj` wpan
library. This function verifies that certain conditions (given as
function handler) pass within a given wait time interval. The
`verify` function is also changed to raise an exception (instead
of immediate `exit(1)`).
The new function is then used in `test-014` to allow faster checks
after device reset while giving longer wait time for test to pass.
This commit moves the border agent service into OpenThread core.
Border agent, commissioner, and joiner shares a single secure CoAP agent,
because they will not be active at the same time.
Other changes include:
- Replaced TMF proxy with UDP proxy, which is more generalized.
- Changed OT_ERROR_NONE string to "OK".
- Defined a special interface id -1 to differentiate packets received by
host side.
Introduce a nrf5RadioPseudoReset() method, it will put the radio to sleep mode,
and clear the pending events during pseudo reset. So to avoid unexpected transmit
done callback after pseudo reset, which may cause the device to hang.
This commit appends new fields to format of `PROP_THREAD_PARENT`
spinel property. The new fields provide age, avrerage RSSI and
last RSSI, etc. This commit also updates the spinel documentation.
This commit adds a `toranj` test for adding/removing IPv6 addresses
on routers, FEDs, and SEDs (on network interface).
The test then covers the following:
- Verify "IPv6:AllAddresses" wpantund property.
- Verify that prefixes are present in network data corresponding
to added addresses (on all nodes).
- Verify that a SED does register the address with its parents
("Thread:ChildTable:Addresses" wpantund property).
- Verify that addresses/prefixes are retained by wpantund over
NPC resets.
- Verify that when an address is removed on network interface
its corresponding prefix is also removed (on all nodes).
This commit updates `wpan.py` module to include newly added wpanctl
commands `add-prefix` and `remove-prefix` and include new `stable`
parameter for `add-route`. It also updates `test-10` to test the
behavior of the new commands.
This commit addresses an issue with forwarding of off-mesh traffic
on FED. It also adds a `toranj` test-case to test adding of off-mesh
routes (on routers and FEDs) and traffic flow to off-mesh addresses.
This commit changes the way the mesh forwarder layer handles transmit
attempt failures due to CCA failures. Prior to this commit, the mesh
forwarder layer would simply drop the packet. This commit keeps the
packet in the queue so that it can be retransmitted at a later time. This
applies to both direct and indirect transmissions.
This commit contains the following changes:
- Adds new logic to `Mac` to track supported channel mask along
get/set methods.
- Adds public OT APIs `otLinkGetSupportedChannelMask()` and
`otLinkSetSupportedChannelMask()` to get/set the channel mask.
- Ensures supported channel mask from `Mac` is included in Dataset
TLVs when a local Dataset is generated.
- Ensures the channel mask at `Mac` gets updated when a new Dataset
configuration is applied.
- Adds `OT_CHANGED` notification for signaling channel mask changes.
- Updates `NcpBase` and `PHY_CHAN_SUPPORTED` spinel property get/set
handlers to adopt the new public APIs.
- Updates `NcpBase` to emit async `PHY_CHAN_SUPPORTED` updated on
OT_CHANGED channel mask notification.
This commit also contains
- Adding `Instance::GetLogLevel()` to get current log level on
device.
- Adding new `otLogMac()` macro to log at MAC region with a run-time
given log level.
This commit changes some of the log messages in `mle`, `ip6`,
`address_resolver` and `router_table` from INFO level to NOTE level.
It also adds missing `otLogNote<>` implementation for windows.
OpenThread network-wide time synchronization service is an experimental feature, not part of the standard Thread protocol.
Feature Overview:
* All the nodes in the same Thread partition sync to the same Thread network-wide time;
* Microsecond level time synchronization precision;
* Flexible time accuracy and time sync period configuration;
* APIs for application layer use case, support both CLI and NCP version.
The feature is wrapped by OPENTHREAD_CONFIG_ENABLE_TIME_SYNC, there's no change to current Thread 1.1
implementation if OPENTHREAD_CONFIG_ENABLE_TIME_SYNC is not enabled.
If OPENTHREAD_CONFIG_ENABLE_TIME_SYNC is enabled, the node could:
* Attach to a time sync enabled network, otherwise
* Attach to a standard Thread 1.1 network, otherwise
* Form a new time sync enabled network
In addition, if OPENTHREAD_CONFIG_TIME_SYNC_REQUIRED is also enable, the node could only:
* Attach to a time sync enabled network, otherwise
* Form a new time sync enabled network
Note:
Currently, the feature is only supported on nRF52840 and posix platforms. And the network time
is only synced among Routers and REEDs, the SEDs will be supported later as an optional feature.
This commit moves the methods related to logging mesh header
messages in `mesh_forwarder_ftd.cpp` and limit their scope to FTD
build. This helps reduce the code size of MTD build with logs
enabled.
This changes addresses the situation where we have a single device
in network configured as sleepy end-device going through attach
backoff intervals and then user changes the device mode to be
non-sleepy and FTD. This change ensures that device become leader
quickly.
This commit adds new logic in `Notifier` class (and how it is used) to
ensure when state/configuration is changed, each of the OT_CHANGED_*
events (e.g., channel, network name) is signaled for the first time
(even in case new set value is same as before).
This change addresses an issue where if user sets a parameter (using
OpenThread public APIs) before starting Thread operation the event
indicating the change would not be emitted.
This commit also defines `otChangedFlags` and `Notifier::Flags`
types, and updates the logging in `Notifier` to use `String` class.
This commit adds a new method `MeshForwarder::LogMeshMessage()` to log
info about messages with `MeshHeader` (messages that are forwarded by
device). The new logs indicate when a message is received/sent or
possibly dropped. The immediate source and destination for the
received or sent frame is logged. The new logs include info from
`MeshHeader` such as mesh source, mesh destination, number of hops
left. If the message is fragmented, info from fragment header such as
datagram tag and offset is included in the logs. For a non-fragmented
or a first fragment, `LogMeshMessage()` will also decompress the IPv6
and transport (UDP/TCP) headers and provide info from them such as
IPv6 source/destination addresses, UDP/TCP checksum, source/destination
port numbers.
In addition to the new logs, this commit add the following changes:
- Adds `\t` to log lines which are grouped (make it easier to read).
- Adds `const` qualifiers to some methods in `Lowpan::MeshHeader`.
- Adds new method in `FragmentHeader` to init it from a `Message`.
- Refactors/updates some methods in `Lowpan` class (e.g., adding new
public method to decompress LOWPAN_NHC UDP header).
This commit fixes a bug when calling `MeshForwarder::Stop()` while the
discover operation is ongoing. In particular, while the send queue is
flushed, `mDiscoverTimer` is not stopped, resulting in a NULL pointer
dereference in the timer handler.
This commit also moves common cleanup code for the discover operation into
a single method.
* pending dataset should not be restored from local when ClearNetwork
* update the condition for stop /c/as registration attempts during dataset transition
This commit adds a new `toranj` test script to test IPv6 traffic
exchange over multiple hops in a network with chain topology:
r1 ----- r2 ---- r3 ----- r4
/\ | | /\
/ \ | | / \
fed1 sed1 sed2 sed3 sed4 fed4
Traffic flow:
- From first router to last router
- From SED child of last router to SED child of first router
- From FED child of first router to FED child of last router
The test covers the following:
- Verifies Address Query process over multi-hop to routers and FEDs
- Verifies Mesh Header frame forwarding over multiple routers.
- Verifies forwarding of large IPv6 messages (1000 bytes) requiring
lowpan fragmentation.
* add BRD4304A (MGM12P Module) board support
* make hal-config.h board-specific
Copied existing hal-config.h for BRD4161A and BRD4166A. For BRD4304A
used hal-config from Silabs Thread 2.6.2.0 ncp-uart-hw project without
WDOG, VUART, VCOM, UARTNCP and BSP_SERIAL_APP_PORT settings.
* enable FEM for the platforms that require it
This commit changes the posix platform radio implementation by not
invoking the `RadioReceiveDone` callback with error `OT_ERROR_ABORT`.
This is added to help remove extra logs when simulating OpenThread in
posix mode.
This commit adds a new template class `ot::String<size>` which
implements a fixed-length character string. This class is then used as
return value of `ToString()` methods from different classes. This
simplifies the `ToString()` implementation and its use. This commit
also adds a unit test for `String`.
This commit makes the following changes in `NcpSpi` class:
- It adds a new class `SpiFrame` which provides helper methods to
parse and update the header fields in the header of an SPI frame.
- It simplifies/enhances the `SpiTransactionComplete()` callback
implementation by combining the parsing of input/output frame
headers with the rx/tx frame processing.
- It adds a check for correct pattern bits in a received frame
flag byte (frames with incorrect pattern bits are ignored).
- Code format is changed to follow the "pretty" style.
- Fixes a rare issue with a possible incorrect accept length on
the first SPI transaction after NCP reset.
This commit adds MLE Data Request timeout and retransmissions for
rx-off-when-idle devices. rx-on-when-idle devices do not require explicit
retransmissions because MLE Advertisements will trigger an rx-on-when-idle
device to send the MLE Data Request again. However, if an rx-off-when-idle
device fails to receive an MLE Data Response, it will never attempt to
request again.
Thread 1.1.1 Section 5.9.4 states: "Note that failures to transmit due to
failed clear channel assessments do not count as a failure to receive an
ACK."
This commit adds a new log level `NOTE` between `INFO` and `WARN`. The
`INFO` level is intended for informational message about behavior of
the network (e.g., info about received/transmitted messages). `NOTE`
level is intended for normal but significant events that require
special handling (e.g., device getting detached) and are expected to
be less frequent that `INFO` level events and logs.
After attaching to a network, a device may need to wait until receiving the
next MLE Advertisement before populating the router table.
This commit makes the following changes:
- When receiving an MLE Advertisement, always process the Route TLV when the
router table is not yet populated.
- Have RouterTable::GetLeaderAge() return max value when the router table
is not yet populated.
- When generating a Connectivity TLV, populate the max routing cost when
no leader information is available.
The NXP KW41Z radio driver prohibited changing channels while in receive
mode; this prevented the leader properly responding to MLE Announces from
orphaned child devices.
This commit adds "attach backoff" feature in MLE. When enabled, an
exponentially increasing backoff wait time is added between attach
attempts. If device is sleepy, the radio will be put to sleep during
the wait time. This ensures that a battery-powered sleepy end-device
does not drain its battery by continuously searching for a parent to
attach to (when there is no router/parent for it to attach).
`OPENTHREAD_CONFIG_ENABLE_ATTACH_BACKOFF` configuration option can be
used to enable/disable this feature. It is enabled by default.
This commit makes the following changes in `TrickleTimer` class:
- Member variable are renamed to follow the code style guideline.
- New methods added for handling of "end of interval" vs. "middle
of interval" timer fired callbacks.
- The random range selections for mode `kModeNormal` are updated
to follow RFC6206.
* Replaced 'the the' string with 'the'
* Fix promiscuous mode filtering issue
* Stop ACK wait timer after the ACK was received
* Filter ACK frames durind RX sequence. Only TR sequence will allow ACK frames.
This commit changes how the log level and region prefix strings are
appended to OpenThread's log strings. Instead of the prefix strings
being generated and added at run-time, with the change in this commit
they are appended as part of the format string of `otPlatLog()` during
compile-time.
This commit contains two changes:
- When PAN channel is changed, the CCA success rate tracker is reset
- CCA tracker is updated only for frame transmissions on PAN channel
This commit adds a new `toranj` test script which covers the
following functionalities:
- Adding on-mesh prefixes using wpantund `config-gateway`
command.
- Prefixes with different flags/priorities on routers/end-devices.
- `wpantund` behavior adding SLAAC based IPv6 address.
- `wpantund` retaining user-added prefixes and adding them back
after an NCP reset.
This commit changes how the received MLE Announce messages are
processed.
The new implementation adds a delay before taking action when it
receives an MLE Announce message that has a more recent Active
timestamp (compared to device's current Active Dataset timestamp). A
timeout interval of `kAnnounceProcessTimeout` (250ms) is used before
the device switches to the new channel or pan-id from the received MLE
Announce message. During the timeout interval, device can receive and
parse other MLE Announce messages and it will ignore any with the same
timestamp.
This commit adds helper methods in `Mle` class to check whether
different flags are set in device mode, such as `IsRxOnWhenIdle()`,
`IsFullThreadDevice()`.
This commit adds a new log output model for NCP to use a newly added
spinel stream log property. `OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL`
can be used to be select the new log output model.
This commit defines a new spinel property `SPINEL_PROP_STREAM_LOG`
which provides streaming of formatted log string from NCP along with
an optional metadata structure. OpenThread log level and log region
are included as part of the metadata.
This commit also updates the `toranj` configuration header file to
use the new log output model.
It seems TI (for whatever reason) chose to use a rather unorthadox
mixed-endian representation for the MAC address in the CC2538, where the
most significant 4 octets are given first in little-endian order,
followed by the least significant 4 octets (again in little-endian).
The OpenThread code expects a big-endian representation of the MAC, so
we need to read in and byte-swap each half individually.
This commit adds new methods/classes related to parsing of Channel
Mask Entries in a Channel Mask TLV.
A new class `ChannelMask0Entry` is added for a Channel Mask Entry
with Channel Page 0.
`ChannelMaskTlv::GetFirstEntry()` and`ChannelMaskEntry:GetNext()`
methods are added and can be used to iterate through all the
entries in a Channel Mask TLV.
New method `ChannelMaskTlv::GetMask0Entry()` can be used to search
among all entries to find the one with Channel Page 0 (if one exist).
This commit adds a new feature/class namely `AnnounceSender` which
enables periodic transmission of MLE Announce messages on all
channels. The feature can be enabled using the config option
`OPENTHREAD_CONFIG_ENABLE_ANNOUNCE_SENDER` (disabled by default).
This commit also adds some new helper methods in `Mac::ChannelMask`
to get number of channels in a given mask, and operator overloads
to compare two masks.
This commit changes the attach state machine and how the MLE Announce
messages are sent as part of the attach process. A new attach state
`kAttachStateAnnounce` is added where the device sends MLE Announce on
all channels (in Active Dataset's channel mask).
This commit also adds a new `toranj` test-case which tests the
situation where a device misses a channel change and then reattaches
by sending MLE Announce messages.
The existing router table allocated a router entry for every possible router
id value (63). Beacuse Thread only allows at most 32 active routers in a
given network, allocating 63 router entries is wasteful. This commit
allocates only 32 router entries and dynamically manages the pool of router
entries.
This commit adds a new test-script in `toranj` to test the insecure
traffic exchange (during partial join). The test covers the
following functionalities:
- Using specific insecure port through wpantund `permit-join`
- `wpantund` keeping track of insecure traffic flow (source
address/port) and sending replies insecurely.
- `wpantund` switching to secure mode after receiving a secure
message from a source.
To ensure proper and expedient shutdown of Openthread when the Interface is brought down, this change provides a mechanism to gracefully stop the MAC layer operations. Scans are stopped by preventing any new channel change. New Transmissions are stopped. Existing transmissions are allowed to complete. Any pending operations are cleared.
This commit updates `Mle::SendParentRequest()` method to accept
a type as input parameter indicating whether the "Parent Request"
is targeted for all routers or for all routers and REEDs.
This commit renames some of enumeration constants, types, and variable
names in `Mle` related to attach process. In particular,
- `AttachState` enum & its constants (replacing `ParentRequestState`)
- `mAttachTimer` instead of `mParentRequestTimer
This code does not contain any logic change to the code.
This commit updates the `test-003-join` test script to add a case
for joining without first setting network key and checking the
wpantund state "associating:credentials-needed".
This commit adds a new method `Mle::SetRole()` to update the device
role. This method is used in MLE class instead of direct assignment to
`mRole` variable. The `SetRole()` will ensure to set flag on
`Notifier` (when there is a role change) and also log the role change.
This change simplifies the code and addresses a (rare) issue where
notifier callback would not be invoked on transition from "detached"
to "disabled" role.
This commit changes how MLE Announce messages are sent in response to
a received MLE Announce. In addition to a multicast MLE Announce
message, a unicast MLE Announce is also sent. This behavior can be
controlled using `OPENTHREAD_CONFIG_SEND_UNICAST_ANNOUNCE_RESPONSE`
config option. By default this is enabled.
This commit also changes actions taken after receiving an MLE Announce
in `Mle::HandleAnnounce()` to handle the situation where a device may
receive multiple MLE Announce messages with same info. No action is
taken if the device is detached, and current channel and panid match
the values from the received MLE Announce message.
This commit changes the `Mac` logic for handling ack timeout to put
the radio in receive mode before invoking the `HandleTransmitDone()`
callback with the `OT_ERROR_NO_ACK` status. This ensures that the
radio can be put to sleep after a no-ack error.
This commit adds a new test-case (under `toranj`) related to
controlling of NCP's MCU power state and iterations between
NCP and wpantund (related to MCU sleep).
This commit adds new `toranj` test scripts to test newly added
functionality by `ChannelManager` including:
- Test to check new spinel/wpan properties,
- Test to check channel change request feature,
- Test to check channel selection feature.
This commit also updates the posix/radio `otPlatRadioGetRssi()` to
emulate a simple interference model where it would return either a
high or a low RSSI value with a fixed probability per each channel.
This is used to verify the `ChannelMonitor` sampling logic and channel
selection functionality.
This commit updates `ChannelManager` class to add support for "channel
selection" logic where the `ChannelManager` can select a channel (for
network to switch to) based on the collected channel/link quality data
(by `ChannelMonitor` module). This commit also adds support for auto-
channel-selection functionality where `ChannelManager` will periodically
check to see if network can/should switch to a better channel. This
commit also adds public OpenThread APIs for all newly added
functionalities.
This commit changes the API names (and spinel properties and
documentation) related to "channel monitor" feature to use "channel
occupancy" instead of the term "channel quality" to represent the
rate/percentage of RSSI samples which are higher than a threshold.
This commit adds a new feature under posix platform to emulate
time (platform Alarm APIs) with a given speed up factor (i.e., as
if time runs `x` times faster). The speed up factor can be given
when running the NCP app as an input argument (default is 1).
This commit introduces a new class `ChildTable` as part of OpenThread
core. This class provides methods for iterating through the child
table and searching for a specific child (based on short/extended
address and/or child state). This commit also adds a unit test for the
newly added `ChildTable class.
Once jamming detection is enabled/started, `JamDetector` will also
monitor the Thread device role. RSSI sampling is stopped if the device
role changes to `DISABLED` and is resumed if the role changes. This
commit also adds new logs to this class to indicate when jamming is
detected or cleared and/or when any of the parameters get changed.
This commit adds `cleanup()` function in the `toranj` start script.
The cleanup code removes logs and any flash files, issues a `killall`
to remove any lingering `wpantund` instances (`wpantund` processes may
still be running from previous `wpan.Node` objects which are not yet
garbage collected by python). It also deletes any `wpan<num>` network
interfaces (this addresses the situation where even after `killall
wpantund` the network interface may stay active by kernel for some
short time, not allowing the next test-case to create network
interface with same name).
This commit changes the `spi-hdlc-adapter` retry logic when the slave
is busy (it refuses a transmission). There are three levels, initially
the retries happen almost immediately, then up to certain number of
attempts at a fast rate and finally it drops to a slow rate.
This change helps with the average delay of spinel message exchange
between NCP and host (connected using an SPI interface).
This commit adds a configuration option to enable NCP power state
control `OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL`.
When enabled, the platform is expected to provide two functions:
`otPlatSetMcuPowerState()` and `otPlatGetMcuPowerState()`. Host
can then control the power state using the newly added spinel
property `SPINEL_PROP_MCU_POWER_STATE`.
This commit removes the `Start()/Stop()` APIs from `ChildSupervisor`
class. Instead `ChildSupervisor` class itself would decide when to
start/stop. It registers a `Notifier` callback to be notified when the
Thread role changes and/or when a child is added or removed. If MLE
operation is enabled and there is at least one "valid" child in the
child table, child supervision starts, otherwise it is stopped.
This commit updates the `start.sh` script under `toranj` test
framework so that failed tested are tried again up to 3 times.
It also modifies how wpantund project is built and installed
under `toranj`.
Pseudo resets allow for `otPlatReset()` to reset the OpenThread state
without resetting the chip. This is important if the SoC is presenting
itself as a USB device.
The build option `OPENTHREAD_PLATFORM_USE_PSEUDO_RESET` can be used to
force this feature to be enabled or disabled by setting it to `1` or
`0` accordingly. Otherwise it will be set to a platform-specified
default value.
Previously, ICMPv6 Echo Request handling was either enabled or disabled.
This commit allows enabling/disabling the handler for ICMPv6 Echo Requests
sent to unicast and multicast destinations separately.
This commit also adds an associated spinel property and NCP implementation.
This commit reduces stack usage when receiving/updating network data via MLE
by copying the network data directly out of the message and skipping the TLV
read.
This commit reduces stack usage when writing operational datasets to
non-volatile by writing out dataset as given and moving the cleanup of TLVs
when reading the dataset out of non-volatile.
This commit adds the base implementation of `toranj`, a test framework
for OpenThread and `wpantund`.
- It enables testing of combined behavior of OpenThread (in NCP mode),
spinel interface, and `wpantund` driver on linux.
- It can be used to simulate multiple nodes forming complex network
topologies, testing network interactions between many nodes
(e.g., IPv6 traffic exchanges).
This commit also sets up the new test-cases to run as part of travis
pull request validation in OpenThread GitHub projects.
This commit adds `OPENTHREAD_CONFIG_NCP_SPINEL_LOG_MAX_SIZE` as
a config option to set the max log string size supported by NCP
`otNcpPlatLogv()`. This commit also increases the default to 150
characters.
This commit caches the Active/Pending Timestamp value in memory so that
subsequent calls to `DatasetLocal::Compare()` does not require reading
from non-volatile settings and allocating another dataset buffer on the
stack to do so.
This commit makes the following changes:
- Only print logs on success.
- Remove use of `HostSwap64()`, which can cause hard faults.
- Add `ExtAddress::ToString()` method.
This commit adds a new config option which determines if the source
and destination IPv6 addresses of received/sent messages are logged
from `MeshForwarder::LogIp6Message()`.
Thread does not support address resolution for link-local unicast addresses.
As a result, any link-local unicast address other than the one based on the
IEEE 802.15.4 Extended Address is not useful.
* Use variables for MCU and board to allow configuration via makefile parameter.
* Add a switch in the efr32 Makefile to choose between supported boards.
* Update efr32 README according to the new possibility to choose between boards.
This commit adds a new header file `common/random.hpp` which
provides functions related to generating random numbers including
a helper function `FillBuffer()` which fills a given buffer with
random bytes. The OpenThread core files are updated to use the
new helper functions.
Updating the bidirectional link quality requires a two-way exchange via MLE
Advertisements. In the worst case, this can take 2.5x the worst-case MLE
Advertisement period. This commit increases the delay after updating link
quality configurations.
This commit changes how `Mac::HandleReceivedFrame()` handles duplicate
received frame when a sleepy device is waiting for data after a data
poll ack from parent indicating a pending frame. This change ensures
that the sleepy device can go to sleep faster and avoid a data poll
timeout.
This commit adds a `Mac::ChannelMask` class to define a channel (a
`uint32_t` bit-vector specifying a set of channels). The `ChannelMask`
class provides methods to add/remove channel to the mask, intersect
two masks, and iterate through the channels in the mask. A unit test
for the new class is also added.
This commit makes the following changes to (platform) makefiles:
- Removes conditional source file inclusions in Makefiles and
adopts the model where the source files themselves would add
`#if` check for the config option (this is the model adopted
in OpenThread core).
- Defines `PLATFORM_SOURCES` to include all the sources files
- Adds `PRETTY_FILES` to specify files for "make pretty-check"
This commit also adds `PRETTY_FILES` in unit test makefile.
This commit adds new logic in `ChannelManager` to help handle
situations where multiple devices within network request channel
change around the same time. This simplifies how the channel change
can be triggered by users allowing them to request a channel change on
all routers/devices simultaneously (this would help with cases where
the Thread network contains multiple partitions).
In particular, this commit adds a jitter delay to start processing of
a channel change request (random delay before a Pending Dataset is
prepared and sent to leader). Also this commit changes how the Pending
Dataset is prepared and sent. The code now checks if there is a valid
Pending Dataset and if it is changing the channel to same one as the
current channel change request, then it skips updating the Pending
Dataset.
This commits adds a new API to `ChannelManager` class (and a
a corresponding public OT API) to get the channel for the last
successfully requested channel change.
Sometimes when transmission is started RAIL_EVENT_RX_OVERFLOW
happens and then otPlatRadioTxDone is never called.
This commit makes sure the RX FIFO is always drained, even when
transmitting so RAIL_EVENT_RX_OVERFLOW never happens.
The existing platform.h is really a part of the examples and not a part of
OpenThread core. This commit moves the platform.h out of the public API
and into the examples directory.
This commit adds a new module/class `ChannelManager` which provides a
mechanism to perform a network-wide channel change. It internally
uses Pending Operational Dataset updates to trigger the channel change
in the network. It also manages retries in case of errors/failures.
This commit also adds public OT APIs for user to request a channel
change and get/set different parameters related to operation of
Channel Manager (e.g., supported channels mask).
This feature can be enabled using `--enable-channel-manager` configure
option (by default it is disabled).
* Increase max spi-align-allowance from 6 to 16
Testing has determined that some SPI slave interfaces sometimes emit
even more than 6 0xFF bytes before sending the first header byte. Upping
this value to 16 in order to provide some future proofing.
* Up version from 0.06 to 0.07
This commit adds `SPINEL_PROP_THREAD_NEIGHBOR_TABLE_ERROR_RATES`
as a new spinel property to get the frame and message error rates
for all neighbors. This property requires the presence of a newly
added Spinel capability `CAP_ERROR_RATE_TRACKING` which indicates
if the error-tracking feature is enabled in OpenThread.
This commit adds `OT_LOG_REGION_CORE` and `OT_LOG_REGION_UTIL` as
two new log regions. The Core is intended for any core module that
does not fit any other category. The `UTIL` is intended for all
modules under `/core/util` folder.
This commit implement a new feature to allow the tracking of tx error
rates at two layers:
- At PHY/MAC layer for MAC frame transmissions (frame tx error rate):
Error rate is maintained per link/neighbor. A frame transmission
attempt is considered failed if the frame is sent over the channel,
but no acknowledgment frame is received from the neighbor.
- Above MAC layer for message transmissions (message error rate):
A larger (IPv6) message may be fragmented and sent as multiple MAC
frames. The message transmission is considered failed, if any of
its fragments fail after all retry attempts. Message error rate is
maintained per link/neighbor and includes both direct and indirect
message transmissions.
Configuration option `OPENTHREAD_CONFIG_ENABLE_TX_ERROR_RATE_TRACKING`
can be used to enable/disable this feature. By default it is enabled.
`otChildInfo` and `otNeighborInfo` structs are updated to provide the
error rates for a child or neighbor.
This commit updates the implementation of `Mac::Address` class
adding getter and setter and other helper methods. When the address
is updated using the setter methods (`SetShort()` or `SetExtended()`
the `Address` class itself will update its type (remembering whether
it is an IEEE 802.15.4 Short Address or an Extended Address). This
helps simplify how this class is used in other modules.
This commit adds the following features:
- Example posix drivers to support virtual time simulation, allowing tests
to run faster than real time.
- A python-based simulation driver that coordinates the virtual time
simulations. Each alarm event and message transmission across all nodes
are scheduled in a single discrete time event queue. As a result, only
a single node is making forward progress at a time.
- Updated tests to utilize new virtual-time simulator, allowing them to run
faster than real time.
- To enable virtual time feature, define VIRTUAL_TIME=1 env var and set
CPPFLAGS=-DOPENTHREAD_POSIX_VIRTUAL_TIME=1.
Updates mainly include:
1) Remove explict registration APIs
2) Define a new constant to limit the maximum number of addresses to register
3) Fix duplicate delivery to SED for packet sent from the parent to the realm-local multicast address
its sleepy children subscribe (due to not differentiate MPL retransmission)
4) Some other refinements and resolve conflicts when rebase
This commit adds a new method `Child::GetMeshLocalIp6Address()`
to get the mesh-local IPv6 address registered by a child. The
unit test `test_child` is also updated to verify the new method.
This commit changes how a mesh-local IPv6 address is stored in
`Child` class. Instead of storing the entire IPv6 addresses (16
bytes), only the Interface Identifier (8 bytes) is saved. The full
address is derived (when needed) using the mesh-local prefix from
`Mle`. This reduces the memory required for storing registered IPv6
addresses in the child table.
This commit also updates the unit test `test_child` to use mesh-local
IPv6 address as part of the test and verify the behavior of new
implementation.
Remove redundant retargetserial.c as retargeting may
conflict with OT UART. Also retargeting doesn't work
without retargetio.c just consumes flash and RAM.
Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
This commit adds a new class `SuccessRateTracker` which can be used to
tracker success/failure rate of an operation. It uses an exponentially
moving average IIR filter to maintain the rate using a `uint16_t` as
its storage. Unit test `test_link_quality` is updated to include a new
test case ``ot::TestSuccessRateTracker()` verifying the behavior of
the new class.
This commit uses the new class to track the CCA failure rate (over all
frame transmissions) at MAC layer.
This commit updates/enhances the `Child` class methods related to
managing of the list of IPv6 addresses associated with a child. The
new model provides APIs to add or remove an IPv6 address, check if the
list contains an address, and a method to iterate through all IPv6
addresses of a child. The `mle_router` and `address_resolver` and NCP
implementations are updated to use the new APIs.
This commit also adds a unit test `test_child` to verify the newly
added methods.
This commit changes the checks in `Mle::SendChildUpdateRequest()` so
that if there is no valid/restoring parent the device immediately
becomes detached and will go through full attach process.
This addresses an issue with an end-device failing to re-attach after
reset in case the device can restore its network info from
settings/flash but there is no parent info entry in the settings.
This commit removes the unused errors (such as when the device is not
joinable or PAN Id from message does not match the device's PAN Id) in
`MleRouter::HandleDiscoveryRequest()`. This suppresses the (inaccurate)
MLE warning log "Failed to process Discovery Request" for above
scenarios.
* [ncp] Transforming spinel frames between AP and NCP
NCP Spinel Transformer allows to transform spinel frames sent between
Application Processor (AP) and Network Co-Processor (NCP).
Spinel frames can be transformed by using transformer library
(or libraries) implementing spinel_transformer.hpp. Libraries
can be specified using option --with-ncp-spinel-transformer-libs.
Addidionaly, transformer's outbound buffer can be changed if needed,
using option --with-ncp-spinel-transformer-outbound-buffer-size.
This reverts commit 87d8940abf.
Adding Network Data to the MLE Child Update Response message increases the
message size beyond what can fit in a single IEEE 802.15.4 frame. The
Thread specification requires all fragmented MLE message to have MAC
security enabled.
This commit contains fixes and enchantments for diagnostics module
in OpenThread. In particular, the following changes are made to the
implementation of `otDiagProcessCmdLine()`:
- Fixes an issue with the parsing of command line input (where if
more than 8 arguments were given, it could cause an out-of bound
array access and a possible NCP crash). The new code will check for
this and outputs an error if too many arguments are provided.
- Parsing logic is simplified and now allows for extra spaces between
arguments.
- A local buffer is used to store the arguments to avoid modifying
the passed-in input string.
This commit also simplifies and does a code clean-up of `Diag`
class (variable name changes, removing extra method paramters, and
minor style changes).
The `test_diag` unit test implementation is also updated:
- It includes new test commands.
- The test prints/logs the issued input commands and their
corresponding output (as human-readable printable strings).
This commit aborts the Address Solicit transaction on a partition change.
Doing so avoids having Address Solicit messages being sent to the wrong
Leader address and delays caused by waiting for the previous Address Solicit
transaction to time out.
This commit fixes the following issues:
1. The advertise timer is no longer stopped when sending an Address Solicit
message. This ensures that a REED continues to send MLE Advertisements.
2. The advertise timer is always started after becoming a child, even when
the router upgrade threshold is not yet met. This ensures that a REED
will start sending MLE Advertisements.
Calling the associated response handler simplifies the client's handling of
CoAP transactions.
This commit also fixes a bug in aborting multiple pending transactions.
This commit modifies the method assertSentToNode to confirm if the destination Mac address of
the message is the node's Mac address. Add method check_parent_request, check_parent_response,
check_child_id_request and check_child_id_request to command.py.
REEDs periodically transmit MLE Advertisement messages to support merging
partitions. However, REEDs do not include Route64 TLVs in their MLE
Advertisement messages.
This commit removes the strict requirement check when handling MLE
Advertisement messages, allowing such messages sent by REEDs to trigger
the partition merging process.
Prior to this commit, a REED attempting to become a router clears its
routing table state when sending the Address Solicit message. This causes
the REED to improperly think that it is a singleton when determining whether
or not to merge with another partition.
This commit only updates the routing table state when the REED actually
transitions to becoming a router.
This commit moves restarting the state update timer to the top of
`MleRouter::HandleStateUpdateTimer()`. This ensures that the timer
continues to fire periodically. Prior to this change, the state update
timer is not properly restarted when `mRouterSelectionJitterTimeout`
expires.
This commits contains the following changes related to channel
monitoring feature:
- It adds OT public APIs for this feature.
- It defines new spinel properties (and their documentation).
- It implements `NcpBase` get handlers for the new properties.
This commit adds a Network Data TLV request to the MLE Child Update Request
message when trying to resynchronize with a parent after reset. This
eliminates the need for an MLE Data Request/Response exchange following the
MLE Child Update Request/Response exchange.
This update also makes the following changes:
- Initialize chip using `halInitChipSpecific()` provided by RAIL HAL.
- Use `RAIL_HoldRxPacket()` to move rx processing out of interrupt context
- Eliminate critical sections from `otPlatRadio*` APIs.
- Use UART driver provided by Gecko SDK.
This commits introduces channel monitoring feature which monitors
signal level on all channels to help determine the cleaner channels
(channels with less interference).
When enabled and started, `ChannelMonitor` class will perform a
zero-duration Energy Scan collecting a single RSSI sample per channel,
every sample interval (which is a build-time configurable parameter).
The RSSI samples are then compared with a (build-time configurable) RSSI
threshold. As an indicator of channel quality, the `ChannelMonitor`
class maintains and provides the average rate/percentage of RSS
samples that are above the threshold within (approximately) a
specified sample window length.
The unstable failing lies in when Leader has lower partition id and switches to better partition
formed by original routers. The default RouterSelectionJitter of Leader is 120s, however the
migration waiting time in script is 60s, thus there are chances that the ping happens when the
Leader just becomes router in the new partition but before link sychronization, causing the ping
packet dropped on ROUTER3.
Two options to resolve this: 1) increase the waiting time for migration to a value > 120s or
2) configure router selection jitter to a small value to relax the waiting time requirements.
This commit changes the `ClearChildIndirectMessages(aChild)` method in
`MeshForwarder` to ensure that it also clears the indirect message
pointer on the child entry.
This addresses a subtle bug in the code in the following situation: If
we happen to receive a "Child Id Request" from an already valid child
for which we are in the middle of an indirect transmission, from
`MleRouter::HandleChildIdRequest()` all queued indirect messages for
the child are removed (through `MleRouter::RemoveNeighbor()` call).
This would then free the indirect message while the child still kept a
pointer to the freed message.
This commit changes the `SupervisionListener` implementation by
relaxing the checks for when to start the supervision listener timeout
timer, in particular relaxing the check for role to be `ROLE_CHILD`.
This addresses an issue where timer may not start during (re-)attach
process after a "Child Id Request" transmission where the device
becomes sleepy but it's not yet fully attached as a child.
This commit changes the logic for preparing a data poll (802.15.4 MAC
Data Request) frame and selecting short/extended address. It ensures
that during a parent switch attempt on a sleepy-end-device, the data
polls use the extended address as the source MAC address.
This commit changes the implementation of zero-duration energy scan
operation so that all RSSI samples (for different channels) are taken
within the same tasklet. This ensures that the zero-duration energy
scan operation can be performed quickly and radio is switched to its
normal channel avoiding any delays caused by other tasklets and/or
platform operations.
* Separate radio HAL from imported HAL files in nrf52840 platform.
* Update nRF52840 radio driver
* Update nRF52850 HAL files
* Update README.md files in third_party/NordicSemiconductor
This commit brings/syncs the change in `spinel.c` from wpantund.
This change was done as part of wpantund commit d77e7cbf23 which
addressed some of the fuzzer test issues.
Properly formed Route TLVs should never have more than 32 route entries.
This fix follows a "be liberal in what you accept" approach.
Credit to OSS-Fuzz.
This commit changes how MAC operations (frame tx, active/energy scan,
etc.) get started by adding a new tasklet `mOperationTask` which
is used to start/perform any pending operation. This ensures that
callbacks related to an operation are invoked after the method which
initiates the operation returns. For example, when a new `Mac::Sender`
is registered with a call to `Mac::SendFrameRequest()`, its callback
`FrameRequestHandler` would be invoked after the `SendFrameRequest()`
call itself returns.
The `mOperationTask` serves two purposes. It's mainly used for
starting a new operation. It is also used during Energy Scan to take
an RSSI sample.
This commit contains the following changes: It simplifies the MAC
scan implementation by adding common helper methods such as
`UpdateScanChannel()`. It also fixes an issue where invoking back-to-
back scan could cause the handler to be overwritten with NULL. It adds
support for special case of Energy Scan with zero scan duration to
collect a single RSSI sample per channel.
This commit contains the following changes: (a) It adds a new class
`Notifer` which can be used to register callbacks to be notified of
state or configuration changes within OpenThread. This is used both
internally (by other core OpenThread classes) or externally by
registering `otStateChangedCallback` handlers. (b) This commit also
adds a set of new `OT_CHANGED` flag definitions corresponding to
fields in the Thread Operational Dataset (e.g., the Thread network
channel changes map to `OT_CHANGED_THREAD_CHANNEL`). This ensures that
user is notified of changes to Active Operational Dataset. (c) Finally,
this commit adds support in `NcpBase` for the newly added `OT_CHANGED`
flags by emitting asynchronous spinel property updates corresponding
to the changed configuration properties.
This commit applies a hysteresis to establishing new links or merging
partitions. In particular, this commit introduces new minimum link
margin thresholds that must be met before attempting to establish a
new link or merging to a different partition. Enforcing a mininmum
link margin threshold before establishing new links helps avoid links
that will quickly become invalid due to normal time-varying link
qualities.
This change addresses some issues that was noticed while working to
bring up the OpenThread NCP on the nRF52840. The most important change
is the introduction of the macro `USB_HOST_UART_CONFIG_DELAY_MS`, which
will slightly delay the output of queued data once the fake UART is
opened. On some slow Linux systems, the USB-CDC-UART driver sends the
data so quickly after the port opens that the application hasn't had
time to get the TTY properly configured using tcsetattr(). While this is
technically a host-side problem, fixing this problem host-side is
architecturally infeasible in many cases. Ensuring the reliable delivery
of the first bytes of the HDLC stream from the NCP after a reset is
critical to the host driver being able to identify that a reset has
indeed occurred. Waiting a few milliseconds after the port is opened
allows the reset reason frame to be reliably transmitted.
When an OpenThread NCP starts up, the only thing it should emit is a `CMD_PROP_VALUE_IS` for `PROP_LAST_STATUS`, with a reset reason as the status code.
However, up until this point we have been also dumping out lots of other details which happen to be triggrered by OpenThread's start-up code. This is effectively noise, since a properly implemented host driver would be explicitly fetching the values of properties it needs to know at startup.
This change fixes this by supressing all property updates at startup except `PROP_LAST_STATUS`.
This commit adds a new feature in `NcpBase` to allow spinel responses
for property "get/set" commands to be saved/queued by NCP. This in turn
helps to ensure that the responses are never dropped/missed due to NCP
buffer space not being available at the time of processing of the command.
The responses are sent when NCP buffer space becomes available.
This commit implements a "Periodic Parent Search" feature in MLE.
This feature is disabled by default and can be enabled through
`OPENTHREAD_CONFIG_ENABLE_PERIODIC_PARENT_SEARCH` configuration
option.
When enabled, an end-device/child (while staying attached) will
periodically search for a possible better parent and will switch
if it finds a better one.
The child will periodically check the average RSS value for the
current parent, and only if it is below a specific threshold, a
parent search is performed. Since the parent search process can be
power consuming (child needs to stays in RX mode to collect parent
response) and to limit its impact on battery-powered devices, after a
parent search is triggered, the child will not trigger another one
before a specified longer backoff interval. The check and backoff
intervals along with the RSS threshold used to trigger the parent
search can be set from a set of configuration options.
This commit allows a device to execute the MLE attach protocol without first
having to detach from it's existing parent. This change allows a device to
search for a better parent without disrupting existing connectivity.
This commit involves the following changes:
1. Support sending MLE Parent Request and receiving MLE Parent Response
while attached.
2. If the set of MLE Parent Responses yields a better parent than the
one the device is currently attached to, the device proceeds to complete
the attach process with the better parent.
Calling `PlatformDeinit()` before calling `NVIC_SystemReset()` reduces
the reliability of `otPlatReset()` to always work properly, and doing so
seems superfluous if you are just going to reset the chip anyway.
This fixes issue #2383.
This commit changes the `MleRouter::RestoreChildren()` so that it
can detect invalid child info in non-volatile settings (e.g., if there
are more entries than max allowed/supported children, or if there are
duplicate entries with same ext address in the list). If any error is
detected the non-volatile child info is refreshed (erased and
re-written).
This commit adds code in `NcpFrameBuffer` to check and limit the
number of segments in a frame (being read). This is to help detect
cases where the underlying buffer may get corrupted.
This commit makes the following fixes:
- Relax the length check in `RemoveStoredChild()`
- Remove children that do not match router ID
- Simplify restoring logic and remove `mIsRouterrestoringChildren` state var
This commit adds a new class `OwnerLocator` which is used by the
callback providing types (like `Timer` or `Tasklet`) to remember the
owner of the object. This change help simplify the handling of
callbacks from such objects. The object itself can be used to get
to its owner using `GetOwner<Type>()` method. If support for multiple
OpenThread instances is enabled, an `OwnerLocator` object maintains a
pointer to the owner. But for the single OpenThread instance scenario,
the owner is derived from the single `ot::Instance` object.
Thread (and OpenThread) does not employ any form of transmit power control.
As a result, while OpenThread provides APIs to control transmit power, it
simply buffers and passes the transmit power value straight through to the
radio.
Currently, the transmit power APIs allow specifying an int8_t in units of
dBm. This is overly constraining for platforms that have more advanced ways
of configuring the transmit power.
This commit removes the transmit power configuration from the core. This
provides better flexibility in platform-specific ways to configure transmit
power.
* [core] Make CLI buffer sizes configurable.
At the moment, we allocate 512 bytes for a receive buffer and 1kB for
transmit, which while it doesn't seem a lot, is in fact a big commitment
for a CLI interface. In cases where the platform does its own
buffering, this can be significantly reduced.
These add definitions that mirror the current settings so they may be
changed.
* [cli] Define UART buffers according to config.
Use the definitions produced in the previous commit to set the buffer
sizes.
* [core, cli] Rename OPENTHREAD_CONFIG_CLI_LINE_LENGTH
to `OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH` as per review in pull request 2351.
This commit adds a new field `mIsStateRestoring` to `otChildInfo`
struct to inform the if the child is being restored. This field is
used in `NcpBase` to filter child entries in restoring state.
This commit adds new spinel properties related to Thread Operational
Dataset and implements the corresponding get/set handlers for the
new properties in `NcpBase`.
This commit makes the following changes: It defines the public
`otInstance` as an empty opaque structure which is used by all public
C OpenThread APIs. It defines a new class `ot::Instance` (inheriting
from `otInstance) which is then used in core source files. The
functionality related to the instance is also moved/added into the
newly added `Instance` class (as class/static or member methods).
There may be short windows where a device does not have the proper Thread
Network Data. For example, when a device is coming out of reset and
resynchronizing with the rest of the network.
This commit suppresses MLE Data Response transmissions while the device is
trying to receive the latest Thread Network Data from a neighbor. This
eliminates the possibility that the device may propagate inconsistent
Thread Network Data.
This commit fixes spurious failures in Cert_9_2_15_PendingPartition.py.
Initially fixed size 8k was allocated for stack.
As result there was almost no free RAM. This
change creates stack on all free RAM.
Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
This commit adds support for encoding/decoding `uint64_t`/`int64_t`
to spinel as primitive types. `X` and `x` are used as format ASCII
character associated with `uint64_t` and `int64_t` respectively.
This commit also updates the `SpinelEncoder` and `SpinelDecoder`
to add methods related to 64-bit long integer. The related unit test
are also updated.
This commit adds new public OpenThread API to set a callback for user
to be notified when a child table entry is being added or removed. This
callback provides info about the child entry and is always invoked before
the `otStateChangedCallback`.
This commit also updates the `NcpBase` implementation to use the new
callback and emit a `VALUE_INSERTED` or `VALUE_REMOVED` async spinel
frame to host whenever child table gets updated. If the async spinel
frame can not be sent (running out of NCP buffer space), an async
`LAST_STATUS(NOMEM)` spinel frame is sent and the entire child table
is sent later (when buffer becomes available) as an async `VALUE_IS`
spinel message.
This commit fixes an overflow issue when forming the Address Registration
TLV within an MLE Child ID Response message. The overflow can cause the
resulting message to be malformed.
This commit adds a new property `SPINEL_PROP_THREAD_ROUTER_TABLE` and
its corresponding get handler to `NcpBase`. The spinel documentation
is also updated. Some of the documentations for the related APIs are
also updated.
The MLE attach logic would only execute if no MLE Parent Response messages
were received and assumed that a Child ID Request/Response exchange would
eventually succeed if an MLE Parent Response message was received.
This commit moves that logic to when an MLE Parent Response is received but
a Child ID Request/Response exchange fails.
This commit changes the order of member variable declarations in
certain classes to group them by size/alignment requirement and
also to avoid having the first member variable of class to inherit
from `InstanceLocator` for a class which its itself a sub-class of
`InstanceLocator` (this is to avoid extra memory padding added for
empty base class).
This commit also re-defines some of the public member variables in
`Ip6` and `Commissioner` classes as a private and provides getter
methods to access them.
This commit changes the model for OpenThread classes so that all
classes track/locate their owning/parent `otInstance` object (i.e.,
the owning `otInstance` object reference is expected to be passed as
an input argument in the object constructor). This replaces and
simplifies current model where some of classes track/locate the parent
`ThreadNetif`, `MeshForwarder`, or `Ip6` object references instead.
This helps harmonize the model across OpenThread source and also
simplify the `Locator` class implementation.
Millisecond and microsecond timers used by OpenThread can overflow during
application run. This commit sets RTC Compare Channel to correct value
after overflow.
This commit changes/fixes the `MeshForwarder::RemoveMessages()` to
check if the message being removed is the current indirect message
stored in child entry and if so, we ensure to clear the pointer in the
entry. It also adds a new private method in `MeshForwarder` called
`RemoveMessageFromSleepyChild()` to refactor the common code used in
both `RemoveMessage()` and `RemoveMessages()`.
This commit simplifies the config header files includes in
OpenThread core and non-public source files. With this change the
"openthread-core-config.h" becomes the main config header file. This
header file includes all other config ones:
1) The `configure` generated `<openthread/config.h>;
2) The project specific one by `OPENTHREAD_PROJECT_CORE_CONFIG_FILE`;
3) The "openthread-core-default-config.h" defining default settings.
With the change in this commit, all header files include "openthread-
core-config.h" as the first `#include`, and in `.cpp` files, the first
`#include` continues to be the unit's corresponding header file. The
new model ensures that the configuration settings are visible and
consistent in all the source files. This commit also updates the
style guide document accordingly.
This commit changes how the outbound datagram IPv6 messages (going
from NCP to host over spinel) are handled. If NCP spinel buffer is
full, new outbound messages are saved in a message queue and are
transfered later (as soon as buffer space becomes available). This
ensures that outbound IPv6 messages are never dropped due to spinel
NCP buffer being full.
To realize this, the following changes are made in this commit: (a)
The behavior of methods `NcpFrameBuffer::InFrameFeedMessage()` and
`SpinelEncoder::WriteMessage()` is changed so that the passed-in
message ownership changes to NCP buffer ONLY when the entire spinel
frame is written and the frame is successfully ended/finished. If the
spinel frame gets discarded (e.g. no buffer space) the caller continues
to own the message instance and should either free or save it. (b)
The unit test `test_ncp_buffer` is changed to address and check for
this change. (c) The `NcpBase::HandleDatagramFromStack()` is modified
to implement/use a message queue to save outbound messages and try again
to send the queued messages from `HandleFrameRemovedFromNcpBuffer()`
callback (when spinel buffer becomes available).
This commit adds a new class `SpinelDecoder` which provides a set of
methods/APIs to help in decoding/reading content using Spinel formating
(it is practically a C++ wrapper over Spinel C APIs). A unit test
`test_spinel_decoder` is also added in this commit.
This commit also updates the `NcpBase` implementation to adopt the new
`SpinelDecoder` class mainly in set, insert, and remove handlers
for different Spinel properties. The new class provides similar advantage
as `SpinelEncoder` by simplifying the handler implementations and adding
type-check safety when parsing/reading the spinel frame.
This commit updates the `MessageQueue` implementation to allow
messages to be added to head/front of the queue. It adds new methods
to the `MessageQueue` class and a corresponding one in public
OpenThread APIs (`otMessageQueueEnqueueAtHead()`). This commit also
updates the `test_message_queue` unit test to add cases/scenarios for
testing the new methods and public APIs.
While the previous partition ID is stored in non-volatile memory, the last
known router ID sequence for that previous partition is not. As a result,
a node coming out of reset that initially fails to reattach to the previous
partition may not be able to reattach until the router ID sequence value
wraps. This commit also limits the time window with which to avoid the
previous partition ID.
Before rotating the key sequence counter, there is a check against the key
rotating guard time. The key switch guard time is intended to prevent
the key sequence counter from advancing too quickly. However, the existing
implementation only allowed the key sequence counter to increment if the
key switch guard time had *not* expired. Because the key rotation period
is larger than the key switch guard time, the key would never rotate.
This commit fixes the logic to check if the key switch guard time *has*
expired, when performing a key rotation.
This commit adds a new class `SpinelEncoder` which provides a set of
methods/APIs to help in encoding/writing content using Spinel formating
(it is practically a C++ wrapper over Spinel C APIs). A unit test
`test_spinel_encoder` is also added in this commit.
This commit also updates the `NcpBase` implementation to adopt the new
`SpinelEncoder` class mainly in implementation of get, insert, and
remove handlers for different Spinel properties. The new class
provides the following advantages: (a) it simplifies the
implementation of handers, particularly get-handlers for properties
with a single type output; (b) it adds type-checking and type-safety
when frames are being created, e.g., if the Spinel format expects a
`SPINEL_DATATYPE_UINT8` but a `uint16_t` value is provided, the new
model will cause a compile-time error (few instances in code where the
types did not match are fixed in this commit).
* New Platform Startup
* Flash memory handling improved
* Ramdom generator improved
* Faster platform reboot
* UART based on interrupts intruduced
* ARM core and linker related files moved to "third_party" folder
* Radio Sleep Fixed
* TLS config fixed
* Software FIFO for UART added
Due to the nature of how frames can be processed in ncp_uart.cpp, it is possible for a call to otPlatWakeHost to execute before the SPINEL_PROP_HOST_POWER_STATE response message has been sent to the host. This order is unexpected and not sufficient for proper operation. Instead the call to otPlatWakeHost should only occur after the SPINEL_PROP_HOST_POWER_STATE response message has been sent and only when a new subsequent message has been made ready for delivery over the UART.
To solve this, the change below detects when the SPINEL_PROP_HOST_POWER_STATE response message has been completely written to mUartBuffer and immediately calls otPlatUartSend() when this condition is met. With this change the expected order of operations can be maintained.
This commit adds logic to inspect forwarded frames and update the address
cache. If an entry exists for the given IPv6 Source Address and the
RLOC16 source differs, the address cache entry is updated.
This change addresses an input validation error when parsing malformed
Spinel string fields. This change may have security implications.
This change also proactively adds an additional sanity check on the
size of the data buffers being passed to the pack/unpack functions,
limiting the maximum input size to 32767 bytes.
With the Spinel data packing format, fields with the type `U` are
zero-terminated strings. Failure to zero-terminate a string is a
syntax error that usually causes `spinel_datatype_vunpack_` to
explicitly fail. However, if there were no bytes left in the unparsed
data buffer when the parser gets to parsing a string field, then this
condition is triggered and undefined behavior results.
This bug could allow an attacker that is already in control of either
the NCP or the host to bypass the zero-termination check on a Spinel
string field, leading to undefined behavior on the other device and,
most likely, Denial Of Service. Note that if an attacker has already
compromised either the NCP or the host, the ability of the attacker to
deny service is a foregone conclusion.
This bug is not a buffer-overflow: this bug results in a garbage
string with no explicit zero termination being returned to the caller.
Such strings usually lead to crashes, not code execution. However, it
is not immediately clear that this bug couldn't be cleverly exploited
in such a way as to enable remote code execution. If such a method was
found this bug would be a vector for a compromised NCP to compromise
the host, and vise versa.
The Thread 1.1.1 Specification currently defines a "singleton" as a Thread
network partition that consists of a single router that has no
router-eligible end device children. At the same time, Thread 1.1.1 does
not provide a way for a router to decipher between a Full End Device (FED)
and a router-eligible end device (REED). This ambiguity can cause two
partitions to avoid merging, since each partition may determine that they
are higher priority than the other.
This commit makes the change to counting only active routers, which
eliminates the ambiguity above.
This commit re-arranges some of the OpenThread configuration
definitions in `openthread-core-default-config.h` such that all the
log related options are close to each other. It also moves the
verification of debug uart dependency into the `logging.cpp` file
Message buffer allocation can fail if there are no available message
buffers. Without a way to evict messages, critical messages (i.e. MLE
Advertisements) needed to maintain the Thread network cannot be generated.
This commit takes a first step towards evicting queued message buffers. In
particular, this commit evicts indirect messages from the head of queue
until there are enough available buffers.
Future commits will seek to implement fairness and priority mechanisms to
better select which messages are evicted from the send queue.
`InformPreviousParent()` uses `Ip6::SendDatagram()` to submit an IPv6
datagram with no next header. However, if `Ip6::SendDatagram()` returns
an error, custody of the message buffer remains with the caller. This
commit ensures the message buffer is properly freed in this case.
This commit updates the `otNetworkDataIterator` to also store the
sub-tlv offset (in addition to main prefix tlv offset and the entry
index). It also updates two methods `GetNextExternalRoute()` and
`GetNextOnMeshPrefix()`. This commit also adds network data unit
test module.
Add a fuction in node.py node_cli.py to node's address.
Add a module command to verify commands.
Spinel-cli.py doesn't request address for dhcp prefix now, so put
Cert_5_2_05_AddressQuery.py in XFAIL on ncp.
This commit adds a new feature for a child to inform its previous
parent when it attaches to a new parent. OpenThread config option
`CONFIG_INFORM_PREVIOUS_PARENT_ON_REATTACH` controls the behavior of
this feature (default is disabled). If this feature is enabled, after
a device attaches to a new parent, it sends an IP message (with empty
payload) to its previous parent.
This commit adds logic to inspect frames being forwarded to determine if
a child has moved to a different parent. If the message was received from
a neighboring router and the IPv6 source address matches that of a child,
the child is assumed to have moved and invalidated.
The Delay Timer value has a 32-bit range. However, the current Timer
implementation does not support the full 32-bit range.
This commit fixes the handling of large Delay Timer values by splitting
the delay across multiple timer triggers.
Credit to OSS-Fuzz.
This commit adds additional check in `MleRouter::RestoreChildren()`
method for repeating/duplicate child entries (child entries with
same extended address) when restoring child table from non-volatile
memory. If there are more than one entry, the last one will be used.
This commit updates the behavior of `ENABLE_BEACON_RSP_WHEN_JOINABLE`
feature. When this feature is enabled, the device will transmit IEEE
802.15.4 Beacons in response to IEEE 802.15.4 Beacon Requests even
while the device is not router-capable and detached.
This commit adds 3 new configurations to travis test build under the
BUILD_TARGET posix. The first two are representatives of common router
and SED devices. The last configuration disables all features.
Also add a method last_mle_message to find the newest mle; Add a method assertAssignedRouterQuantity to confirm if Leader contains the Route64 TLV with 32 assigned router IDs.
Previous behaviour of the joiner would result in the joiner joining
the network with the highest channel number, rather than the most
suitable. This commit utilizes the priority specified in thread spec
1.1.1 section 8.4.4.1.2 to choose the most suited network for joining.
This removes the bug where it would be impossible to join the desired
network due to another network on a higher channel allowing all joiners
in the steering data.
This commit fixes an issue with the `NcpUart::EncodeAndSendToUart()`
code where the last message can be removed from `mTxFrameBuffer`
and if we ran out of buffer and cannot finalize the HDLC encoded
frame, the final bytes would not be sent until next message is
queued in `mTxBuffer`.
This commit increases the time in waiting for a child to reattach. This
reflects the recent change to add retransmissions to the MLE Child Update
Request message.
This commit fixes a bug when a child coming out of reset attempts to
re-establish the link to its parent. Upon coming out of reset, a child
will restore state from non-volatile memory, including its IEEE 802.15.4
Short Address. If the child fails to receive an MLE Child Update Response,
it begins the normal MLE Attach process in search for a new parent. However,
prior to this commit, the device would not reset its state back to the
detached state. As a result, a child may be stuck sending IEEE 802.15.4
Data Request messages using its old (probably invalid) Short Address.
This commit also enables retransmission of MLE Child Update Request
messages immediately after a reset. This increases the child's likelihood
of maintaining its existing parent, which is a desirable property in Thread.
This commit fixes a bug in SecureCoap encountered when testing commissioning.
A little bit of background - after GetOwner method in CoAP was introduced, a problem with a static handler of mRetransmissionTimer showed up. In single instance mode, whenever retransmission timer striked, static GetOwner method from Coap class was called, regardless if the timer was a member of a Coap or SecureCoap class.
As there are separate instances for Coap and SecureCoap: mCoap and mCoapSecure, the former one was always returned. In result, there was no chance to handle messages queued for retransmission in an instance of SecureCoap. This resulted in commissionig failure in case a retransmission of JoinerFinalize message was needed.
The same pattern would apply for any class that uses inheritance and uses GetOwner in static handlers.
This fix extends the Coap constructor with an optional parameter -aRetransmissionHandler. This way, SecureCoap instances can register their own static timer handler and thereby use correct GetOwner funcion.
Certain multicast addresses like "ff02::01" (Link-Local All-Nodes)
are fixed and will not change. The commit defines them as constant
entries which are then appended into the `mMulticastAddresses`
linked-list.
This commit changes the external route lookup logic to ensure that if
an external route prefix is registered by multiple routers (at same
priority level) within the thread network, during route/destination
lookup on a device which has registered this external route, the
router itself is selected/preferred over other routers. This addresses
an issue where a message destined for the external address can be
passed back and forth between routers.
The Thread Specification requires the router to repeatedly transmit
new Thread Network Data to the SED until it receive an explicit
acknolwedgment from the SED. Prior to this commit, when network data
changes, a router attempts to update the SED by sending a single MLE
Data Response message. If the message is lost for any reason (e.g. no
available message buffers, link-layer delivery failure, etc.), the
router will not attempt to send the MLE Data Response again to update
the SED's network data.
This commit makes the following changes:
- The router communicates updated network data in an MLE Child Update
Request message, requiring the SED to send an MLE Child Update
Response message with the Leader Data TLV.
- The router repeatedly attempts to transmit new network data to the
SED until it receives a Leader Data TLV with the updated version.
Child IDs are assigned when receiving a Child ID Request. Prior to this
commit, a new Child ID is assigned whenever the child state is not valid.
A router stores state about its attached children in non-volatile memory.
On a reboot, the router attempts to restore its child links. As a result,
it is possible for the child to be assigned a new Child ID while it is
being restored.
With this commit, a router only assigns a new Child ID if there is no
existing Child ID state for the given child.
This commit changes the error type returned from `VALUE_IS` and
`VALUE_REMOVE` spinel commands. If a `VALUE_REMOVE` is issued where the
item being removed is not in the list, instead of passing up `NOT_FOUND`
error, a `LAST_STATUS` with `STATUS_OK` is used. Similarly the behavior
is changed for the `VALUE_INSERT` operation and error status `ALREADY`.
This change helps ensure driver/user considers the operation as a
success while still being able to distinguish (if required) whether
the value was actually removed by checking if we get a `VALUE_REMOVED`
response versus `LAST_STATUS(OK)` response.
This commit ensues that some properties/methods which are defined
under "raw-link-api" feature only are also `#ifdef`ed in the
lookup entry table definitions.
Another change is related to `HandleRawFrame()` method which is
used/needed for packet capture independent of "raw-link-api"
feature.
The same external route or on-mesh prefix can be registered by
different devices with different flags (e.g., different preference
level). This info is stored in network data as part of the
BorderRouterEntry TLV. This commit changes the methods
`GetNextOnMeshPrefix()` and `GetNextExternalRoute()` to ensure that
different entries corresponding to the same prefix are provided
separately when iterating over all entries (i.e., without giving
a specific RLOC16).
To implement this the `otNetworkDataIterator` is changed to track
both the index into the `mTlvs` buffer and the entry index.
This commit also appends an RLOC16 field to the struct packing
format of `SPINEL_PROP_THREAD_ON_MESH_NETS and `OFF_MESH_ROUTES`
spinel properties and updates the implementation and documentation
accordingly.
Updated cc2650 and cc2652 platforms to place ieee ack frame types in the
RX queue and to propagate those frames to the higher level.
Initialize extra RX buffers.
This commit applies the patch directly to checked-in source files rather
than at build time. This commit helps to simplify the build process.
This commit also introduces a shell script that allows anyone to reproduce
the patched mbedtls source.
This commit:
- Enables Thread-related protocols and sets the device role state to Leader
in fuzz tests.
- Bypasses AES-CCM decryption and authentication in fuzz tests.
This commit makes the following changes:
1. Check return value of SetLength() when forming a RLY_TX.ntf message.
2. When accepting data to transmit from mbedtls, only free the message
buffer if the message buffer is empty. Otherwise, attempt to transmit
the message buffer that was already formed.
3. When freeing the transmit message buffer for mbedtls, set the transmit
message buffer pointer to NULL.
This commit adjusts the order for calling radio layer API to make sure otPlatRadioEnable() is the first called to radio layer. This mainly addresses the issue of otInstance which is not provided when initializing radio layer.
In Mac::RadioReceive, Mac::RadioTransmit and Mac::RadioSleep, the
SuccessOrExit macro was being used in a way which skipped printing
an error message upon failure, and printed it for OT_ERROR_NONE.
This commit contains different changes and enhancement to MAC
layer implementation.
It changes how the MAC layer maintains its operations. It is ensured
that only a single operation is active at a time.
An operation can be:
- active or energy scan,
- beacon or data frame transmission,
- waiting for data (after data poll ack with frame pending), or,
- idle operation (where radio is put in either rx or sleep mode).
Method `StartOperation()` starts an operation and `FinishOperation()`
is used to indicate when is is done. If there is an ongoing operation,
a subsequent call to `StartOperation()` ensures that the next
operation is marked as pending and gets started after the current one
is finished.
This commit also changes the `StartCsmaBackoff()` implementation such
that the radio is put in either receive or sleep mode depending on the
state `mRxOnWhenIdle` before starting the backoff timer. This ensures
that on a sleepy device the radio is put to sleep while backing off for
all transmission attempts including any MAC retries.
Another change added in this commit is to allow a received data frame
to be processed during an ongoing active/energy scan only if the
current scan channel matches the receive channel.
This commit also update `Mac::Frame` class by adding a new helper
method `IsDataRequestCommand()` to indicate if the frame is a MAC Data
Request command (data poll).
This commit removes the deprecated API otPlatRadioTransmitDone() to prevent new platforms using this API.
Some platforms still uses the deprecated API. This commit generates ACK frame according to the Frame Pending flag and the sent frame.
This commit does not define an API for generating ACK frame because the frame should not be generated by sender. Platforms not passing the received ACK frame should remove the code generating ACK frame soon.
This commit also fixes the build failures on the gp712 platform.
This commit changes the `InstanceLocator` class to keep track of a
reference to `otInstance` (instead of a pointer) to make it behave
similar to other `ObjectLocator` classes. The method `GetInstance()`
in all locator objects is updated to provide a reference (instead
of a pointer) to `otInstance`.
The logging macros are updated such that a reference to `otInstance`
is passed as the first argument (with the exception of
`otLog<Level>Plat()` macros which are used by platform code in C
domain). The documentation for log macros are also updated.
This commit fixes an issue related to the OpenThread feature
`OPENTHREAD_CONFIG_STAY_AWAKE_BETWEEN_FRAGMENTS` to ensure that
`mDelaySleep` flag is cleared after timer starts so that sleep is
delayed only once.
* Add support for cc2652
Updated CC26XXware to latest release.
Moved CC26XXware to match the SimpleLink cc26x2 SDK directory structure.
Added CC2652 Platform support
This commit changes how the link-local and the realm-local all-thread
multicast addresses are maintained. A change in mesh-local prefix
triggers a re-calculation of multicast addresses. When such a change
happens the old addresses are first removed/unsubscribed from the
interface and then the new ones are subscribed to. This ensures that
`OT_CHANGED_IP6_MULTICAST_(UN)SUBSRCRIBED` flags are set properly and
host/user is informed of the change of the multicast addresses.
This commit adds a new API `otInstanceIsInitialized()` to check if a
given instance is valid, i.e, it has been initialized and not
finalized. We then use this function to verify that passed-in instance
argument in platform callbacks is valid.
Then sniffer devices could provide precise timestamp for each frame.
* The timestamp information is included in the metadata's PHY-specific data field of PROP_STREAM_RAW;
* nRf52840 supports microsecond accuracy timestamp;
* The other platforms support millisecond accuracy timestamp since they don't support microsecond timer for now.
This commit adds new `InFrame` related methods to `NcpFrameBuffer` to
allow user to get/save current write position in an input frame being
written to the buffer. The saved position can later be used to
overwrite the previously added content (using `InFrameOverwrite()`) or
discard a portion of written data and move the write pointer back to
the saved position (using `InFrameReset()`).
The unit test for NCP buffer is also updated to add new test-cases
specific for the newly added methods.
This commit implements a new model for keeping track of unsolicited
property updates and how asynchronous `VALUE_IS` spinel frames are
emitted from NCP. It also implements a mechanism for host to block
updates from certain filterable properties. The behavior can be
controlled through spinel properties `UNSOL_UPDATE_FILTER` and
`UNSOL_UPDATE_LIST` (tied to capability `CAP_UNSOL_UPDATE_FILTER`).
The new model is then used to track dropped IPv6 messages, end of
scan, change in jamming state, and a newly added STATUS_NOMEM report
in case of no NCP buffer space for log messages.
This commit adds a new spinel property (along with its prop handlers)
`SPINEL_PROP_IPV6_MULTICAST_ADDRESS_TABLE` to provide the list of
multicast IPv6 addresses.
It also adds `OT_CHANGED_IP6_MULTICAST_SUBSRCRIBED` and
`OT_CHANGED_IP6_MULTICAST_UNSUBSRCRIBED` to flags used in
`NetifCallback` to indicate changes in multicast address list.
GitHub Issues are for bugs and feature requests. To make bugs and feature requests more easy to find and organize, we close issues that are deemed out of scope for GitHub Issues.
GitHub Issues are for bugs and feature requests. To make bugs and feature requests more easy to find and organize, we close issues that are deemed out of scope for GitHub Issues.
Usage questions? Post questions to [Stack Overflow](http://stackoverflow.com/) using the [[openthread] tag](http://stackoverflow.com/questions/tagged/openthread). We also use Google Groups for discussion and announcements:
* [openthread-announce](https://groups.google.com/forum/#!forum/openthread-announce) - subscribe for release notes and new updates on OpenThread
* [openthread-users](https://groups.google.com/forum/#!forum/openthread-users) - the best place for users to discuss OpenThread and interact with the OpenThread team
* [openthread-devel](https://groups.google.com/forum/#!forum/openthread-devel) - team members discuss the on-going development of OpenThread
The openthread-users Google Group is the recommended place for users to discuss OpenThread and interact directly with the OpenThread community. https://groups.google.com/forum/#!forum/openthread-users
[$BUILD_TARGET != posix-distcheck -a $BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-ncp ]||{
[$BUILD_TARGET != posix-distcheck -a $BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-app-cli -a $BUILD_TARGET != posix-mtd -a $BUILD_TARGET != posix-ncp -a $BUILD_TARGET != posix-app-ncp ]||{
pip install --upgrade pip || die
pip install --user -r $TRAVIS_BUILD_DIR/tests/scripts/thread-cert/requirements.txt || die
[$BUILD_TARGET != posix-ncp ]||{
pip install -r $TRAVIS_BUILD_DIR/tests/scripts/thread-cert/requirements.txt || die
[$BUILD_TARGET != posix-ncp -a $BUILD_TARGET != posix-app-ncp ]||{
# Packages used by ncp tools.
pip install --user git+https://github.com/openthread/pyspinel || die
pip install git+https://github.com/openthread/pyspinel || die
}
}
[$BUILD_TARGET !=pretty-check]||{
wget http://jaist.dl.sourceforge.net/project/astyle/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz || die
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
@@ -70,42 +86,62 @@ cd /tmp || die
arm-none-eabi-gcc --version || die
}
[$BUILD_TARGET != arm-gcc54]||{
[$BUILD_TARGET != arm-gcc-5 ]||{
sudo apt-get install lib32z1 || die
wget https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/5_4-2016q3/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
tar xjf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
exportPATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH|| die
arm-none-eabi-gcc --version || die
}
[$BUILD_TARGET != arm-gcc63]||{
wget https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2017.03-rc2/arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install.tar.gz|| die
tar xzf arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install.tar.gz
exportPATH=/tmp/arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install/bin:$PATH|| die
arc-elf32-gcc --version || die
[$BUILD_TARGET != arm-gcc-6 ]||{
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2|| die
tar xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 || die
exportPATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH|| die
arm-none-eabi-gcc --version || die
}
[$BUILD_TARGET !=posix-32-bit]||{
[$BUILD_TARGET !=arm-gcc-7]||{
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 || die
tar xjf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 || die
exportPATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH|| die
arm-none-eabi-gcc --version || die
}
[$BUILD_TARGET != arm-gcc-8 ]||{
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2018q4/gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2 || die
tar xjf gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2 || die
exportPATH=/tmp/gcc-arm-none-eabi-8-2018-q4-major/bin:$PATH|| die
arm-none-eabi-gcc --version || die
}
[$BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-mtd ]||{
sudo apt-get install g++-multilib || die
}
[$BUILD_TARGET != posix-distcheck ]||{
sudo apt-get install clang|| die
sudo apt-get install llvm-3.4-runtime || die
sudo apt-get install llvm-runtime|| die
}
[$BUILD_TARGET !=posix -o $CC != clang]||{
sudo apt-get install clang || die
}
}
[$TRAVIS_OS_NAME != osx ]||{
sudo easy_install pexpect|| die
[$BUILD_TARGET != cc2538 ]||{
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-mac.tar.bz2|| die
tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-mac.tar.bz2 || die
exportPATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH|| die
make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS|| die
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
# USB transport with bootloader e.g. to support PCA10059 dongle
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
USB=1BOOTLOADER=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS|| die
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
# SPI transport for NCP
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
NCP_SPI=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS|| die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
# Build without transport (no CLI or NCP applications)
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
DISABLE_TRANSPORTS=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS|| die
# Software cryptography
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
DISABLE_BUILTIN_MBEDTLS=0 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS|| die
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
# Software cryptography with threading support
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
DISABLE_BUILTIN_MBEDTLS=0MBEDTLS_THREADING=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS|| die
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
}
build_qpg6095(){
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1SLAAC=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-qpg6095 || die
arm-none-eabi-size output/qpg6095/bin/ot-cli-ftd || die
arm-none-eabi-size output/qpg6095/bin/ot-cli-mtd || die
arm-none-eabi-size output/qpg6095/bin/ot-ncp-ftd || die
arm-none-eabi-size output/qpg6095/bin/ot-ncp-mtd || die
}
build_samr21(){
git checkout -- . || die
git clean -xfd || die
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.45.0.85.zip || die
unzip -qq asf-standalone-archive-3.45.0.85.zip || die
mv xdk-asf-3.45.0 third_party/microchip/asf || die
./bootstrap || die
COMMISSIONER=1JOINER=1SLAAC=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-samr21 || die
arm-none-eabi-size output/samr21/bin/ot-cli-ftd || die
arm-none-eabi-size output/samr21/bin/ot-cli-mtd || die
arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || die
arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
}
[$BUILD_TARGET != arm-gcc-4 ]||{
exportPATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH|| die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc2538 || die
arm-none-eabi-size output/cc2538/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2538/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2538/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2538/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-da15000 || die
arm-none-eabi-size output/da15000/bin/ot-cli-ftd || die
arm-none-eabi-size output/da15000/bin/ot-cli-mtd || die
arm-none-eabi-size output/da15000/bin/ot-ncp-ftd || die
arm-none-eabi-size output/da15000/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-kw41z || die
arm-none-eabi-size output/kw41z/bin/ot-cli-ftd || die
arm-none-eabi-size output/kw41z/bin/ot-cli-mtd || die
arm-none-eabi-size output/kw41z/bin/ot-ncp-ftd || die
arm-none-eabi-size output/kw41z/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-nrf52840 || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
make -f examples/Makefile-cc2650 || die
arm-none-eabi-size output/cc2650/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2650/bin/ot-ncp-mtd || die
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_nrf52811
build_nrf52840
build_qpg6095
build_samr21
}
[$BUILD_TARGET != arm-gcc54]||{
[$BUILD_TARGET != arm-gcc-5 ]||{
exportPATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH|| die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc2538 || die
arm-none-eabi-size output/cc2538/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2538/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2538/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2538/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-da15000 || die
arm-none-eabi-size output/da15000/bin/ot-cli-ftd || die
arm-none-eabi-size output/da15000/bin/ot-cli-mtd || die
arm-none-eabi-size output/da15000/bin/ot-ncp-ftd || die
arm-none-eabi-size output/da15000/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-kw41z || die
arm-none-eabi-size output/kw41z/bin/ot-cli-ftd || die
arm-none-eabi-size output/kw41z/bin/ot-cli-mtd || die
arm-none-eabi-size output/kw41z/bin/ot-ncp-ftd || die
arm-none-eabi-size output/kw41z/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-nrf52840 || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
make -f examples/Makefile-cc2650 || die
arm-none-eabi-size output/cc2650/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2650/bin/ot-ncp-mtd || die
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_nrf52811
build_nrf52840
build_qpg6095
build_samr21
}
[$BUILD_TARGET != arm-gcc63]||{
exportPATH=/tmp/arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install/bin:$PATH|| die
[$BUILD_TARGET != arm-gcc-6 ]||{
exportPATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH|| die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-emsk || die
arc-elf32-size output/emsk/bin/ot-cli-ftd || die
arc-elf32-size output/emsk/bin/ot-cli-mtd || die
arc-elf32-size output/emsk/bin/ot-ncp-ftd || die
arc-elf32-size output/emsk/bin/ot-ncp-mtd || die
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_nrf52811
build_nrf52840
build_qpg6095
build_samr21
}
[$BUILD_TARGET != arm-gcc-7 ]||{
exportPATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH|| die
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_nrf52811
build_nrf52840
build_qpg6095
build_samr21
}
[$BUILD_TARGET != arm-gcc-8 ]||{
exportPATH=/tmp/gcc-arm-none-eabi-8-2018-q4-major/bin:$PATH|| die
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_nrf52811
build_nrf52840
build_qpg6095
build_samr21
}
[$BUILD_TARGET != posix ]||{
sh -c '$CC --version'|| die
sh -c '$CXX --version'|| die
git checkout -- .|| die
git clean -xfd|| die
./bootstrap || die
make -f examples/Makefile-posix || die
CPPFLAGS=-DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_NONE make -f examples/Makefile-posix || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
CPPFLAGS=-DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG make -f examples/Makefile-posix || die
exportCPPFLAGS=" \
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 \
-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 \
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1 \
-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1"
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
CPPFLAGS=-DOPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1 make -f examples/Makefile-posix || die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-ncp \
--enable-ftd \
--enable-mtd \
--with-examples=posix \
--disable-docs \
--disable-tests \
--with-vendor-extension=./src/core/common/extension_example.cpp || die
make -j 8|| die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-cli \
--enable-mtd \
--with-examples=posix \
--disable-docs \
--disable-tests || die
make -j 8|| die
exportCPPFLAGS=" \
-DOPENTHREAD_CONFIG_ANOUNCE_SENDER_ENABLE=1 \
-DOPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1 \
-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1"
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-cli \
--enable-ncp \
--enable-ftd \
--enable-mtd \
--enable-radio-only \
--with-examples=posix || die
make -j 8|| die
}
[$BUILD_TARGET != posix-distcheck ]||{
exportASAN_SYMBOLIZER_PATH=`which llvm-symbolizer-3.4`|| die
exportASAN_SYMBOLIZER_PATH=`which llvm-symbolizer`|| die
exportASAN_OPTIONS=symbolize=1|| die
exportDISTCHECK_CONFIGURE_FLAGS=CPPFLAGS=-DOPENTHREAD_POSIX_VIRTUAL_TIME=1|| die
./bootstrap || die
make -f examples/Makefile-posix distcheck || die
REFERENCE_DEVICE=1 make -f examples/Makefile-posix distcheck || die
}
[$BUILD_TARGET != posix-32-bit ]||{
./bootstrap || die
COVERAGE=1CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make -f examples/Makefile-posix check || die
REFERENCE_DEVICE=1COVERAGE=1CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make -f examples/Makefile-posix check || die
}
[$BUILD_TARGET != posix-app-cli ]||{
./bootstrap || die
# enable code coverage for OpenThread transceiver only
COVERAGE=1VIRTUAL_TIME_UART=1 make -f examples/Makefile-posix || die
# readline supports pipe, editline does not
REFERENCE_DEVICE=1COVERAGE=1READLINE=readline make -f src/posix/Makefile-posix || die
REFERENCE_DEVICE=1COVERAGE=1PYTHONUNBUFFERED=1OT_CLI_PATH="$(pwd)/$(ls output/posix/*/bin/ot-cli) -v"RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-rcp)" make -f src/posix/Makefile-posix check || die
}
[$BUILD_TARGET != posix-app-pty ]||{
./bootstrap
.travis/check-posix-app-pty || die
}
[$BUILD_TARGET != posix-mtd ]||{
./bootstrap || die
REFERENCE_DEVICE=1COVERAGE=1CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 USE_MTD=1 make -f examples/Makefile-posix check || die
}
[$BUILD_TARGET != posix-ncp-spi ]||{
CPPFLAGS="-DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1"
./bootstrap || die
make -f examples/Makefile-posix check configure_OPTIONS="--enable-ncp-app=ftd --with-ncp-bus=spi --with-examples=posix --with-platform-info=POSIX"|| die
make -f examples/Makefile-posix check configure_OPTIONS="--enable-ncp --enable-ftd --with-examples=posix"|| die
}
[$BUILD_TARGET != posix-app-ncp ]||{
./bootstrap || die
REFERENCE_DEVICE=1COVERAGE=1VIRTUAL_TIME_UART=1 make -f examples/Makefile-posix || die
# enable code coverage for OpenThread posix radio
REFERENCE_DEVICE=1COVERAGE=1READLINE=readline make -f src/posix/Makefile-posix || die
REFERENCE_DEVICE=1COVERAGE=1PYTHONUNBUFFERED=1OT_NCP_PATH="$(pwd)/$(ls output/posix/*/bin/ot-ncp)"RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-rcp)"NODE_TYPE=ncp-sim make -f src/posix/Makefile-posix check || die
}
[$BUILD_TARGET != posix-ncp ]||{
./bootstrap || die
COVERAGE=1NODE_TYPE=ncp-sim make -f examples/Makefile-posix check || die
REFERENCE_DEVICE=1COVERAGE=1PYTHONUNBUFFERED=1NODE_TYPE=ncp-sim make -f examples/Makefile-posix check || die
@@ -37,7 +37,7 @@ The OpenThread Project follows the "Fork-and-Pull" model for accepting contribut
Setup your GitHub fork and continuous-integration services:
1. Fork the [OpenThread repository](https://github.com/openthread/openthread) by clicking "Fork" on the web UI.
2. Enable [Travis CI](https://travis-ci.org/) and [AppVeyor](https://ci.appveyor.com/) by logging in the respective services with your GitHub account and enabling your newly created fork. We use Travis CI for Linux-based continuous integration checks and AppVeyor for Windows-based continuous integration checks. All contributions must pass these checks to be accepted.
2. Enable [Travis CI](https://travis-ci.org/) by logging in the respective service with your GitHub account and enabling your newly created fork. We use Travis CI for Linux-based continuous integration checks. All contributions must pass these checks to be accepted.
Setup your local development environment:
@@ -104,7 +104,7 @@ Now, it may be desirable to squash some of your smaller commits down into a smal
```bash
# Rebase all commits on your development branch
git checkout
git checkout
git rebase -i master
```
@@ -112,15 +112,14 @@ This will open up a text editor where you can specify which commits to squash.
#### Coding Conventions and Style
OpenThread uses and enforces the [OpenThread Coding Conventions and Style](STYLE_GUIDE.md) on all code, except for code located in [third_party](third_party).
OpenThread uses and enforces the [OpenThread Coding Conventions and Style](STYLE_GUIDE.md) on all code, except for code located in [third_party](third_party). Use the `make pretty` and `make pretty-check` targets to automatically reformat code and check for code-style compliance, respectively. OpenThread currently requires [clang-format v6.0.0](http://releases.llvm.org/download.html#6.0.0) for `make pretty` and `make pretty-check`.
As part of the cleanup process, you should also run `make pretty-check` to ensure that your code passes the baseline code style checks.
Make sure to include any code format changes in your commits.
@@ -135,8 +134,8 @@ git checkout <branch-name>
git push origin <branch-name>
```
This will trigger the Travis CI and AppVeyor continuous-integration checks. You can view the results in the respective services. Note that the integration checks will report failures on occasion. If a failure occurs, you may try rerunning the test via the Travis and/or AppVeyor web UI.
This will trigger the Travis CI continuous-integration checks. You can view the results in the respective services. Note that the integration checks will report failures on occasion. If a failure occurs, you may try rerunning the test via the Travis web UI.
#### Submit Pull Request
Once you've validated the Travis CI and AppVeyor results, go to the page for your fork on GitHub, select your development branch, and click the pull request button. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes on your development branch and update.
Once you've validated the Travis CI results, go to the page for your fork on GitHub, select your development branch, and click the pull request button. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes on your development branch and update.
**...an open-source implementation of the [Thread](http://threadgroup.org/technology/ourtechnology) networking protocol.** Nest has released OpenThread to make the technology used in Nest products more broadly available to developers to accelerate the development of products for the connected home.
**...an open-source implementation of the [Thread](http://threadgroup.org/technology/ourtechnology) networking protocol.** Google Nest has released OpenThread to make the technology used in Nest products more broadly available to developers to accelerate the development of products for the connected home.
**...OS and platform agnostic**, with a narrow platform abstraction layer and a small memory footprint, making it highly portable.
**...OS and platform agnostic**, with a narrow platform abstraction layer and a small memory footprint, making it highly portable. It supports both system-on-chip (SoC) and network co-processor (NCP) designs.
**...a Thread Certified Component**, implementing all features defined in the [Thread 1.1.1 specification](http://threadgroup.org/technology/ourtechnology#specifications). This specification defines an IPv6-based reliable, secure and low-power wireless device-to-device communication protocol for home applications.
**...a Thread Certified Component**, implementing all features defined in the [Thread 1.1.1 specification](http://threadgroup.org/technology/ourtechnology#specifications), including all Thread networking layers (IPv6, 6LoWPAN, IEEE 802.15.4 with MAC security, Mesh Link Establishment, Mesh Routing) and device roles, as well as [Border Router](https://github.com/openthread/ot-br-posix) support.
More information about Thread can be found on [threadgroup.org](http://threadgroup.org/).
More information about Thread can be found at [threadgroup.org](http://threadgroup.org/). Thread is a registered trademark of the Thread Group, Inc.
Want to try OpenThread? The quickest way to get started is to run through our [Simulation Codelab](https://codelabs.developers.google.com/codelabs/openthread-simulation/index.html), which covers all the basics, without the need for test hardware. Using VirtualBox and Vagrant on a Mac or Linux machine, you will learn:
* How to set up the OpenThread build toolchain
* How to simulate a Thread network
* How to authenticate Thread nodes with Commissioning
* How to use `wpantund` to manage a simulated Thread network featuring an NCP
### Next Steps
The Codelab shows you how easy it is use to OpenThread to simulate a Thread network. Once complete:
1. Learn more about the [OpenThread architecture and features](#openthread-features)
1. Get familiar with [platforms and devices that support OpenThread](#who-supports-openthread)
1. See what [testing tools](#what-tools-are-available-for-testing) are available
1. Learn [where to get help](#need-help) and [how to contribute](#want-to-contribute) to the ongoing development of OpenThread
# OpenThread Features
OpenThread implements all features defined in the [Thread 1.1.1 specification](http://threadgroup.org/technology/ourtechnology#specifications), including all Thread networking layers (IPv6, 6LoWPAN, IEEE 802.15.4 with MAC security, Mesh Link Establishment, Mesh Routing) and device roles, as well as [Border Router](https://github.com/openthread/borderrouter) support.
OpenThread supports both system-on-chip (SoC) and network co-processor (NCP) designs. Other features and enhancements include:
* Thread Border Agent to support an External Commissioner
* NAT64 for connecting to IPv4 networks
* Thread interface driver using `wpantund`
### What's coming?
The development of OpenThread is ongoing to provide additional features not available in the standard. Check back regularly for new updates, or visit the [openthread-announce](https://groups.google.com/forum/#!forum/openthread-announce) Google Group.
OpenThread has been ported to several devices and platforms by both the OpenThread team and the community. Build examples for all supported platforms are included in the OpenThread project.
All end-user documentation and guides are located at [openthread.io](https://openthread.io). If you're looking to do things like...
### IEEE 802.15.4 Platform Support
* Learn more about OpenThread features and enhancements
* Use OpenThread in your products
* Learn how to build and configure a Thread network
...then [openthread.io](https://openthread.io) is the place for you.
See the [Wiki Platform page](https://github.com/openthread/openthread/wiki/Platforms) for more detailed information on supported platforms.
> Note: For users in China, end-user documentation is available at [openthread.google.cn](https://openthread.google.cn).
### Desktop Support
If you're interested in contributing to OpenThread, read on.
Desktop platforms can also be used to control and interface with a Thread network using OpenThread:
# Contributing
* **Unix** — [`wpantund`](https://github.com/openthread/wpantund) provides an interface to an NCP
* **Windows 10** — [universal drivers](https://github.com/openthread/openthread/wiki/OpenThread-on%C2%A0Windows) to interface with devices running OpenThread
We would love for you to contribute to OpenThread and help make it even better than it is today! See our [Contributing Guidelines](https://github.com/openthread/openthread/blob/master/CONTRIBUTING.md) for more information.
### Porting
If you are interested in porting OpenThread to a new platform, see the [Porting Guide](https://github.com/openthread/openthread/wiki/Porting-Guide) for hardware requirements and detailed porting instructions.
### Border Router
A Border Router connects a Thread network to networks at different layers, such as WiFi or Ethernet. [OpenThread Border Router](https://github.com/openthread/borderrouter) provides end-to-end IP via routing between Thread devices and other external IP networks, as well as external Thread Commissioning.
# What tools are available for testing?
### Certification Testing
Certification testing is done with the [GRL Thread Test Harness software](http://graniteriverlabs.com/thread/), available for download to Thread member companies.
Additional tools that extend the Test Harness are included in the OpenThread project:
* [Thread Harness Automation](https://github.com/openthread/openthread/tree/master/tools/harness-automation) — automates the Thread Test Harness software
* [Thread Harness THCI for OpenThread](https://github.com/openthread/openthread/tree/master/tools/harness-thci) — allows the Thread Test Harness to control OpenThread-based reference devices directly
* CC2538 example included in the GRL Thread Test Hardness software
* Library version can be modified by developers for use on other platforms
### Sniffer
OpenThread also provides a [sniffer](https://github.com/openthread/openthread/blob/master/tools/spinel-cli/SNIFFER.md) on the NCP build. The sniffer is exposed by the Spinel protocol and features:
* Monitor mode — capture packets during operation
* Promiscuous mode — dedicated sniffer
* Host-side support — `wpantund`
* pcap stream output
# Need help?
### Wiki
Explore the [OpenThread Wiki](https://github.com/openthread/openthread/wiki) for more in-depth documentation on building, testing, automation and tools.
### Interact
There are numerous avenues for OpenThread support:
* Bugs and feature requests — [submit to the Issue Tracker](https://github.com/openthread/openthread/issues)
* Stack Overflow — [post questions using the `openthread` tag](http://stackoverflow.com/questions/tagged/openthread)
* Google Groups — discussion and announcements
* [openthread-announce](https://groups.google.com/forum/#!forum/openthread-announce) — release notes and new updates on OpenThread
* [openthread-users](https://groups.google.com/forum/#!forum/openthread-users) — the best place for users to discuss OpenThread and interact with the OpenThread team
### Directory Structure
The OpenThread repository is structured as follows:
`etc` | Configuration files for other build systems (e.g. Visual Studio)
`examples` | Sample applications and platforms demonstrating OpenThread
`include` | Public API header files
`src` | Core implementation of the Thread standard and related add-ons
`tests` | Unit and Thread conformance tests
`third_party` | Third-party code used by OpenThread
`tools` | Helpful utilities related to the OpenThread project
# Want to contribute?
We would love for you to contribute to OpenThread and help make it even better than it is today! See the [`CONTRIBUTING.md`](https://github.com/openthread/openthread/blob/master/CONTRIBUTING.md) file for more information.
Contributors are required to abide by our [Code of Conduct](https://github.com/openthread/openthread/blob/master/CODE_OF_CONDUCT.md) and [Coding Conventions and Style Guide](https://github.com/openthread/openthread/blob/master/STYLE_GUIDE.md).
# Versioning
@@ -180,6 +63,16 @@ OpenThread follows the [Semantic Versioning guidelines](http://semver.org/) for
# License
OpenThread is released under the [BSD 3-Clause license](https://github.com/openthread/openthread/blob/master/LICENSE). See the [`LICENSE`](https://github.com/openthread/openthread/blob/master/LICENSE) file for more information.
OpenThread is released under the [BSD 3-Clause license](https://github.com/openthread/openthread/blob/master/LICENSE). See the [`LICENSE`](https://github.com/openthread/openthread/blob/master/LICENSE) file for more information.
Please only use the OpenThread name and marks when accurately referencing this software distribution. Do not use the marks in a way that suggests you are endorsed by or otherwise affiliated with Nest, Google, or The Thread Group.
# Need help?
There are numerous avenues for OpenThread support:
* Bugs and feature requests — [submit to the Issue Tracker](https://github.com/openthread/openthread/issues)
* Stack Overflow — [post questions using the `openthread` tag](http://stackoverflow.com/questions/tagged/openthread)
* Google Groups — [discussion and announcements at openthread-users](https://groups.google.com/forum/#!forum/openthread-users)
The openthread-users Google Group is the recommended place for users to discuss OpenThread and interact directly with the OpenThread team.
- Preprocessor `#include` directives shall use brace (“<”) and (“>”) style for all public headers, including C and C++ standard library, or other first- and third-party public library headers.
- Preprocessor `#include` directives should use double quote (‘“‘) and (‘“‘) style for all private or relative headers.
- Preprocessor `#include` directives should be grouped, ordered, or sorted as follows:
-This compilation unit's corresponding header, if any.
-If the unit is a core/private header file, `"openthread-core-config.h"` should be the first header file included.
- If the unit is a core/private `.c` or `.cpp` file:
- If the unit has a corresponding header file, the unit's corresponding header file should be included before any other header file.
- If the unit has no corresponding header file, then it should directly include `"openthread-core-config.h"` before any other header file.
- C++ Standard Library headers
- C Standard Library headers
- Third-party library headers
@@ -72,6 +75,8 @@
- The symbol used for the guard should be the file name, converted to all uppercase, with any spaces (“ “) or dots (“.”) converted to underscores (“_”).
- Function and Method Prototypes
- All void functions or methods shall explicitly declare and specify the void type keyword.
- Unused parameters
- All unused parameters shall be declared as such using the `OT_UNUSED_VARIABLE` macro at the top of a function or method before all local variable declarations.
### C
@@ -111,6 +116,8 @@
- OpenThread uses the `make pretty` build target to reformat code and enforce code format and style. The `make pretty-check` build target is included in OpenThread's continuous integration and must pass before a pull request is merged.
- The `make pretty` and `make pretty-check` build targets require [clang-format v6.0.0](http://releases.llvm.org/download.html#6.0.0).
### File Names
- File names should match the names and types of what is described in the file. If a file contains many declarations and definitions, the author should choose the one that predominantly describes or that makes the most sense.
- File contents and names should be limited in the scope of what they contain. It may also be possible that there is too much stuff in one file and you need to break it up into multiple files.
@@ -122,8 +129,7 @@
- Names shall not give any idea of type, such as is done with System Hungarian notation.
- Case
- C preprocessor symbols should be all uppercase.
- All OpenThread names in the C language shall be in *snake case*.
- All OpenThread class, namespace, structure, method, function, enumeration, and type names in the C++ language shall be in *upper camel case*. Exception: the top level OpenThread namespace 'ot'.
- All OpenThread class, namespace, structure, method, function, enumeration, and type names in the C/C++ language shall be in *upper camel case*. Exception: the top level OpenThread namespace 'ot'.
- All OpenThread instantiated names of instances of classes, namespaces, structures, methods, functions, enumerations, and types as well as method and function parameters in the C++ language shall be in *lower camel case*.
- Symbol Qualification
- All OpenThread C public data types and free functions should have `ot` prepended to their name.
@@ -171,7 +177,7 @@
## Standards
- OpenThread uses and enfores both Python 2 and Python 3. Support for Python 2 is a result of the fact that some current Linux distributions and Macs are still using 2.x as default.
title = "Spinel: A protocol basis for control and management of IPv6 network interface co-processors"
abbrev = "Spinel Basis"
category = "std"
docName = "draft-rquattle-spinel-basis"
ipr = "trust200902"
keyword = ["Spinel", "IPv6", "NCP"]
date = @SOURCE_DATE@
[pi]
editing = "yes"
compact = "yes"
subcompact = "yes"
comments = "yes"
[[author]]
initials = "R."
surname = "Quattlebaum"
fullname = "Robert S. Quattlebaum"
organization = "Nest Labs, Inc."
[author.address]
email = "rquattle@nestlabs.com"
[author.address.postal]
street = "3400 Hillview Ave."
city = "Palo Alto"
region = "California"
code = "94304"
country = "USA"
[[author]]
initials = "j.h."
surname = "woodyatt"
fullname = "james woodyatt"
organization = "Nest Labs, Inc."
role = "editor"
[author.address]
email = "jhw@nestlabs.com"
[author.address.postal]
street = "3400 Hillview Ave."
city = "Palo Alto"
region = "California"
code = "94304"
country = "USA"
%%%
.# Abstract
This document specifies the basis of the Spinel protocol, which facilitates the control and management of IPv6 network interfaces on devices where general purpose application processors offload network functions at their interfaces to network co-processors (NCP) connected by simple communication links like serial data channels. Spinel was initially designed for use with Thread network co-processors, but its basis is general purpose and intended to be easily adapted to other types of IPv6 network interface.
{mainmatter}
# Introduction #
Spinel is a host-controller protocol designed to enable interoperation over simple serial connections between general purpose device operating systems (OS) and network co-processors (NCP) for the purpose of controlling and managing their IPv6 network interfaces, achieving the following goals:
* Adopt a layered approach to the protocol design, allowing future support for other types of IPv6 link.
* Minimize the number of required commands/methods by supporting a rich, property-based programming interface.
* Support NCPs capable of multiple simultaneous IPv6 interfaces.
* Support NCPs capable of communicating simultaneously on more than one physical link.
* Gracefully handle the addition of new features and capabilities without necessarily breaking backward compatibility.
* Be as minimal and light-weight as possible without unnecessarily sacrificing flexibility.
On top of this core framework, properties and commands enable various common features of IPv6. In related and forthcoming documents, the Spinel protocol is extended to support NCP implementations for specific IPv6 link types, e.g. Thread.
{{spinel-frame-format.md}}
{{spinel-data-packing.md}}
{{spinel-commands.md}}
{{spinel-prop.md}}
{{spinel-status-codes.md}}
{{spinel-tech-thread.md}}
{{spinel-feature-network-save.md}}
{{spinel-feature-host-buffer-offload.md}}
{{spinel-feature-jam-detect.md}}
{{spinel-feature-gpio.md}}
{{spinel-feature-trng.md}}
{{spinel-security-considerations.md}}
{backmatter}
{{spinel-framing.md}}
{{spinel-test-vectors.md}}
{{spinel-example-sessions.md}}
{{spinel-basis-glossary.md}}
# Acknowledgments #
Thread is a registered trademark of The Thread Group, Inc.
Special thanks to Nick Banks, Jonathan Hui, Abtin Keshavarzian, Piotr Szkotak, Arjuna Sivasithambaresan and Martin Turon for their substantial contributions and feedback related to this document.
This document was prepared using [mmark](https://github.com/miekg/mmark) by (Miek Gieben) and [xml2rfc (version 2)](http://xml2rfc.ietf.org/).
This document describes the Spinel protocol, which facilitates the control and
management of IPv6 network interfaces on devices where general purpose
application processors offload network functions at their interfaces to network
co-processors (NCP) connected by simple communication links like serial data
channels. While initially developed to support Thread(R), Spinel's layered
design allows it to be easily adapted to other similar network technologies.
This document also describes various Spinel specializations, including support
for the Thread(R) low-power mesh network technology.
{mainmatter}
# Introduction #
Spinel is a host-controller protocol designed to enable interoperation over simple serial connections between general purpose device operating systems (OS) and network co-processors (NCP) for the purpose of controlling and managing their IPv6 network interfaces, achieving the following goals:
* Adopt a layered approach to the protocol design, allowing future
support for other network protocols.
* Minimize the number of required commands/methods by providing a
rich, property-based API.
* Support NCPs capable of being connected to more than one network
at a time.
* Gracefully handle the addition of new features and capabilities
without necessarily breaking backward compatibility.
* Be as minimal and light-weight as possible without unnecessarily
sacrificing flexibility.
On top of this core framework, we define the properties and commands
to enable various features and network protocols.
## About this Draft ##
This document is currently in a draft status and is changing often.
This section discusses some ideas for changes to the protocol that
haven't yet been fully specified, as well as some of the impetus for
the current design.
### Scope ###
The eventual intent is to have two documents: A Spinel basis document
which discusses the network-technology-agnostic mechanisms and a
Thread(R) specialization document which describes all of the Thread(R)-specific
implementation details. Currently, this document covers both.
### Renumbering ###
Efforts are currently maintained to try to prevent overtly
backward-incompatible changes to the existing protocol, but if you are
implementing Spinel in your own products you should expect there to be
at least one large renumbering event and major version number change
before the standard is considered "baked". All changes will be clearly
marked and documented to make such a transition as easy as possible.
To allow conclusive detection of protocol (in)compatibility between
the host and the NCP, the following commands and properties are
already considered to be "baked" and will not change:
* Command IDs zero through eight. (Reset, No-op, and Property-Value
Commands)
* Property IDs zero through two. (Last status, Protocol Version, and
NCP Version)
Renumbering would be undertaken in order to better organize the
allocation of property IDs and capability IDs. One of the initial
goals of this protocol was for it to be possible for a host or NCP to
only implement properties with values less than 127 and for the NCP to
still be usable---relegating all larger property values for extra
features or other capabilities that aren't strictly necessary. This
would allow simple implementations to avoid the need to implement
support for PUIs ((#packed-unsigned-integer)).
As time has gone by and the protocol has become more fleshed out, it
has become clear that some of the initial allocations were inadequate
and should be revisited if we want to try to achieve the original
goal.
{{spinel-frame-format.md}}
{{spinel-data-packing.md}}
{{spinel-commands.md}}
{{spinel-prop.md}}
{{spinel-status-codes.md}}
{{spinel-tech-thread.md}}
{{spinel-feature-network-save.md}}
{{spinel-feature-host-buffer-offload.md}}
{{spinel-feature-jam-detect.md}}
{{spinel-feature-gpio.md}}
{{spinel-feature-trng.md}}
{{spinel-security-considerations.md}}
{backmatter}
{{spinel-framing.md}}
{{spinel-test-vectors.md}}
{{spinel-example-sessions.md}}
{{spinel-basis-glossary.md}}
# Acknowledgments #
Thread is a registered trademark of The Thread Group, Inc.
Special thanks to Nick Banks, Jonathan Hui, Abtin Keshavarzian, Yakun Xu,
Piotr Szkotak, Arjuna Sivasithambaresan and Martin Turon for their
substantial contributions and feedback related to this document.
This document was prepared using [mmark](https://github.com/miekg/mmark)
by (Miek Gieben) and [xml2rfc (version 2)](http://xml2rfc.ietf.org/).
: Final Checksum. Bytes added to the end of a packet to help determine if the packet was received without corruption.
NCP
: Network Control Processor.
NLI
: Network Link Identifier. May be a value between zero and three. See (#nli-network-link-identifier) for more information.
OS
: Operating System, i.e. the IPv6 node using Spinel to control and manage one or more of its IPv6 network interfaces.
PHY
: Physical layer. Refers to characteristics and parameters related to the physical implementation and operation of a networking medium.
PUI
: Packed Unsigned Integer. A way to serialize an unsigned integer using one, two, or three bytes. Used throughout the Spinel protocol. See (#packed-unsigned-integer) for more information.
TID
: Transaction Identifier. May be a value between zero and fifteen. See (#tid-transaction-identifier) for more information.
* A command (up to three bytes, see (#packed-unsigned-integer) for format)
* An optional command payload
Octets: | 1 | 1-3 | *n*
--------|--------|-----|-------------
Fields: | HEADER | CMD | CMD_PAYLOAD
## Header Format ###
The header byte is broken down as follows:
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
| FLG | NLI | TID |
+---+---+---+---+---+---+---+---+
<!-- RQ -- Eventually, when https://github.com/miekg/mmark/issues/95
is addressed, the above table should be swapped out with this:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| FLG || NLI || TID ||||
-->
### FLG: Flag
The flag field of the header byte (`FLG`) is always set to the value
two (or `10` in binary). Any frame received with these bits set to
any other value else MUST NOT be considered a Spinel frame.
This convention allows Spinel to be line compatible with BTLE HCI. By
defining the first two bit in this way we can disambiguate between
Spinel frames and HCI frames (which always start with either `0x01`
or `0x04`) without any additional framing overhead.
### NLI: Network Link Identifier
The Network Link Identifier (NLI) is a number between 0 and 3, which is associated by the OS with one of up to four IPv6 zone indices corresponding to conceptual IPv6 interfaces on the NCP. This allows the protocol to support IPv6 nodes connecting simultaneously to more than one IPv6 network link using a single NCP instance. The first Network Link Identifier (0) MUST refer to a distinguished conceptual interface provided by the NCP for its IPv6 link type. The other three Network Link Identifiers (1, 2 and 3) MAY be dissociated from any conceptual interface.
### TID: Transaction Identifier
The least significant bits of the header represent the Transaction
Identifier(TID). The TID is used for correlating responses to the
commands which generated them.
When a command is sent from the host, any reply to that command sent
by the NCP will use the same value for the TID. When the host receives
a frame that matches the TID of the command it sent, it can easily
recognize that frame as the actual response to that command.
The TID value of zero (0) is used for commands to which a correlated
response is not expected or needed, such as for unsolicited update
commands sent to the host from the NCP.
### Command Identifier (CMD) ####
The command identifier is a 21-bit unsigned integer encoded in up to
three bytes using the packed unsigned integer format described in
(#packed-unsigned-integer). This encoding allows for up to 2,097,152 individual
commands, with the first 127 commands represented as a single byte.
Command identifiers larger than 2,097,151 are explicitly forbidden.
CID Range | Description
----------------------|------------------
0 - 63 | Reserved for core commands
64 - 15,359 | *UNALLOCATED*
15,360 - 16,383 | Vendor-specific
16,384 - 1,999,999 | *UNALLOCATED*
2,000,000 - 2,097,151 | Experimental use only
### Command Payload (Optional) ####
Depending on the semantics of the command in question, a payload MAY
be included in the frame. The exact composition and length of the
* 8: `CAP_WRITABLE_RAW_STREAM`: `PROP_STREAM_RAW` is writable.
* 9: `CAP_GPIO`: Support for GPIO access. See (#feature-gpio-access).
* 10: `CAP_TRNG`: Support for true random number generation. See (#feature-trng).
* 11: `CAP_CMD_MULTI`: Support for `CMD_PROP_VALUE_MULTI_GET` ((#cmd-prop-value-multi-get)), `CMD_PROP_VALUE_MULTI_SET` ((#cmd-prop-value-multi-set), and `CMD_PROP_VALUES_ARE` ((#cmd-prop-values-are)).
* 12: `CAP_UNSOL_UPDATE_FILTER`: Support for `PROP_UNSOL_UPDATE_FILTER` ((#prop-unsol-update-filter)) and `PROP_UNSOL_UPDATE_LIST` ((#prop-unsol-update-list)).
* 16: `CAP_802_15_4_2003`
* 17: `CAP_802_15_4_2006`
* 18: `CAP_802_15_4_2011`
* 21: `CAP_802_15_4_PIB`
* 24: `CAP_802_15_4_2450MHZ_OQPSK`
* 25: `CAP_802_15_4_915MHZ_OQPSK`
* 26: `CAP_802_15_4_868MHZ_OQPSK`
* 27: `CAP_802_15_4_915MHZ_BPSK`
* 28: `CAP_802_15_4_868MHZ_BPSK`
* 29: `CAP_802_15_4_915MHZ_ASK`
* 30: `CAP_802_15_4_868MHZ_ASK`
* 48: `CAP_ROLE_ROUTER`
* 49: `CAP_ROLE_SLEEPY`
* 52: `CAP_NET_THREAD_1_0`
* 512: `CAP_MAC_WHITELIST`
* 513: `CAP_MAC_RAW`
* 514: `CAP_OOB_STEERING_DATA`
* 1024: `CAP_THREAD_COMMISSIONER`
* 1025: `CAP_THREAD_TMF_PROXY`
Additionally, future capability allocations SHALL be made from the
Spinel is largely a property-based protocol, similar to representational state transfer (REST), with a property defined for every attribute that an OS needs to create, read, update or delete in the function of an IPv6 interface. The inspiration of this approach was memory-mapped hardware registers for peripherals. The goal is to avoid, as much as possible, the use of large complicated structures and/or method argument lists. The reason for avoiding these is because they have a tendency to change, especially early in development. Adding or removing a property from a structure can render the entire protocol incompatible. By using properties, you simply extend the protocol with an additional property.
Almost all features and capabilities are implemented using properties. Most new features that are initially proposed as commands can be adapted to be property-based instead. Notable exceptions include "Host Buffer Offload" ((#feature-host-buffer-offload)) and "Network Save" ((#feature-network-save)).
In Spinel, properties are keyed by an unsigned integer between 0 and 2,097,151 (See (#packed-unsigned-integer)).
## Property Methods ###
Properties may support one or more of the following methods:
*`VALUE_GET` ((#cmd-prop-value-get))
*`VALUE_SET` ((#cmd-prop-value-set))
*`VALUE_INSERT` ((#cmd-prop-value-insert))
*`VALUE_REMOVE` ((#cmd-prop-value-remove))
Additionally, the NCP can send updates to the host (either synchronously or asynchronously) that inform the host about changes to specific properties:
*`VALUE_IS` ((#cmd-prop-value-is))
*`VALUE_INSERTED` ((#cmd-prop-value-inserted))
*`VALUE_REMOVED` ((#cmd-prop-value-removed))
## Property Types ###
Conceptually, there are three different types of properties:
* Single-value properties
* Multiple-value (Array) properties
* Stream properties
### Single-Value Properties ####
Single-value properties are properties that have a simple representation of a single value. Examples would be:
* Current radio channel (Represented as an unsigned 8-bit integer)
* Network name (Represented as a UTF-8 encoded string)
* 802\.15.4 PAN ID (Represented as an unsigned 16-bit integer)
The valid operations on these sorts of properties are `GET` and `SET`.
### Multiple-Value Properties ####
Multiple-Value Properties have more than one value associated with them. Examples would be:
* List of channels supported by the radio hardware.
* List of IPv6 addresses assigned to the interface.
* List of capabilities supported by the NCP.
The valid operations on these sorts of properties are `VALUE_GET`, `VALUE_SET`, `VALUE_INSERT`, and `VALUE_REMOVE`.
When the value is fetched using `VALUE_GET`, the returned value is the concatenation of all of the individual values in the list. If the length of the value for an individual item in the list is not defined by the type then each item returned in the list is prepended with a length (See (#arrays)). The order of the returned items, unless explicitly defined for that specific property, is undefined.
`VALUE_SET` provides a way to completely replace all previous values. Calling `VALUE_SET` with an empty value effectively instructs the NCP to clear the value of that property.
`VALUE_INSERT` and `VALUE_REMOVE` provide mechanisms for the insertion or removal of individual items *by value*. The payload for these commands is a plain single value.
### Stream Properties ####
Stream properties are special properties representing streams of data. Examples would be:
* Network packet stream ((#prop-stream-net))
* Raw packet stream ((#prop-stream-raw))
* Debug message stream ((#prop-stream-debug))
* Network Beacon stream ((#prop-mac-scan-beacon))
All such properties emit changes asynchronously using the `VALUE_IS` command, sent from the NCP to the host. For example, as IPv6 traffic is received by the NCP, the IPv6 packets are sent to the host by way of asynchronous `VALUE_IS` notifications.
Some of these properties also support the host send data back to the NCP. For example, this is how the host sends IPv6 traffic to the NCP.
These types of properties generally do not support `VALUE_GET`, as it is meaningless.
For a device that has a Thread radio attached to port `/dev/ttyUSB0`, start `wpantund` as follows:
```
docker run --rm --detach -e "OPENTHREAD_DEVICE_PORT=/dev/ttyUSB0" --cap-add=NET_ADMIN --device=/dev/ttyUSB0 --name=wpantund openthread/wpantund
```
Once `wpantund` is running, one can control the Thread interface with `wpanctl` as follows:
```
docker exec -it wpantund wpanctl
```
## Content
arm32v7_ubuntu_wpantund
-`wpantund` running on ARMv7 (e.g. Raspberry Pi)
x86_ubuntu_wpantund
-`wpantund` running on x86
ot_sim
- OpenThread POSIX simulator
codelab_otsim
- For use with the [Docker Simulation Codelab](https://codelabs.developers.google.com/codelabs/openthread-simulation/), contains the OpenThread POSIX example and `wpantund` pre-built and ready to use.
environment
- Development environment with the GNU toolchain and all required OpenThread dependencies installed. OpenThread is not built in this image.
Images built from these Dockerfiles are available to pull from [Docker Hub](https://hub.docker.com/u/openthread/). See [Docker Support on openthread.io](https://openthread.io/guides#docker_support) for more information.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.