This commit implements delay-aware queue management. When enabled the
device will monitor time-in-queue of messages in the direct tx queue
and if it is lager than specified thresholds it updates ECN flag
(if message indicates it is ECN-capable) and/or drop the message. This
mechanism is applied to IPv6 messages on the first device that sends
the message into Thread mesh and also on intermediate routers that are
forwarding the message (e.g., as a "mesh lowpan fragment" frame). On an
intermediate router when forwarding the fragments of a message, if any
fragment is dropped by the queue management policy, all subsequent
fragments will also be dropped.
In particular, this commit contains the following:
- Adds `DecompressEcn()` and `MarkCompressedEcn()` in `Lowpan` class
to decompress or update the ECN field in a compressed IPHC header
(unit test `test_lowpan` is also updated to test the new methods).
- Adds `UpdateEcnOrDrop()` which implements the main queue management
logic. This method is used when preparing next direct tx message. It
decides whether to keep the message as is, update ECN on it or drop
it.
- Updates `EvictMessage()` to first apply the queue management rule
to see if any message can be dropped before using the eviction
logic based on message priority.
- Updates and reuses the `FragmentPriorityList` to track whether
queue management dropped any of the fragments of same message so
to also drop any subsequent ones.
- Updates `LogMessage()` to log when a message is dropped by
queue-management or when ECN is marked on a message.
This commit updates the MLE attach process so that in the first attach
cycle device tries a total of six MLE Parent Requests, the first two
to routers only followed by four to routers and REEDs. For example,
the six Parent Request message will be used before device can decide
to act the leader. An MTD in the next attach attempt (if cannot find a
parent in first attempt cycle), will go to the model of two Parent
Requests (first to routers, then to routers/REEDs).
This change impacts the time it takes for a device to start as leader
(due to increased number of Parent Request and wait time). This commit
updates different test scripts to address the change in the wait
time. It adds a new `config.LEADER_STARTUP_DELAY` constants which is
used for wait time for leader to start.
This commit contain smaller enhancements related to managing the
local OMR prefix:
- It adds a new class to encapsulate all the related data and
methods.
- We directly track whether or not the prefix is added to the local
Network Data (using a boolean)
- The methods are renamed to use the terms "add/remove" instead of
"publish/unpublish" since the Network data publisher is not used
for OMR prefix and it is directly added or removed.
This commit adds `Ip6::Headers` class which represents IPv6 header
along with related transport layer header (UDP, TCP or ICMP6). It
provides helper methods to parse all headers from an IPv6 message or
decompress and read them from a lowpan frame.
This helps simplify the code and allows us to remove multiple similar
methods in `MeshForwarder` performing decompression/parsing.
This commit adds a call to `Get<Mac::Mac>().UpdateCsl()` when there
is role change from `SetStateLeader()` or `SetStateRouter()`. This
ensures to disable CSL at `SubMac` and radio platform.
When the RCP is not stable, it causes the Thread stack to crash. To
better know the stability of the RCP, this commit adds an API to
return the radio spinel metrics.
After enabling the scheduling of delayed reception slots in #7677
they would be configured even when the device switched to MED mode.
This commit introduces some simplifications around the CSL states
and scheduling:
- Maintain the CSL timer stopped if not in CSL Receiver mode.
- Keep the CSL Period and Channel values in the MAC in order to use
them as an indication of CSL Receiver mode in the Sub-Mac.
- Simplify CSL states with `mIsCslSampling` variable.
- Use a simplified interaction between MAC and SubMac:
- `SubMac::UpdateCsl` for CSL config or stopping CSL sampling.
- `SubMac::CslSample` for start/maintain CSL sampling.
This commit adds a helper method `ParsePreference()` to parse a given
CLI argument string as a route preference comparing it against "high",
"med", or "low". This commit also moves the `PreferenceToString()`
method from `Cli::NetworkData` to `Cli::Interpreter` class.
This commit adds new mechanism in `RoutingManager` to allow user to
get or set the preference level to use when advertising Rout Info
Options (e.g., for discovered OMR prefixes) in RA messages sent on
infra netif. By default 'medium' preference is used. As an example,
user can choose to set the preference to 'low' when the device is
acting as a temporary BR (a mobile or battery-powered BR) to indicate
that other BRs should be preferred over this BR on the infra link.
This commit also adds CLI sub-commands for newly added APIs and
updates the documentation.
This commit updates how `RoutingManager` learns the RA header from
host daemons. It adds a new method to determine whether a received RA
message is prepared by the `RoutingManager` itself by checking the
options (PIO and RIO) from the RA message. When learning/updating the
host RA header, we check and skip over such self-prepared RA
messages.
This commit adds a new mechanism related to Network Data recovery on
leader after restart. We determine whether device is starting normally
as leader or restoring its role as leader after restart. In the
latter case, we do not allow the device to accept any new Network Data
registrations until it has successfully recovered the Network Data
(received MLE Data Response).
This change help address situation where Network Data entries
registered with leader before it syncs and restores the Network Data
can be removed and then take a while to be re-registered.
This commit updates `RoutingManager` to discover and publish default
route entries. It updates `DiscoveredPrefixTable` to track which
routers provide default route when processing the received RA
messages. A router can indicate that it provides default route in the
RA message header and it can also include an RIO for "::/0". When
processing the RA message, the preference and lifetime values in a
"::/0" RIO override the preference and lifetime values in the RA
header.
While `DiscoveredPrefixTable` will always track default routes, only
if we see an OMR prefix with default route flag in the Network Data,
we allow it to publish the discovered default route (as "::/0"
external route) in the Network Data. Finding such an OMR prefix
indicates that this prefix is routable beyond the infra link and
therefore default routes can be published and used within Thread
mesh.
Adding support for 1.3 style border router configurations which are
different from the 1.2 style border router configurations. The
'device capabilities' is used to differentiate between these 2 device
types to assign them their needed configuration parameters.
Also moving restartAgentService to the proper class.
This commit updates the data model used by `DiscoveredPrefixTable` in
`RoutingManager` to track the router which added each prefix entry.
This change ensures correct behavior when multiple routers on the
infra link advertise the same set of prefixes. The routers can
potentially advertise the same prefixes (in RIOs) with different
preference levels and/or stop/start advertising the prefixes
independently of each other. We publish the prefixes in Network Data
with highest seen preference. The published entries in Network Data
are also updated as the table entries changes.
This commit implements new mechanism in `Mle` related to key sequence
update when an MLE message is received with a larger key sequence
compared to the one being used by `KeyManager`. The MLE messages are
categorized into classes of Authoritative, or Peer depending on the
MLE command type and included TLVs. The class determines different
actions: Authoritative indicates sender is confident that its key seq
is in sync, so receiver will adopt the larger key seq. Peer class is
used when both sender and receiver think they are in sync. In this
case, if the MLE message is from a known neighbor, receiver will
adopt the larger key seq if the difference is one, otherwise it will
try to re-establish link with the neighbor using Authoritative
message exchanges (e.g. sending Link Request or Child Update
Request).
This commit moves the definitions of constants related to min/max
number of IPv6 addresses that can be included in an IP6 Addresses TLV
to `Ip6AddressesTlv` class. It also adds a public OT constant in
`ip6.h` related to this for MLR feature which is then used in `cli`
and `ncp` modules so to avoid the use of OT core internal constant
from CLI/NCP.
This commit updates `check-simulation-build-autotools` to use the
`LOG_OUTPUT` switch directly. This addresses an issue where
we could end up with multiple `OPENTHREAD_CONFIG_LOG_OUTPUT`
definitions in the `CPPFLAGS`.
This commit adds a new method in `Array` to remove all elements
in the array matching a given indicator.
This commit also updates `test_array.cpp` unit test to validate
the behavior of the newly added method.
This commit updates `NetworkData::Publisher` so that a call to
`PublishOnMeshPrefix()` or `PublishExternalRoute()` replaces a
previous request for the same prefix. In particular, if the new call
only changes the flags (e.g., preference level) and the prefix is
already added in the Network Data, the change to flags is immediately
reflected in the Network Data. This ensures that existing entries in
the Network Data are not abruptly removed. Note that a change in the
preference level can potentially later cause the entry to be removed
from the Network Data after determining there are other nodes that
are publishing the same prefix with the same or higher preference.
This commit also updates `test_netdata_publisher.py` to test the newly
added behavior.
This commit adds a new mechanism to allow border routers to request
router role upgrade.
A border router which provides IP connectivity (either adding an
external route prefix or an on-mesh prefix with default route flag)
and is acting as a REED is eligible to request a router role upgrade
by sending an "Address Solicit" request to leader with status reason
`BorderRouterRequest`. This reason is used when the number of active
routers in the Thread mesh is above the threshold, and only if the
number of existing eligible BRs (determined from the network data)
that are acting as router is less than two. This mechanism allows up
to two eligible border routers to request router role upgrade when
the number of routers is already above the threshold.
This commit also adds a new test-case `test_br_upgrade_router_role`
which validates the behavior of the new mechanism.
This commit introduces `DiscoveredPrefixTable` class as a nested type
in `RoutingManager`. This class maintains the on-link and route
prefixes which are discovered by processing the received Router
Advertisement messages. It manages the lifetime of the discovered
prefixes (running a timer and removing entries when they expire). It
also handles publishing and unpublishing the prefixes in the Thread
Network Data as they are added and removed.
When there is any change in the table (an entry is added, removed,
or modified), it signals this through a callback to `RoutingManager`
which can then take action and decide whether or not to re-evaluate
the routing policy. A `Tasklet` is used for signalling which ensures
that if there are multiple changes within the same flow of execution,
the callback is invoked after all the changes are processed.
The change in this commit simplifies the overall `RoutingManager`
code by abstracting away the prefix table management into its own
class and allows us to hide the internal data model used for storing
the discovered prefixes.
This commit simplifies `NetworkData::Publisher` to rely and use the
new `HandleServerDataUpdated()` behavior which uses a `Tasklet` to
start the registration with leader. With this, we can directly call
`HandleServerDataUpdated()` whenever there is a change and even
multiple times during processing from `Publisher` while ensuring that
all changes are still registered together.
This commit adds a `Taskelt` in `NetworkData::Notifier` to perform
`SynchronizeServerData()` and post this tasklet when there is a
change and `HandleServerDataUpdated()` is called. This ensures that
if there are multiple changes triggered within the same flow of
execution, they are all synchronized together and included in the
same message to register with leader.
This commit updates `Ip6::Prefix` comparison (overload of `<`
operator). If the two prefixes have same length N, then the bytes are
compared directly (as two big-endian N-bit numbers). If the two
prefix have different lengths, the shorter prefix is padded by `0`
bit up to the longer prefix length N before the bytes are compared
(as big-endian N-bit numbers). If all bytes are equal, the prefix
with shorter length is considered smaller.
This commit also updates `test_ip_address` unit test to validate
the new comparison behavior.
This commit adds `Remove/RemoveMatching()` in `Array` class which
remove a given or a matched element from the array. To remove the
element, it is replaced by the last element from array, so the order
of items in the array can change after call to these method.
This commit also updated unit test `test_array` to verify the behavior
of newly added methods.
This commit updates the calculation of the next stale time in
`ResetDiscoveredPrefixStaleTimer()` in (unlikely) cases where the
stale time of a discovered prefix or RA header happens to be in past
(compared to `GetNow()`). In such a case, we use `now` as the stale
time of the entry. This then ensures that the we can correctly
compare the stale time with `now.GetDistantFuture()`.
This commit is a cosmetic change and contains no change in the code
logic. It is a follow-up from #7689 which added `Mle::Tx/RxMessage`
types. This commit moves all `TxMessage` and `RxMessage` method
definitions close to one another (at the end of `mle.cpp`).
This commit adds a new class `RouterAdvertMessage` representing an RA
message. It provides methods to append options (PIO or RIO) to the RA
message or parse and iterate over the options in the RA message
(using newly added `Option::Iterator` which allows use of range-based
`for` loop). These method are used by `RoutingManager` and help
simplify the code.
A BR with `BORDER_ROUTING` feature may add OMR prefix and external
routes to the network data when Thread is started. The network data
changes may incur additional Thread communications that may interfere
with certification traffic.
This commit enhances THCI to wait for the network data to stabilize
after the BR is started.
This commit uses `Ip6::Nd` namespace for IPv6 Neighbor Discovery
definitions (used for border router). It also renames and moves
the source files to `net/nd6.*`.
This commit updates `Srp::Server` to treat the update instructions in
a received SRP message for a service and all its sub-types as atomic.
It adds a new method `ValidateServiceSubTypes()` which performs two
checks. First, it verifies that there is a matching base service for
all sub-type services in a received SRP Update message. Second, it
treats the sub-types in the message as atomic, i.e., whatever
information appears in the message is considered the entirety of
information about the service and its sub-types. In particular, any
previously registered service sub-type that does not appear in a new
SRP Update is removed (marked as deleted).
This commit updates `test_srp_sub_type.py` test-case to validate the
behavior of newly added mechanism (i.e. removal of older sub-types
when not present in the new SRP update message).
This commit adds a new mechanism in `Srp::Client`: When preparing an
update message, client will check whether the prepared message fits
in an IPv6 MTU (1280 bytes). If it does not, the SRP client would
temporarily enable "single service mode" which ensures only a single
service (along with its sub-types) to be appended in the SRP update
message. After the message is sent SRP client would switch back to
normal behavior and disables the single service mode.
This change addresses situation where user may register many services
(with multiple sub-types and long TXT data) which then may not fit
in a single UDP message payload.
This commit also adds `test_srp_many_services_mtu_check` test which
verifies the newly added behavior.
Time delay between MLE Advertisements after reset can be up to 3.5
seconds. For example:
- 0.0s: Reset Interval, reset interval to 1 seconds, random interval
at 0.5 second
- 0.5s: Transmit MLE Advertisement
- 1.0s: Set interval to 2 seconds, random interval at 2 seconds
- 3.0s: Receive MLE Advertisement, reset interval to 1 second, random
interval at 1.0 second
- 4.0s: Transmit MLE Advertisement
MLE Orphan Announce messages include a timestamp value that has both
seconds and ticks set to zero, but authoritative bit set. However, the
default Active Timestamp value is all zeros. As a result, an MLE
Orphan Announce timestamp can appear to be greater than the default
Active Timestamp value and cause a device to detach.
This commit adds a special case to check for the Orphan Announce
timestamp.
The `otOperationalDataset#mActiveTimestamp` should represent the full
Active Timestamp TLV value but not only the seconds. The same for
`otOperationalDataset#mPendingTimestamp`.
This commit enables a different mbedtls library to be used for RCP
builds. This will make it possible to use a PSA Crypto mbedtls library
for FTD/MTD images while using a non-PSA crypto library on RCPs.
This commit updates `RoutingManager` to track the preference of the
discovered OMR prefixes from Thread Network Data and advertise the
OMR prefixes with the same preference in Route Info Options in the
emitted Router Advertisements.
This commit adds `OmrPrefix` class (which tracks an OMR prefix along
with its preference) and provides helpers method (e.g., method to
compare two OMR prefixes to determine which one is favored, `ToString
()` method). The `EvaluateOmrPrefix()` is updated to use the new
`OmrPrefix` class.
This commit adds a "auto host address mode" in SRP client. When
enabled, host IPv6 addresses are automatically set by SRP client
using all the unicast addresses on Thread netif excluding the
link-local and mesh-local addresses. If there is no valid address,
then Mesh Local EID address is added. The SRP client will
automatically re-register when/if addresses on Thread netif are
updated (e.g., new addresses are added or existing addresses are
removed).
This commit updates CLI to add support for new SRP client APIs related
to the new feature. It also adds `test_srp_auto_host_address` test to
cover the behavior of this feature.
This commit adds an API `otThreadDetachGracefully` to notify other
nodes in the network (if any) and then stop Thread protocol
operation. It sends an Address Release if it's a router, or sets its
child timeout to 0 if it's a child.
This commit changes `EvaluteOnLinkPrefix()` so that when we decide to
start advertising the local on-link prefix, we go through the list of
discovered prefixes to check if the local prefix was previously discovered
and included in the list, and remove it from the list (without
unpublishing it from Thread Network Data). This change allows us to
simplify `InvalidateDiscoveredPrefixes()` which was earlier called and
was in charge of removing the local prefix.
This helps align the logic that when we are advertising the on-link
prefix, we do not allow it to be added in the discovered prefix list
from `UpdateDiscoveredOnLinkPrefix()`.
OpenThread only etablishes links when the link margin is above a
certain threshold, to help ensure that links in the routing topology
are stable. However, if a device has no existing links to neighboring
routers above threshold, then upgrading to a router is useless and
disruptive.
This commit adds a check to ensure there is at least one neighbor
above the link margin threshold before upgrading to a router.
Disable steps 32, 33, and 34 until a solution is found. Depending on
timing, there may be one MLE Data Request/Response exchange for both
Active and Pending Operational Datasets or individual MLE Data
Request/Response exchange for each Active and Pending Operational
Dataset separately.
Some of the current implementations of thread stack use active scans
to find out the joining network name and extended panids. These
details are then used as part of commissioning process.
So at the very minimum we will need processing the incoming beacons to
extract these information.
This commit updates `InvalidateDiscoveredPrefixes()` to remove
invalidated entries from the array directly. This is done by
replacing the invalidated prefix entry in array with the last entry
in list and popping the last entry. This helps simplify the code and
avoid the need to create a separate copy of the list.
This commit also makes other smaller enhancements in this method:
Tracking the `nextExpireTime` to avoid multiple calls to
`FireAtIfEarlier()` from the same method (avoid re-arranging the full
timer linked-list). Also using a boolean `containsOnLinkPrefix` to
track whether we have seen any on-link prefix in the discovered
prefix list (instead of keeping track of the number of such
entries).
A device sends a multicast Link Request message after becoming a
router to quickly and efficiently establish links with neighboring
routers. However, sending a Link Request too quickly can fail in cases
where the neighboring router(s) have not yet received the updated
Router ID set from the Leader.
This commit delays sending the Link Request to allow time for
neighboring routers to receive the updated Router ID from the Leader.
`mcast6.py` is used by GitHub Actions CI to send or receive UDP
messages in multicast groups.
This commit adds a `-u` argument to allow `mcast6.py` to receive UDP
messages without joining a multicast group.
This commit simplifies the mechanism to invalidate/remove a specific
prefix entry in `mDiscoveredPrefixes` list. Instead of passing the
prefix to invalidate as an input to `InvalidateDiscoveredPrefixes()`
method, we directly set the valid lifetime to zero on the entry in
the list before calling the `InvalidateDiscoveredPrefixes()` to then
remove all expired entries.
This change addresses an issue in `HandleRouterSolicitTimer()` where
while iterating over the `mDiscoveredPrefixes` list we could call
`InvalidateDiscoveredPrefixes()` which then removed an entry from the
list (thus changing the list).
This commit changes `EvaluateOnLinkPrefix()` to directly update
`mIsAdvertisingLocalOnLinkPrefix`. The `SendRouterAdvertisement()` is
also simplified to directly use this boolean variable (instead of
a pointer to prefix being passed as input parameter) to determine
whether or not to include a PIO with the local on-link prefix.
This commit contains smaller enhancement in `RoutingManager` related
to `ExternalPrefix` class (which represents a prefix discovered from
processing Router Advertisements from infrastructure netif). This
commit also uses `Array::Find()` methods when searching in the
`mDiscoveredPrefixes` array.
The vicarious router discovery feature depends on the ability to
receive Router Advertisement messages sent in response to Router
Solicitation messages from other hosts. However, this does not work
since Router Advertisement messages are often sent unicast in
response.
This commit enhances routing-manager to avoid using deprecated
(i.e. P_preferred=false) OMR prefixes as the winning OMR prefix, but
still sends RA RIO for the deprecating OMR prefixes.
This commit fixes a bug that BR could incorrectly remove the route of
the local on-link prefix in Network Data when it's still advertising
the local on-link prefix.
This is a short-term fix because in the long term we want to refactor
how `RoutingManager` manages external routes and the default route.
This commit updates and simplifies `RouterAdvMessage`:
- Adds new method to get and set the "default router preference"
- Removes custom overloads of operator `=` and `==` (which
excluded the checksum field). Instead when we save a received RA
in `RoutingManager` we directly set the checksum to zero so the
normal (byte by byte) comparison would properly check all fields.
This commit adds `InfraIf` class which represents an infrastructure
network interface on a border router providing methods & definitions
mirroring the platform APIs `otPlatInfraIf{}`. This commit also
updates the `RoutingManager` to to use the `InfraIf` class.
This commit updates `Tcp::Endpoint` and `Tcp::Listener` types to
inherit from `GetProvider` (which provides `Get<Type>()` methods
allowing them to directly access different components in an
OpenThread `Instance`).
Cert_5_5_05_SplitMergeREED.py was intermittently failing to find an
MLE Advertisement that had a Route TLV with 15 entries. However, the
test topology has 16 routers in steady state. Update packet filter to
look for 16 routers.
This commit adds some wait time before connectivity
validation to mitigate the impact of #7660 which
introduces some random delay before publishing
external route into network data.
This commit changes `RoutingManager::PublishExternalRoute()` method
to return `kErrorAlready` as `kErrorNone` (i.e., if the prefix to be
published was previously published). This commit keeps the logging
the same (i.e. we still log on `Already` error so we can see when/if
this happens).
This commit increases the wait time in `nat64_multi_border_routers`
test to accommodate for the fact that prefixes are added and removed
using `NetworkData::Publisher` which can add additional initial
random wait time (before adding the prefix into network data).
This commit updates `RoutingManager` to use `NetData::Publisher` for
external routes. This ensures to limit the number of similar entries
added in Network Data if there are many BRs within Thread mesh
discovering same set of prefixes and adding them to Thread Network
Data (avoid overflow of Thread Network Data).
This commit contains smaller enhancements in `RoutingManager `
and `Prefix/RouteInfoOption`.
This commit changes how the options are added in a message so that we
directly construct the option in the message buffer (instead of
creating it separately and then copying the bytes).
It also changes `RouteInfoOption::IsValid()` to validate that the
option length can fit the specified prefix length.
This commit adds new `Mle::TxMessage` and `Mle::RxMessage` classes
(as sub-classes of `Message`). `TxMessage` represents an MLE message
to be sent out providing `Append{Some}Tlv()` methods and `RxMessage`
represent a received MLE message providing helper methods `Read
{Some}Tlv()`.
While using sizeof(*icmp6Header) before it is initialized to something
is not wrong, it is possible this will be flagged by some code checker
tools. Lets check using direct type.
This commit adds `OT_THREAD_VERSION_1_3` constant (equal to `4`)
and change=s the `OPENTHREAD_CONFIG_THREAD_VERSION` default value
to be the 1.3 version number.
It also updates the build switch option (Cmake and autoconf)
to support 1.3 and use 1.3 as default version value (when not
explicitly specified).
This commit introduces a base class `GetProvider` which provides
`Get<Type>()` methods using `GetInstance()` (which is expected to be
provided by the derived class in a CRTP style inheritance). The class
`GetProvider` is used as base class of `InstanceLocator`.
This model allows us to provide `Get<Type>()` methods on types that
may not be directly an `InstanceLocator`. For example, this commit
uses this model on `Message` class. `Message` always retains the
`MessagePool` which can be used to get to the `Instance` that owns
the `Message`. Note that it is not straight-forward to to have
`Message` directly inherit from `InstanceLocator` (due to way
`Message` is built from `Buffer` and uses `Metadata` header and that
`InstanceLocator` behaves differently under single vs multi instance
configs).
Deriving the Mesh Local Prefix from the Extended PAN ID was carried
forward from legacy implementations. Removing this coupling to conform
to the existing Thread Specification.
This commit adds a small wait time between steps in the toranj
`test-018-child-supervision` to help make the test more robust. The
test adds some extra time for child to finish the "child update
request/response" exchange with the parent before enabling MAC
filter.
When radio supports receive timing it makes no sense to restrict
scheduling future reception slots while the radio state is for
instance transmitting or receiving, as long as CSL parameters are
properly configured.
Coverage upload can fail intermittently for various reasons. Do not
delete coverage artifacts if upload fails to avoid needing to re-run
the entire workflow.
Return different output of `ValidateDeviceFirmware` depending on the
device's capabilities. This allows to have a single THCI file for the
same vendor for different device's versions.
This commit updates `MleRouter::ProcessRouteTlv()` to not only read
and process Route TLV from a received MLE message but also to update
the `mNeighbor` pointer (in `RxInfo`) which indicates the neighbor
from which the MLE message was received.
During processing of Route TLV, the entries in the router table may
shuffle. If the `mNeighbor` was pointing to an entry in `RouterTable`
it may be invalid afterwards. The new implementation ensures that
`mNeighbor` is correctly updated to point the same entry.
This change addresses a scenario where in `Mle::HandleAdvertisement()`
a potentially invalid (or set to null) `mNeighbor` may be checked
after Route TLV is processed from `MleRouter::HandleAdvertisement()`
call.
This commit adds new helper methods in `Coap` to allocate a new
message and initialize it as a confirmable or non-confirmable post to
a given URI path. It also adds a new helper method to allocate a CoAP
response message for a given request. These methods help simplify the
preparation of CoAP and TMF messages.
Remove excesive logging redundancy:
- `API` decorator is enough to show test script calls with arguments
- `__executeCommand` already prints all OT commands and arguments
- Command timestamp is irrelevant in most cases
- Some extra detail logging lines are left commented in case they
are needed for some debugging
As a result test logs are much easier to follow and resulting files
are much smaller.
The current implementation attempts to remove existing on-mesh prefix
entry when adding an on-mesh prefix entry with the same prefix. The
same logic exists for external routes. However, the existing code does
not work properly when both on-mesh prefixes and external routes exist
with the same prefix.
This commit simply updates the logic to always remove existing entries
with the same prefix, regardless of whether they are on-mesh prefix or
external route. This is in contrast to trying to keep both on-mesh
prefix and external route with the same prefix simultaneously. There
is no obvious use case for having both the on-mesh prefix and external
route exist at the same time.
This commit removes the `#if OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE`
around the call to `IsConsistent()` which checks whether there is any
difference between local network entries and ones from leader network
data and decide to send a "Server Data Notification" message to
leader. This change ensures that services are updated correctly under
the uncommon config combination where `TMF_NETDATA_SERVICE_ENABLE` is
enabled without `BORDER_ROUTER_ENABLE`.
This commit adds `Mle::ProcessMessageSecurity()`. Based on the `aMode`
input, it can be used to encrypt and append tag to a message (which
will be sent) or to decrypt and validate the tag in a received
message. The common method handles the generation of nonce and
preparation of AES-CCM header.
This commit adds a new struct `RxInfo` which includes a received
MLE `Message` along with additional info about it such as the
`Ip6::MessageInfo` and key sequence from security header and
pointer to `Neighbor` from which the message was received.
The `RxInfo` is used as the input parameter in different MLE
`Handle{MleMsg}`()` methods.
`IFA_RT_PRIORITY` not defined basically means that the feature is not
present. Defining it to 9 does not make it effective.
This commit removes the `IFA_RT_PRIORITY` definition so that it would
not compile on platforms that do not support `IFA_RT_PRIORITY`.
This commit simplifies the MLE header processing. It defines
the `SecurityHeader` to represent the aux security header used
by MLE messages (when security suite is set to `k154Security`).
With this change the initial `SecuitySuite` and the MLE `Command`
fields are parsed and appended separately.
This commit adds a new method in `AesCcm` to encrypt/decrypt the
payload content in place within a given `Message`. This is then used
in `Mle` for processing MLE messages. This commit also updates unit
test `test_aes.cpp` to validate the new method.
The `routerCount` value was being reset to zero with each iteration
over the router table. As a result, the comparisons were only
happening on the first entry in the received Route64 TLV.
This commit introduces an API for the circular buffer library. While
we ultimately converged on the linked-buffer-based API that has been
merged into OpenThread, it was also discussed that we should provide a
circular buffer library that is implemented on top of the linked
buffer API, to support applications that find a circular-buffer-based
interface easier to use.
This commit adds support for the remaining TCP callback, which was not
yet supported.
Originally, the unimplemented callback was otTcpSendReady, which would
indicate to the application when new data added to the TCP send buffer
would be sent out immediately. There was also discussion of adding an
otTcpBytesAcked callback, which, together with the
otTcpSendByExtension() call, would allow a circular buffer to be
implemented efficiently on top of the otLinkedBuffer API.
Ultimately, it seemed best to generalize the otTcpSendReady callback
to include both cases where bytes are acked by the connection peer,
and where the send buffer drains, allowing new data to be sent
immediately. The reasoning behind this decision is that both the
otTcpSendReady and otTcpBytesAcked callbacks are triggered by the same
event --- an ACK received from the connection peer --- and that it may
require the application to have to "coordinate state" across
callbacks. Having a single callback function to indicate both
conditions seemed like it could simplify applications significantly.
The new, combined, callback is otTcpForwardProgress. This commit
implements support and documentation for this callback function.
This commit adds a new feature in `MeshForwarder` to add wait delay
after a successful frame tx to a neighbor which is expected to
forward the frame. This wait time applies before the next direct tx
to any neighbor on an FTD. This mechanism is intended to help prevent
self-interference when messages are sent to a destination that is
at least 2-hops away. This commit adds new OT build configs to
enable/disable this behavior and specify the wait interval
(default is set to 8 msec).
This commit allows configuring route metric for the prefix routes of
IPv6 addresses added to the Thread network interface.
This commit also simplifies `UpdateUnicastLinux` by using `AddRtAttr`.
This commit updates the `otMessageGetBufferInfo()` and its related
types. In particular, this commit adds `otMessageQueueInfo` to
indicate number of messages, number of data buffers, and total
message length (number of bytes) for all messages in the queue.
This commit moves and renames the `Random::Manager` class to
the `random.hpp` header file (deleting the `random_manager.hpp`).
It also moves the implementation of some the `Random` functions
e.g. `GetUint8InRange()` or `FillBuffer()` (which are more complex)
to the `cpp` file (instead of defined as `inline`)
This commit contains the following changes:
- The `Dataset` method which reads the dataset TLVs from a message
is renamed to `ReadFromMessage()` and after reading the TLVs, it
also checks that the TLVs in the Dataset are valid (well-formed).
- The `Active/PendingDataset::Save()` methods are updated to return
error in the case the parsed dataset is not well-formed.
- The `Mle::HandleChildIdRequest()` rejects the response if the
included dataset is not well-formed. This ensures that device
stays detached if it cannot accept and save the dataset it gets
from the parent candidate.
This commit enhances the selection algorithm for the preferred entry
when there are multiple "DNS/SRP Service Anycast" entries in the
Thread Network Data. The sequence number (which is `uint8_t`) is used
for selecting the preferred entry and the larger value is preferred.
The seq numbers are compared using "serial number arithmetic"
(RFC-1982) but if we have 3 or more entries the notion of a largest
seq number may not be well-defined under the "serial number
arithmetic" comparison (e.g., for `{10, 130, 250}` there is no
largest seq number since `130 > 10`, `250 > 130` and `10 > 250`). In
such a case the algorithm selects the entry with largest seq number
in normal sense.
This commit updates `FindPreferredDnsSrpAnycastInfo()` to implement
the new algorithm. It also updates `test_network_data` unit test to
add many test cases related to the selection algorithm.
This commit updates the auto-start behavior in `Srp::Client` which
monitors the Thread Network Data entries to discover and select SRP
sever to register with. There are three types of entries in Network
Data and are selected in the order below:
1) Preferred unicast entries with address in service data,
2) Anycast entries (each having a seq number,
3) Unicast entries with address info included in server data.
This commit also defines `AutoStart` class which includes all the
state and data variables related to auto-start feature. It also
updates `test_srp_auto_start_mode` test to cover the newly added
behaviors.
This commit updates how the `MessageInfo` for a "GetQuery" response
is prepared so that we use link-local source if the destination of
response is also using link-local.
This commit adds support for new Status TLV values and updates
the processing of Address Solicit request messages on leader.
The new status `kBorderRouterRequest` can be used by a BR to request to
upgrade to router role. If there are fewer routers than "router
upgrade threshold" leader will accept the request. If the number of
routers is more than the threshold but less than max, the leader will
accept the BR request only if the number of current Border Routers
(as indicated by Network Data) that are acting as router is less than
two (thus allowing up to two BRs to use this status reason to become
router when already above the threshold).
The other change in this PR, is that when processing Address Solicit
request if the included status value is not known or invalid, a
response with `kUnrecognizedStatus` status is sent.
This commit adds `Tmf::MessageInfo` which is a sub-class of the
`Ip6::MessageInfo` class intended for use when sending TMF messages.
The peer port number is by default set to the TMF port from the
constructor. This class also provides helper methods for commonly
used patterns, e.g., source or `SockAddr` set to device's RLOC
address and/or the destination or `PeerAddr` set to leader ALOC or
RLOC, or a given address.
There is no command that can generate different sizes of Spinel frames
for testing the SPI/UART interface. This commit adds a diag command
`diag rcp echo` to RCP for testing SPI/UART interface.
This commit adds a new method in `NetworkData` to find the list of
RLOC16 of all border routers providing external IP connectivity. A
border router is considered to provide external IP connectivity if it
has added at least one external route entry, or an on-mesh prefix
with default-route and on-mesh flags set. It also adds a method to
count the number of border routers. The methods allow filtering based
on the border router device role, including devices in any role, or
in router role only, or in child role only. This commit also updates
`test_network_data` unit test to validate the behavior of the newly
added methods.
The current implementation does not differentiate the max spinel frame
size that is used to pack a spinel command and the radio spinel RX
frame buffer size which could contain multiple frames. In
radio_spinel_impl.hpp, only one spinel frame can be written when
calling function `SendCommand` or `SendReset`.
Therefore the aim of this commit is to allocate, in such a context,
only a buffer of one frame instead of a buffer that could contain
multiple frames.
Signed-off-by: Gatien Chapon <gatien.chapon@nxp.com>
EmplaceSecurelyStoredKeys tries to read the network key and PSKc from
secure storage to update the TLVs and asserts if the read fails. But
if the device was previously running a non-PSA application, it won't
have the keys in secure storage, and the device asserts.
This commit provides a way to move the the keys to secure storage, if
the ExportKey fails. Once it is moved to secure storage, literal key
stored in the settings is cleared.
This commit updates `test_srp_name_conflicts.py` to cover the
situation where different clients try to register services with the
same service instance label but under different services.
This commit updates how the messages waiting for address query
resolution are processed and queued. It adds a boolean flag in
`Message` metadata to indicate whether or not a message is waiting
for an address query resolution. Messages that require address query are
marked and kept in `mSendQueue` instead of being placed in a
different queue `mResolvingQueue`. When the address is resolved the
messages are updated accordingly. This ensures that the order of
messages in `mSendQueue` are preserved.
This commit add more error tracing logs to help identify where a
SRP service registration fails. The log format is also updated to
capitalize the first char to align with rest of the codebase.
This commit updates `Cert_9_2_17_Orphan` packet verification to check
that the two leaders are sending MLE advertisement before checking
for child attach (Child ID response). The current test checked this
after the child attach but leader 1 is turned off 5 seconds after
the child is attached which may not be enough time to ensure rx
of an advertisement (which every 30 seconds on average).
Before starting a test case, our test script calls the `factoryreset`
to make the device enters a known state . But the previous test case
may fail to call the `diag stop` before exiting. This case the next
test case failed to call the `factoryreset `.
This commit allows the users to call `factoryreset` under the diag
mode.
This commit adds new methods in `Ip6::Header` to get and set Traffic
Class, Flow fields. It also updates and renames some of the existing
methods. This commit also adds a unit test `test_ip6_header` to
validate the IPv6 header parsing and preparation.
The test failed when verifying that HOST sends a ping packet to BR
while the destination is a link local address. That requires adding a
route on HOST before the ping. In this specific step, HOST added a
route to link local prefix going to BR. However, HOST failed to send
the echo request to BR using this newly added route. Since the impact
of disabling this step is small, I'll skip this step as for now and
look for a long term fix in the future.
This commit adds a `TimeMilli mTimestamp` field in `Message` metadata.
This replaces the `mTimeout` which was used during lowpan and/or IPv6
fragment reassembly to drop the message if the next fragment is not
received within a time window.
This commit updates `LogMessage()` in `MeshForwarder`:
- Fixes `MessageActionToString()` so when there is a passed-in error
it correctly returns the related action string (and only when
`aAction == kMessageTransmit` it returned "Failed to send").
- Changes the order of parameters in `LogMessage()` and uses default
value for parameters to simplify its use.
This commit updates `Ip6::FragmentDatagram()` to set the priority on
every fragment message to match the original IPv6 message. This
ensures that as fragments are enqueued in the priority queue they
follow the same priority as the original IPv6 message.
This commit changes `Ip6::HandleDatagram()` so to copy the ECN value
parsed from IPv6 header of the message in the accompanying
`MessageInfo` data structure.
This commit adds new header file `ip6_types.hpp` which include
common IPv6 related types (enumerations) and constants. It also
moves the `Ecn` constants and define them as an `enum`.
This commit contains smaller enhancements in `MleRouter` related to
preparation and handling address solicit request/response:
- Simplify router id allocation logic (if RLOC16 is requested
in the address solicit message).
- Simplify `SendAddressSolicitResponse()` (remove `error`).
- Update logs.
- Remove simple comments.
This commit enables defining
OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE, which can be used by
external build system (i.e. Matter) to override the platform
defaults. This is useful for platforms having transceivers that also
support coexistence between multiple protocols (WiFi/BLE etc.)`
This commit adds a new enumerator `kBetterParent` in `AttachMode`
enumeration. This new value is used by periodic parent search
feature only when searching for a better parent to help make
it explicit that attach process is started for this purpose.
This commit contains small changes in `Mle`:
- Renames `mParentRequestMode` to `mAttachMode` (to match its type).
- Shortens `ParentRequestType` enumerator names.
- Changes `SendParentRequest()` to return `void`.
- Adds a protected method `Mle::Attach()` (which replaces
the `BecomeChild()`).
- Moves `AttachMode` enum as a protected definition in `Mle`
class itself and renames the `AttachMode` constants.
This commit adds the `src/posix/platform/settings.hpp` file to make
other components able to access the POSIX data file, so that secure
settings implementation can use the same file as platform settings.
This commit makes the core pass the sensitive keys to the platform
settings initialization, so that the platform settings implementation
can know which keys are sensitive keys during the initializing and do
the migration when needed.
This commit updates `GetNextTid()` in `RadioSpinel` so that it
searches for the next unused TID. The current implementation only
checked the `mCmdNextTid` and assumed that if it was in-use, then all
other TIDs were also in-use. This may not be valid since a TID may be
in-use for a pending radio tx in `mTxRadioTid` while TIDs after that
are still available.
This should help address the situation where while waiting for a
pending radio tx (holding on to `mTxRadioTid`) 15 other radio API
calls happen (each consuming a TID) causing the `mCmdNextTid` to wrap
around back to `mTxRadioTid`.
This commit changes the log level used by `Mac` to log frame rx error
when error is `kErrorAddressFiltered` (from "info" to "debug" log
level). This error is used when the frame is filtered `Mac::Filter`.
This helps reduce the logs during simulation/testing when allow-list
or deny-list are used to form specific network topology.
This commit updates `NetworkData::Service::DnsSrpUnicast` to indicate
`Origin` of the entry, whether the server IPv6 address and port
number is included as part of service data or server data. This will
be used by clients to prefer entries with the info in service data
(which coveys the infra-structure provided (authoritative) server)
over the ones in server data (which are used by Thread BRs).
This commit also updates the unit test `test_network_data` to validate
the new behavior.
This commit renames the method `MeshForwarder::GetDirectTransmission`
to `PrepareNextDirectTransmission()`. This is to help make this method
different from `Message::GetDirectTransmission()` (which indicate if a
`Message` is marked for direct tx).
This commit updates `toranj` test framework to add support for writing
CLI based test-cases (in addition to existing model which uses OT NCP
build along with `wpantund`/`wpanctl`).
Current `Routing Manager` implementation will try to send the failed
RS messages in 60 seconds. RS failures happen often when the infra
interface is re-enabled which is the case of rebooting, and it could
not be acceptable for the border router to take 1 minute to recover
the IPv6 connectivity after reboot.
To resolve this issue, this commit changes the delay to
`kRtrSolicitationInterval` (4 seconds) which is the interval between
two successful RS messages.
This commit adds support for range-based `for` loop iteration over
`MessageQueue` and `PriorityQueue`. It adds `ConstIterator` and
`Iterator` in `Message` class. The non-const `for` loop iteration
(which uses `Message::Iterator`) works properly and is safe to use
even when the entry is removed from the queue during iteration. This
commit updates other core modules to use the new `for` loop iteration
model which helps simplify the code. It also updates the unit tests
to validate the behavior of the newly added iteration mechanisms.
Deleting a copy constructor without specifying an explicit assignment
operator causes an error in clang10 (-Wdeprecated-copy). Since
explicit assignment operator defined in
OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE case, added the copy
constructor deletion also under the same. If the macro is not enabled,
implicit copy constructor and assignment operator would take effect.
This commit sets `fail-fast: false` for matrix in GitHub Actions so
that tests in a matrix do not fail all at once. It's more convenient
now that we can re-run failed tests.
This commit adds `Mle::HasAcceptableParentCandidate()` method
which is used to during attach process after sending an MLE Parent
Request message and waiting for the proper delay (i.e., when attach
timer fires) to determine whether or not we have found an acceptable
parent candidate.
This is a refactor of the existing code with no change in behavior
with goal of making the code easier to read (all the conditions that
are checked when deciding to accept a parent candidate).
This commit adds `Mle::RemoveDelayedMessage()` helper method which
removes messages with a given sub-type and an optional destination
IPv6 address from the `mDelayedResponses` message queue.
Thread Certification Harness makes use of CSL Timeout configurations
as low as 10 seconds, with the expectation that the SSED will try to
autosync very near to the end of the CSL Timeout.
However, the default configuration is to send a Data Request 4 secs
before, which makes several certification tests to fail due to
unexpected polling.
This commit sets the default `pollAhead` to 1 second, aligning better
with the certification testing expectations.
For the on field deployments it shouldn't be an issue that the Data
Request does not reach the parent exactly before the CSL Timeout
expiration since it will resynchronize anyway once one of the
retransmissions reaches the parent.
This commit adds a new mechanism in `Neighbor` to timeout the last
received fragment tag being tracked per neighbor. The fragment tag is
used when `MULTI_RADIO` is enabled to suppress duplicate received
frames (over different radios).
This commit updates the local NAT64 prefix and OMR prefix to be
allocated from the same /48 BR ULA prefix. The /48 prefix is generated
randomly and is saved in Settings for recovery. The subnet id of
prefixes are statically assigned to avoid conflict with each other in
a simple way.
This commit adds new helper macro `OT_SHOULD_LOG_AT(aLevel)` which
indicates whether logging is enabled at a given log level. This helps
simplify the code and makes sure the the condition used for enabling
logging related functions/methods is consistent across all the core
modules.
With this change, when `OPENTHREAD_CONFIG_LOG_OUTPUT` is set to
`LOG_OUTPUT_NONE` (which practically disables all logging), all the
related code/methods that are used to prepare the log line
(e.g. `Mac::OperationToString()`) are excluded from the build
(become empty functions/methods). This way, under `LOG_OUTPUT = NONE`
instead of preparing the log line and then passing it to an empty
`otPlatLog()` implementation to be dropped, the code is optimized to
not prepare the log line in first place.
Test L5.3.5 is failing sometimes because there are unwanted data
requests during the second ping round. This can be mitigated by
finishing earlier with this round so there is no need for children
to synchronize CSL.
This commit adds a new feature in `SubMac` to add random delay before
frame retransmissions. The delay is added only if the previous tx
resulted in `kErrorNoAck`. A backoff algorithm similar to one used
for CSMA is used to determine the random delay, i.e., starting with a
min backoff exponent (BE) which is incremented each time delay is
added up to a max backoff exponent. The backoff interval is derived by
selecting a random value from `[0, 2^BE]` range multiplied by
`kUnitBackoffPeriod=20` times radio symbol time (20x16=320 usec).
The `OPENTHREAD_CONFIG_MAC_ADD_DELAY_ON_NO_ACK_ERROR_BEFORE_RETRY`
is added to enable this behavior (which is enabled by default).
This commit also adds other configs for this feature including
minimum and maximum backoff exponents (the values are from Thread
1.3 spec recommendations).
This commit changes the `Srp::Server` definition to use `Heap::Array`
to store the list of IPv6 addresses associated with a given `Host`.
This makes the array length dynamic and removes the need for
specifying a hard limit on the number of addresses and allow us to
remove `OPENTHREAD_CONFIG_SRP_SERVER_MAX_ADDRESSES_NUM` config.
This commit adds `Heap::Array<Type>` class which allocates the
buffer to store array elements from the heap. The `Array`
implementation automatically grows the buffer when new entries
are added. It also provides optional method `ReserveCapacity()`
to allow user to allocate and reserve a certain capacity
(number of elements user expects to add).
The `Array` can safely be used with element `Type`s that are
themselves heap allocated (manage allocated items). The `Array`
implementation uses the move constructor and destructor of the
`Type` class to ensure that copying the entries when growing the
array is performed efficiently and that the removed entries are
properly deleted.
The `Array` implementation also provides helper methods to search
in the array, e.g., `Find()`, `FindMatching()`, `Contains()`, and
`ContainsMatching()`. It also supports range-based `for` loop
iteration.
This commit also adds a detailed unit test `test_heap_array` which
covers behavior of `Array` with a simple `uint16_t` entry type and
a more complex entry type (validating the constructors and destructor
of entry are properly invoked by `Array` implementation).
This commit adds a new mechanism in `Dns::Client` along with a new
public OT API `otDnsClientResolveIp4Address()` and its related CLI
sub-command to allow a user to request an address resolution DNS
query specifically for A records or IPv4 addresses for a given host
name.
This API requires `OPENTHREAD_CONFIG_DNS_CLIENT_NAT64_ENABLE` to be
enabled. Upon receiving a successful query response the addresses are
reported to user (in callback) as NAT64 IPv6 translated version of
the IPv4 addresses from the received query response.
The new API is added in addition to the existing behavior where address
resolution query from `otDnsClientResolveAddress()` first queries for
IPv6 addresses and only if no IPv6 address is found and NAT64 is
enabled and allowed by the query config, `Dns::Client` implementation
tries to perform an IPv4 query. The new API directly starts with IPv4
query and can be useful in situations where Thread devices are
connected through BRs to a network without global IPv6 connectivity.
IPv6 fragments are unconditionally forwarded to the host even if the
option: OT_IP6_FRAGM for internal reassembling is enabled. It results
with e.g. for RCP echo request are handled twice, by the OpenThread
and by the host.
This commit changes it in this way that when OT_IP6_FRAGM is enabled
IPv6 fragments are not forwarded to the host any more but handled
internally only. When OT_IP6_FRAGM is disabled the IPv6 fragments are
always forwarded to the host. This case is especially important for
NCP architecture with spinel maximum frame size limitation (1500B).
Now the option: OT_IP6_FRAGM should be disabled for NCP to allow
forwarding IPv6 fragments to the host.
I just found that we don't have a test case covers the scenario of
DNS-SD when there are multiple BRs. Specially, one of the BRs starts
with no mDNS cache.
There was a time that our mDNS publisher answered the queries
correctly, even when there was a bug in mDNS publisher that it
cancelled resolving/browsing too early (was fixed in
https://github.com/openthread/ot-br-posix/pull/1120). That bug was
hidden because mDNS cache already contained the needed information.
This commit fixes two small issues regarding OMR prefix election:
- This commit handles the case where `mLocalOmrPrefix` is already in
Leader's Network Data, but not locally added. It is possible when
the BR restores the Network Data from Leader. In such case the BR
should re-add `mLocalOmrPrefix` to local Network Data so that it
keeps advertising OMR Prefix. Otherwise, the OMR Prefix will be
removed from Leader's Network Data because of Network Data
inconsistentency, and then all BRs start to re-elect OMR Prefix. So,
the change will make the OMR Prefix more stable in some corner
cases.
- The change here checks if `mLocalOmrPrefix` was added to the Local
Network Data, instead of checking if `mLocalOmrPrefix` is added to
the Leader's Network Data. Here the BR has already decided that it
should not be advertising `mLocalOmrPrefix`. Whether or not
`mLocalOmrPrefix` is in Leader's Network Data is relevant. The BR
only needs to remove `mLocalOmrPrefix` from Local Network Data and
eventually Local Network Data will synchronize with Leader's Network
Data. The original code also has a potential issue that the BR may
send `NET_DATA.ntf` to Leader indefinitely when these conditions are
met:
- `mLocalOmrPrefix` was added to Local Network Data
- `mLocalOmrPrefix` is not added to Leader' Network Data because
there is no more space in Leader's Network Data
This commit updates `kMessage` in `test_ecdsa.cpp` function which
verifies the signature generation to be an array of char instead of a
`char *`. This ensures that the use of `sizeof(kMessage)` correctly
gives the length of the message string (which is used during hash
calculation).
This commit updates `Dns::Client` such that when parsing a query
response we allow and accept a message with empty question section if
the response code in header indicates an error. This ensures that the
`Dns::Client` can work with DNS name resolvers that may not echo back
the question section in case of an error response.
This commit updates how the CLI command handlers are defined. A
template `Process<CommandId>()` method is now used to process a CLI
command where the `CommandId` is a `uint64` hash ID derived from
the command string itself.
This model helps simplify the CLI modules. With this change, there is
no need to declare different process methods for every CLI command in
the header files. It also makes the association between a CLI command
and its command string explicit and simple (e.g., `"state"` command
with `Process<Cmd("state")>` method).
This commit updates the `SpiInterface` implementation to send any
pending tx SPI frame from `WaitForFrame()` while waiting for a
response frame from RCP. This should help address rare RCP response
timeout which can potentially happen if RCP is not yet ready to
accept a frame in a first SPI transaction from a `SendFrame()` call
followed by a call to `WaitForFrame()`.
This commit updates the `WaitForFrame()` to reuse `UpdateFdset()` and
`Process()` methods which in turn handle the situation that central
is being rate-limited by the peripheral.
The Child ID Response message contains the RLOC16 that the Parent
assigns to the Child. Add a check to ensure that Parent's and Child's
Router IDs match. If the Router IDs do not match, drop the Child ID
Response message.
The commit updates the `mbedtls_ssl_conf_curves` with the new
alternative - `mbedtls_ssl_conf_groups`. The API has been deprecated
in `mbedtls-3.1` and will be removed in a future release. The code is
also kept backward compatible to support older versions.
This commit updates the `SendChildIdResponse()` to check in the case
that the child already has a previously assigned RLOC16 that it
matches the current router ID of the parent and if not we assign a
new RLOC16 to it in the "Child ID response".
This commit implements new logging model in OpenThread. Each core
module can specify its own module name using `RegisterLogModule()`.
The registered log module name is then included in the all the log
messages emitted from the specific file. This model replaces and
enhances the log region model.
Thread Conformance document requires a Link Metrics Subject to
support at least one Link Metrics series (forward or enhanced ACK)
per connected SED.
Make sure this is the default configuration.
This commit adds two inline template functions to get the length of an
array and a pointer to the end of the array. These functions replace
similar macros that were used with OT core modules. The template
functions are safer to use since they would perform type checking at
compile time. The functions validate that the input variable is
indeed an array and unlike the macros they will not work with a
pointer variable.
This commit adds tests for NAT64 prefix
advertisement. BORDER_ROUTING_NAT64 is set to 1 to enable the feature
in tests.
It also adjusted some util functions for prefixes and routes in
netdata.
Testing outbound connectivity to IPv4 hosts is not covered yet. It
will be added after we update OTBR.
If `OPENTHREAD_BUILD_DATETIME` is defined by the build system, the
version string would be something like:
OPENTHREAD/20191113-03303-gbdeacdc55-dirty; NRF52840DK-engFeb 08 2022 13:05:38
^^
We shouldn't put the separator in the macro, but put it in the version
string instead.
This commit adds a flag in Thread link info to indicate whether
destination PAN ID is broadcast.
Verified by running two simulation nodes (modified announce sender
interval) of different Thread networks and make sure there are no
logs of `[WARN]-MLE-----: Failed to process UDP: Security` when
receiving MLE Announce messages.
* Avoid printf, and omit newline at end of tcplp_sys_log calls
* Add new tcplp_sys_panic call to use for assertion failures
* Fix code in "#ifdef INSTRUMENT_TCP" so that it can be used
- Adds platform API `trelDnssdInitialize` to initialize TREL
DNS-SD module.
- Adds `test_trel_connectivity.py` test.
- Fixed `Border Router` TREL test to really use TREL.
This commit implements the new TREL model which uses DNS-SD to
discover TREL peers on the network. This implementation replaces the
previous model which relied on link-local multicast.
This commit adds a new set of `otPlatTrel` APIs and callbacks that are
then used by an updated `Trel::Interface` implementation. The
`Trel::Interface` maintains a TREL peer table which is populated from
DNS-SD discovered services. A device supporting TREL registers a new
service to be advertised using DNS-SD with the service name
`_trel._udp`. It also initiates an ongoing DNS-SD browse for the same
service name within the local browsing domain to discover other
devices supporting TREL. `Trel::Interface` encapsulates and send
unicast frames as a unicast UDP message between TREL peers. Broadcast
frames are sent as a group of UDP unicast transmission to a sub-set
of TREL peers.
This commit also adds a new set of public APIs for TREL along with
support for them in CLI:
- APIs for enabling/disabling of TREL operation at run-time.
- Filter mode API which when enabled temporarily drops all the traffic
on the TREL interface (is mainly intended for testing).
- APIs to get the TREL peer table entries.
This commit adds an implementation of the new `otPlatTrel` APIs under
`simulation` platform. This is used for testing. This implementation
emulates a simplified version of DNS-SD mechanism.
A basic implementation of the `otPlatTrel` is also provided under
`posix` platform. However certain functions are tied to mDNS or
DNS-SD library being used on a device and need to be implemented per
project/platform. A set of weak empty functions `trelDnssd{}` are
defined (along with a description of the their expected behavior)
which can be overridden during project/platform integration.
This commit provides the following changes:
* Introduce a new `otPlatCryptoRandom*` API
* Move usage of `mbedtls_entropy_*` and `mbedtls_ctr_drbg_*` out of
ARM PSA enabled platforms
* Stop exposing internal mbedtls contextes for entropy and CTR DRBG
in OpenThread API
Signed-off-by: Lukasz Duda <lukasz.duda@nordicsemi.no>
THCI used to catch Exceptions and print errors using
`ModuleHelper.WriteIntoDebugLogger`. However, in most of time it just
help hide the actual issue and make it harder to debug.
Re-raising the exceptions should be a better approach:
- @API decorator will print the full exception Traceback via
`ModuleHelper.WriteIntoDebugLogger` and then re-raise.
* update TCPlp #include guards to be TCPlp-specific
* do not use sys/queue.h in tcp_var.h, to avoid polluting global namespace
* avoid bitfields in TCP header structure
* use int32_t instead of int in tcpcb and reorder fields to eliminate padding
This commit removes the `otLogResult{Bbr/Platform}()` macros from
`logging.hpp` and instead have each module implement `LogError()`
method. The main goal behind this change to simplify the logging
module and reduce number of macros/definitions in it (to prepare for
new logging model to be introduced).
Provide a setter for the message code to change it after
initialization of the message.
This complements the existing getter function `otCoapMessageGetCode`.
This commit enables BR to withdraw its local NAT64 prefix if a smaller
one is found in network data.
It might happen when two BRs join the Thread network at merely the
same time and thus both advertise its local NAT64 prefix. The BR with
numerically greater prefix will withdraw its NAT64 prefix.
This commit adds `Commissioner::Dataset` class which mirrors the
public `otCommissioningDataset`. It also adds `ResignMode` enum
which is used as input to `Stop()` method to indicate whether or
not to resign from being the commissioner.
This commit adds `AddressResolver::LookUp()` method which resolves
an EID to an RLOC17 by checking if an existing entry already exists
in the address cache table.
- THCI changes for bbr reset procedure to make a better effort to
reset and to also make sure to restart the otbr-agent prior to
attempting a factoryreset to cover the case where the agent cannot
currently communicate to the rcp.
- THCI change to move from sudo service restart otbr-agent to sudo
systemctl restart otbr-agent, which is more comprehensive.
- THCI changes for multicast to use ipmaddr in both soc and bbr cases.
This commit adds `SerialNumber` class which provides `static` methods
`IsGeater<UintType>()` and `IsLess<UintType()` to compare two serial
numbers, taking into account the wrapping of serial number values
(similar to RFC-1982). This is then used in `MleRouter` and other
modules. This helps us avoid casting of `uint` to `int` for the
comparison (such a casting is undefined behavior in C++11 though
toolchains often implement it as expected). This commit also adds a
unit test `test_serial_number` to validate the new methods.
This commit adds `NetworkData::Type` enumeration to indicate full set
or stable subset. It also adds helper method `GetNetworkDataType()`
in `Neighbor` and `Mle` to indicate what type of Network Data device
requests.
This commit fixes minor bugs in TCP.
1. The first change fixes a bug where the TCP CLI prints out an
incorrect message when a connection is terminated. This appears to
have been introduced in #7279.
2. The second change fixes a null pointer dereference when accepting a
TCP connection. This issue is purely theoretical at the moment,
because in the case where the dereferenced pointer is NULL, the
dereferenced value is not used, and so the compiler optimizes out the
memory access (so it seems). As a result, TCP actually runs without
issues. But I've fixed it anyway, to avoid depending on that behavior.
This commit adds a mechanism in `HistoryTracker` to track changes in
Thread Network Data maintaining a history of on-mesh prefix and
external route entries as they are added or removed by different
nodes in Network Data. This commit also adds new `cli history`
commands to retrieve the Network Data prefix/route history list and
updates the documentation in `cli/README_HISTORY.md`.
This commit generates a random NAT64 prefix and adds the prefix to
NetworkData if none exits. The prefix will be saved in Settings for
recovery.
It also adds a new CLI command `br nat64prefix` to show the local
nat64 prefix.
A new config OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE is defined
and used to guard the change.
This initial implementation only supports a single BR.
This commit updates the handling of service ALOCs in `Mle` by adding a
new class `ServiceAloc` (subclass of `Ip6::Netif::UnicastAddress`)
which provides some simple helper methods (e.g., `IsInUse()` to
indicate whether the entry is currently added to `ThreadNetif`). It
also simplifies `UpdateServiceAlocs()` which adds and removes ALOCs
based on the service entries in the Thread Network Data. These changes
allow us to remove some service related methods from `NetworkData`
which are no longer needed or used (harmonizing how we iterate over
service entries in Network Data).
This commit enables `OT_BORDER_ROUTING` feature in some of the
build scripts (e.g., `script/check-scan-build` or `make-pretty`) so
that it is covered by github actions workflow CI.
Existing deployed networks may have Operational Datasets where the
Security Policy TLV includes a Rotation Time value of 0. Not accepting
such datasets does not allow a Thread device to attach properly.
This commit removes the requirement that the Rotation Time value must
be greater than the minimum value of one hour.
This commit fixex the wrong commissioner mgmt cli args which uses
"binary" to indicate following binary args in HEX string - the format
has been changed to "-x" in #5549.
The reason why cli-commissioner.exp doesn't fail consistently is not
fixed by this commit.
This commit adds support for DNS Stateful Operations (DSO) as
specified in RFC 8490.
It adds `platform/dso_transport.hpp` header file which defines the
platform APIs/callbacks for DSO transport layer (e.g., DSN-over-TLS
or DNS-over-TCP).
The `Dso` module handles establishing connection with a peer, acting
either as a DSO client or server, establishing a DSO session over a
connection, and then sending and processing DSO request, response,
and unidirectional messages (including support for DSO TLV formats).
The `Dso` module also manages the session life cycle and timeouts,
namely the "Inactivity" and "Keep Alive" timeouts (including sending
and processing of Keep Alive messages when needed). It also handles
adding encryption padding before sending a message. It implements the
padding policy "Random-Block-Length Padding" from RFC 8467.
This commit also adds a detailed unit test `test_dso` covering the
behavior (including corner cases) of the `Dso` implementation. The
unit test provides an implementation of the DSO platform APIs which
emulate the DSO transport layer. It also includes a simplified alarm
platform implementation (emulating timers and allowing time to
advance in the unit test). These allow the unit test to cover more
complicated situations and behaviors (timeouts, failures, etc).
The `aFrame.IsDataRequestCommand()` call was checking the frame that
had been already encrypted.
This commit fixes that by using `aIsDataPoll` parameter instead.
This commit adds new methods in `NetworkData` to indicate whether or
not it contains a given on mesh prefix, external route, or service
entry. It also adds a new method to check whether it contains all
entries as in another given Network Data all associated with a given
RLOC16. This is then used to simplify comparison between `Local` and
`Leader` network data.
MATN test cases often takes long time. We'd better move them to a
separate job so that we don't have to rerun MATN cases every time a
border router test fails.
During running T.1.1 tests with the T.1.2 capable sample it turned out
that 9.2.4 commissioner TC is not working when using the device that
is T.1.2 capable. The reason is that in MGMT_ACTIVE_SET
listSecurityPolicy list has only two elements and we are entering the
code, where we assume it is three element, which raises IndexError.
This commit removes the extra `#if` config checks in core files before
`#include` of different headers. Such a check is not necessary since
the OT core headers all start with any related `#if` config check.
This commit caches Border Router test results so that success BR tests
will be skipped when re-running the workflow.
The cache keys are chosen in a way that:
- Each new PR push will trigger cache miss and run the tests
- Each ot-br-posix change will trigger cache miss and run the tests
This commit introduces a number of enhancements to `thread-cert`
Border Router tests to improve reliability:
- Checks `ot-rcp` process status for OTBR tests to help catch errors
earlier
- Make sure `ot-rcp` processes are terminated after one test to avoid
corrupting subsequent tests
- Upload core dump as artifacts if otbr-agent crashed
The firewall feature should not be enabled on some targets,
e.g. ot-daemon. Although leaving it enabled does not break the
behavior, it creates confusing logs.
When setting the IP forwarding rule on Android platform, it needs to
specify the two interfaces between which IP forwarding is enabled.
This commit adds a method to get the infra interface name for setting
IP forwarding rule.
This commit sets `MAX_JOBS` to 3 for Border Router tests (using OTBR
Docker) to improve reliability.
The original `MAX_JOBS` value is 10.
Related metrics:
- Border Router tests takes 12 minutes with MAX_JOBS=10
- Border Router tests takes 24 minutes with MAX_JOBS=3
This commit adds set of generic binary search related functions in
OpenThread core under `BinarySearch` module. The binary search module
replaces and enhances the existing `Lookup` table module (which was
limited to search based on strings and mainly used by CLI to map from
command string to a handler function).
This commit also adds a new class `Stringfy` in `string.hpp` to help
convert from a set of `uint16_t` values (e.g., a non-sequential
`enum`) to strings using binary search in a table. The new methods are
used for converting `Coap::Code` and `IpProto` enumerations to
corresponding strings.
Do all the calculations on uint32_t to prevent bad wraparound check
due to mixing uint32_t with uint64_t.
Signed-off-by: George Stefan <george.stefan@nxp.com>
The RX window when not using RX AT mode is much larger than the
correct time and what is reported by the Open Thread log.
In the case of "receive at" we want the timer to fire before the next
RX window to program the exact RX activity in the radio and in the
other case, the timer will fire when the current RX window will end to
close the receiver and go to sleep.
This commit fixes the issue by increasing the sample time with the CSL
period before starting the timer in the case of RX AT and after in the
normal RX case.
In some build systems, source files is passed as absolute path, log
messages may be truncated. This commit makes VerifyOrDie only prints
basename of the source file.
Current `Srp::Server` is comparing the entire KEY RRs to determine if
the two SRP messages are using the same signing key. But the TTL in
the KEY RR can change even between two SRP messages of the same client
and this will result in false name conflicts.
This commit fixes this issue by changing to compare only the rdata of
the KEY RR.
Some platform diag commands (those not in factory_diags module) will
also do repeat sending and the same callback (Diags::TransmitDone)
will be called. However, in those cases, `mRepeatActive` won't be set.
And if some error (like `CHANNEL_ACCESS_FAILURE`) happened,
`TransmitPacket` will be called then, which makes the channel even
more busy, causing more `CHANNEL_ACCESS_FAILURE`, and so on. This PR
ensures that `TransmitPacket` will only be called again when using
`diag send`.
This commit updates how `Mac` tracks the pending operations by using
a bitset `mPendingOperations` replacing the current model using a
set of `bool` variables per operation.
Because the 2 addresses are registered sequentially from the same
method call, the OpenThread stack will not have had the opportunity to
send out MLR.req with a single address. So this should result in
sending out one MLR.req with two addresses inside, if 2 addresses are
provided. Without changes in the APIs.
This commit removes `OPENTHREAD_CONFIG_LOG_DEFINE_AS_MACRO_ONLY`.
which helps simplify the logging implementation. This feature enabled
all logging including the platform API to be defined as macros and
was intended for certain restricted platforms. With the new logging
model, OpenThread core itself will prepare the entire log line
instead of platform layer, so this feature is no longer applicable or
useful.
This commit helps reduce posix-netif WARN logs when transmitting
messages to Thread.
There are certain ICMPv6 messages (e.g. MLDv2) that OpenThread will
filter when transmitting, so the error `OT_ERROR_DROP` is expected.
This commit also assumes that OpenThread knows what it's doing when it
choose to drop a message, thus using lower log level for
`OT_ERROR_DROP`.
This commit unifies how immediate or delayed routing policy evaluation
is initiated.
This commit also removes `mRouterAdvertisementTimer` to reduce memory
footprint.
This commit enhances Border Routing to ignore discovered OMR Prefixes
when Network Data change. It's possible that a BR may learn an OMR
prefix from RA, and later learn the same OMR Prefix from Network Data.
In such case, the BR should remove the discovered OMR Prefix.
This commit adds new CLI command `joiner state` to get the current
state of `Joiner`. It also adds new public OT API to convert a given
`otJoinerState` to a string.
This commit removes the function `MeshCoP::NewMeshCoPMessage()` and
uses `NewPriorityMessage()` method directly on `Coap::CoapSecure` or
`Tmf::Agent`. This helps harmonize the message allocation model by
MeshCoP modules.
This commit changes `AddressOriginToString()` to a public `static`
method of `Cli::Interpreter` so we can reuse it in `Cli::History`
module and potentially other modules in future. It also removes
similar method from `Cli::History`.
This commit adds a set of `As<TlvType>()` methods which cast from base
`Tlv` pointer or reference to a specific sub-class `TlvType` while
preserving whether the input parameter is `const` or not. This
basically acts as a syntax sugar for this commonly used pattern in the
code.
In PR #7128, the `DefineCoreType()` & `DefineMapEnum()` definitions
(which map the public and core types) were moved to header files
that define the corresponding core type. This allows us to use the
`AsCoreType()` in header files. This commit changes some of inline
methods in the core headers to use it.
Thread specification defines `MLR_TIMEOUT_MIN` as the minimum value of
the MLR Timeout in the BBR Dataset, but this does not affect to the
Timeout TLV in the Multicast Registration Request messages.
Current implementation will reschedule the Stale Timer when discovered
on-link or OMR prefixes or RA messages are updated, but it has a few
issues:
1. It's counting the maximum stale time of all on-link prefixes so
that we will schedule Router Solicitation when all on-link
prefixes become stale. But it failed to filter out OMR prefixes in
the `mDiscoveredPrefixes` list. This results in incorrect stale
time calculation.
2. A deprecated on-link-prefix is not removed from
`mDiscoveredPrefixes` directly but the preferred lifetime is set
to zero. We are not filtering out deprecated on-link prefixes when
calculating stale time and this results in zero stale timer delay
if there are no non-deprecated on-link prefixes.
This commit fixes those issues by having a dedicated
`ResetDiscoveredPrefixStaleTimer` to reschedule the stale timer with
following rules whenever discovered prefixes or learnt RA messages are
updated:
1. If BR learns RA header from Host daemons, it should send RS when
the RA header is stale.
2. If BR discovered any on-link prefix, it should send RS when all
on-link prefixes are stale.
3. If BR discovered any OMR prefix, it should send RS when the first
OMR prefix is stale.
`ResetDiscoveredPrefixStaleTimer` is supposed to correctly calculate
stale timer timeout whenever it's called.
We should reevaluate routing policy only when a discovered on-link
prefix becomes deprecated or preferred. This change reduces sending RA
messages when another peer is keep advertising deprecated (preferred
lifetime is zero) on-link prefix.
This commit fixes the bug that BR may not respond to a Router Solicit
with a Router Advertisement when the BR itself is Router Soliciting.
This bug may cause Vicarious Router Solicitation more likely to fail
because BRs may failed to send RA for vicarious RS.
Previous approach with `dig` was not enough because it was only
parsing one mDNS response and not taking account that the response
could be from an inactive Border Router.
Use Python Zeroconf to properly parse all services.
Currently, we will start routing policy evaluation when new OMR
prefixes are received as RIO options in RA messages. But it's not
necessary to do so because whether we need to advertise our own OMR
prefix is not depending on the discovered OMR prefixes from Wi-Fi link
but the OMR prefixes in Thread network data.
In some cases the first element from the output from __executeCommand
might be empty line, which casues command failures like on below
trace:
__executeCommand('extaddr',) returns ['', '166e0a0000000001', '', 'Done']
FUNC getMAC failed: invalid literal for int() with base 16: ''
This commit filters out empty string from the result of
__executeCommand.
This commit adds `OPENTHREAD_CONFIG_RADIO_LINK_IEEE_802_15_4_ENABLE`
check to CLI processing methods related to `radiofilter` command which
ensures that this is only available when 15.4 radio is enabled. This
allows us to build CLI app successfully with TREL radio only.
This commit fixes the `OwningList::RemoveAllMatching()` to use the
`LinkedList` one. It also updates unit test `test_linked_list` to
cover this method.
The Backbone Router and Border Routing feature will be silently
disabled when the infra/backbone interface is not provided. We should
at least print a warning log in this case since it may not be
intentional.
This commit implements OTBR firewall. This implementation focuses on
ingress filtering. We may also introduce egress filtering when
necessary.
For security purpose, there are some packet forwarding rules to
follow, which were originally introduced in the spec.
- Inbound packets initiated with On-Link addresses source (OMR and
mesh local prefix based addresses) should be blocked.
- Inbound unicast packets whose destination address is not OMR address
or DUA should be blocked.
- Inbound unicast packets whose source address or destination address
is link-local should be blocked. Note that we don’t need to
explicitly add rules for link-local addresses since this should
already be handled by the kernel.
These rules can be easily implemented by iptables and ipset.
Before otbr-agent starts, there is a script creating the iptables
rules. The rules themselves are constant so we don't need to change
them dynamically. During the runtime of otbr-agent, otbr-agent updates
ipsets accordingly whenever there's a change of on-link prefixes.
The current priority of the added routes too high so it may get
preferred over routes learned from RA. Hence we increase the metric to
deprioritize the added routes.
This commit adds a new method `LinkedList::RemoveAllMatching()` which
removes all entries in the list matching a given entry indicator from
the list and adds them to a new "removed" list. A similar method is
also added in `OwningList`. This commit also updates the unit test
`test_linked_list` to validate the behavior of the new method.
This commit updates `Srp::Client` to skip appending services when the
host is being removed. On the first attempt the `mHostInfo.GetState()`
will be `kToRemove` but on the retries it will be `kRemoving`.
When OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE is
set, make sure that sensitive dataset items, such as the
network key or PSKC, are persisted using the secure
Crypto::Storage API (which should encrypt the stored data,
or use secure hardware units) instead of settings.
This commit updates `Timer` class constructor to be `protected` which
ensures that instances of `Timer` can not be created and only
instances of its sub-classes `TimerMilli` or `TimerMicro` can be
used. This helps avoid potential incorrect use of `Timer` class
directly.
Thread harness requires to create thread network without checking the
if the thread protocol version is correct. This commit adds capability
to disable this check.
This commit removes different `MessagePool` methods that can be used
to allocate a new message and combines them into one `Allocate()`
method which uses `Message::Settings`. The `Message::Settings` is
also updated to provide new constructor initializing it with a given
message priority only.
This commit implements new radio filter mechanism in OpenThread. The
radio filter is mainly intended for testing. It can be used to
temporarily block all tx/rx on the IEEE 802.15.4 radio. When radio
filter is enabled, radio is put to sleep instead of receive (to
ensure that the device does not receive any frame and/or potentially
send ack). Also the frame transmission requests return immediately
without sending the frame over the air (return "no ack" error if ack
is requested, otherwise return success). This commit also add CLI
command `radiofilter` for this feature. It also adds test-case
`test_radio_filter` to validate the behavior of the new feature.
This feature requires `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE`.
When running OT CLI in Zephyr, it's not desired to print a prompt
after executing a command, as OT CLI is tightly integrated with Zephyr
shell module which provides its own prompt.
Add a config option which allows to disable CLI prompt on the output.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit fixes the incorrect call to `MessagePool::New()` to
allocate a message in `MeshForwarder::HandleMesh()` method. The
existing code calls `New(Message::kType6lowpan, priority)` with two
parameters which maps to the flavor `New()` method with three
parameters with last one (`Message::Settings`) being optional
(having a default value). Basically, the existing code treats the
`priority` (second argument) as `aReserveHeader` parameter in the
`New()` instead of the message priority.
This commit adds a new static method in `Heap::Allocatable` to
allocate a new object and initialize it using the underlying `Type`
constructor (passing all the parameters to the constructor). This is
in addition to the existing mechanism to use an `Init()` method to
initialize the allocated object. The `Init()` method returns an
`Error` allowing the initialization itself to potentially fail. This
commit also updates `Srp::Server` types `Host` and `UpdateMetadata`
to use the new method.
This commit updates `Srp::Server` such that `Service` instances keep a
`RetainPtr` to a `Service::Description`. This allows a service and
all its sub-types to share the same `Description` instance and helps
simplify the management of the `Description` instances. When the last
`Service` that has a pointer to a shared `Description` is removed and
freed, the `Description` instance will be automatically freed as
well.
This commit adds a new class `Ptr<Type>` which represents a wrapper
over a raw pointer. This is then used as the base class of `OwnedPtr`
and `RetainPtr` providing the common simple methods (avoiding repeating
the same code in each smart pointter). The new `Ptr` class also adds
overloads of `==` and `!=` allowing `Ptr` to be compared with a given
raw pointer or another `Ptr` instance.
This is a workaround that disables the scenario of verifying the
meshcop service when thread is disabled. This scenario sometimes
doesn't work well with mDNSResponder publisher because of the renaming
logic. We are expecting a refactor of advertising proxy & mdns and
this issue should be fixed at that time.
The spec asks border router to publish meshcop service even when
thread interface is inactive. This commit adds test case to verify the
feature.
This commit also introduces boot_delay to add delays between booting
nodes. In this way we can let border routers not starting at the same
time, so that there will be fewer renaming conflicts. This can make
the test more stable.
This commit updates `Dns::ServiceDiscovery::Server` to use
case-insensitive string match when comparing DNS names. It also
updates `test_dnssd.py` to use mixed case names when browsing for or
resolving services. This validates the case-insensitive treatment
of names by SRP client and server and DNS-SD server (resolver) and
DNS client.
This commit changes the `Dns::Name::CompareName/Label()` methods to
perform case-insensitive string comparison. This is realized by
adding a new flavor of `Data::MatchesBytesIn()` which accepts a
`ByteMatcher` function pointer. This allows the caller to relax the
definition of a match and how the bytes are compared. `Message` class
methods that compare bytes are also updated to allow `ByteMatcher` as
an input parameter. This commit also updates the unit test `test_dns`
to cover the new method and behaviors.
This commit adds new string helper functions to convert between
lowercase and uppercase letters. It also adds new function
`StringStartsWith()` which determines whether the string starts with
a given prefix string and `StringMatch()` which compares and matches
two strings.
This commit also adds a new mechanism in all string helper functions
allowing the caller to specify the match mode to be used when
comparing strings: Either an exact match of characters, or a
case-insensitive match where uppercase and lowercase characters are
treated as equal.
This commit also updates `test_string` unit test to validate the new
functions and behaviors.
When the GRL starts, it calls initialize() reset() method on each
device. Reset method call fails due to missing (uninitialized)
attribute `isPowerDown`.
This commit adds `OwningList<Type>`, a singly linked list which owns
its entries and frees them upon destruction of the list. This commit
also updates `test_linked_list` to validate the behavior of the new
class.
This commit adds new flavor of `Dns::TxtEntry::AppendEntries()` to
encode and append TXT record entries in a data buffer (in addition to
existing one which appends to a `Message`). `Appender` class is used
in the underlying implementation . This commit also updates
`test_dns` unit test to validate newly added method.
This commit adds a `Appender` class which acts as a wrapper over
either a `Message` or a data buffer (e.g., `MutableData`) and
provides different flavors of `Append()` method. This class helps in
construction of message content where the destination can be either a
`Message` or a buffer. This commit also adds a unit test for the new
class.
This commit adds two smart pointer types `OwnedPtr` and `RetainPtr`.
`OwnedPtr` acts as the sole owner of the object it manages. It is
non-copyable but the ownership can be transferred from one `OwnedPtr`
to another using move semantics.
`RetainPtr` is an intrusive reference counted smart pointer allowing
multiple pointers to share management of the same object. It requires
the underlying `Type` object to provide mechanism to track the
current retain count. This may be realized by the `Type` itself
providing this or by having it be a sub-class of the newly added
`RetainCountable` class.
This commit also add a unit test `test_smart_ptr` validating the
behavior of newly added classes.
This commit adds a new class `Heap::Allocatable<Type>` which provides
`New()` and `Free()` methods to allocate and free instances of a
template `Type` on heap. The static `New()` method requires the
`Type` class to provide a method `Error Init(Args...)` to initialize
the allocated object as `Type`. The initialization itself can fail
(return `Error`) in which case `New()` will release any allocated
buffer and return `nullptr`. The `Free()` method invokes the `Type`
class's destructor before releasing the heap pointer. This ensures
that any heap allocated member variables in `Type` (e.g., any
`Heap::String` or `Heap::Data`) are freed before the `Type` instance
itself is freed.
Add the following options `-Wno-sign-compare` and
`-Wno-unused-parameter` with target_compile_options to suppress
warnings. These options will be appended to the end of options
inherited from COMPILE_OPTIONS and CMAKE_C_FLAGS.
This commit adds TCPlp's TCP protocol logic, which is derived from the
TCP protocol logic in the FreeBSD Operating System. The FreeBSD code
had to be refactored to work for TCPlp, and I have added extensive
comments explaining the code that was deleted and changed. The changes
are primarily modifications to work with TCPlp's data buffering (see
#6926), removal of features that depend on dynamic memory allocation
to save memory (SYN cache, compressed TIME-WAIT state) and removal of
features that aren't relevant in this setting (e.g., TCP Segmentation
Offloading, IPv4 support).
Some certification tests are failing because otbr-agent service is not
started back after calling powerDown (isPowerDown flag is kept False
and reset function fails on checking thread state - since the service
is stopped, we can't return status).
Also minor fixes for printing logs, disabling paramiko DEBUG level.
Avoid parsing responses for not expected cases.
Fixes some issues with Thread 1.2 certification test cases in which
it's not required to parse the mDNS response.
This commit removes incorrect calls to UpdateMldReport.
- UpdateMldReport(MA, true) should be called when a MA is registered,
thus in MulticastRoutingManager::Add.
- UpdateMldReport(MA, false) should be called when a MA is expired,
thus in MulticastRoutingManager::Remove.
Note that removing an Multicast Forwarding Cache (MFC) does not mean
the MA is expired. The MFCs can be freely removed even when the MA is
still registered and being renewed.
This commit updates the `Srp::Server` to use the `Heap::Data` class
for storing the TXT record data bytes. This helps simplify the code.
This commit also adds a new helper method in `Heap::Data` to set
the data from a given number of bytes read from a `Message` at a
given offset. It also updates the unit test to cover the behavior
the new method.
We added a dry run option. So it is possible that the settings fd is
-1 when de-initialization. The assert here makes the program
crash. This commit updates it to a `VerifyOrExit` to avoid crashing.
This commit fixes the potential memory leak of `mTxtData` when a
`Description` instance is freed. Also addresses similar situation
with `mServiceName` when `Service` instance is freed.
Some certification tests are failing because not enough delay is
applied after a Linux ping command is sent and the capture misses the
ICMP transaction.
Also removing unneeded check for Thread 1.2 harness version when
reconnecting to the serial port after a reset.
HostNode is based on OtbrDocker, which has otbr-agent service started
by default. We should disable this service on HostNode otherwise the
border router test cases won't have the exact expected topology.
Thread Specification allows a parent to update child network data by
sending a unicast MLE Data Response. Receiving the child's Leader Data
in a MLE Child Update Request message should serve as an
acknowledgment when the network data is received.
This commit updates `Srp::Server` adding a new type `MessageMetadata`
which is used during processing of a received SRP Update message.
This class serves two purposes: (1) It helps simplify the code by
combining all related parameters (current offset in the message, DNS
`Header` and `Zone`, and `Ip6::MessageInfo`) into a single `struct`
which is then passed to different `Process{}()` methods. (2) It
defines new fields to represent the time when the message was
received (allowing us to process the message as if it was received
earlier than the current time) and the lease interval values to be
granted during processing of the message. These are added in
preparation for enabling SRP Replication (SRPL). With SRPL we can
receive an SRP Update message from an SRPL partner (i.e., another SRP
server) and then need to process it as if we received it on this
device at the same time as the original SRPL partner processed it and
with the same lease config values.
This commit moves the heap functions `CAlloc` and `Free` from
`instance.hpp` header to a separate `heap.hpp` header file. The main
reason is to make it easier to include this header file from other
modules (avoid the header dependency/loop issues by requiring to
include `instance.hpp` to get access to heap functions). This commit
also defines a `Heap` namespace and moves other heap allocated types
under this namespace (`Heap::String` and `Heap::Data`).
This commit adds new class `HeapData` which represents a heap
allocated data buffer of a given variable length. This class provides
methods to set/copy the `HeapData` from/to a buffer or a `Message.
This commit also adds unit test for the new class.
Modify `mdns_query` to accept a list of reference devices link local
addresses in order to discard their mDNS responses.
Also accept a service string to be used for the Thread 1.3
Certification program.
Return the DUT's Border Agent address and port.
Existing IPv6 implementations may not implement DHCPv6 to acquire an
IPv6 address. As a result, a Thread Border Router must advertise a ULA
if there is no existing prefix that supports SLAAC (i.e. has A flag
set).
This commit adds `enum` types to use as arguments `aRetainName`
and `aNotifyServiceHandler` in the calls to method `RemoveHost()`
and `Host::RemoveService()`.
`otDump` will currently always dump to string and use the log level to
decide whether to print it. Since this function is in the key path of
packet handling, this behavior reduces network throughput. This commit
adds a log level check to fix the issue.
This commit moves the `DefineCoreType()` & `DefineMapEnum()`
definitions (which map the public and core types) to the related
headers where the core type is defined, e.g., `otIp6Address` to
`Ip6::Address` map is now defined in `net/ip6_address.hpp`. This
allows us to use `AsCoreType()` in more places (avoid the header
file dependency/loop).
This commit allows `mParentChanges` counter which tracks the number
of times device (as a child) switches its parent to be used without
`INFORM_PREVIOUS_PARENT` feature.
This commit fixes a bug that PBBR does not send Address Query and
Backbone Query on behalf of MED Children, and add a test to make sure
DUA forwarding works on PBBR:
- Make sure PBBR sends Address Query and Backbone Query on behalf of
MED Child
- Make sure PBBR does not send Address Query when the destination is
MED Child
- Make sure MED Children do not send Address Query by itself
- Verifiy DUA reachability between PBBR and MED Child
- Make sure PBBR reduce IPv6 TTL by 1 when forwarding DUA destined
messages
This commit adds missing `#if` check in `network_data_publisher.cpp`
to ensure it can be built when `CONFIG_BORDER_ROUTER_ENABLE` is
disabled (i.e., with `CONFIG_TMF_NETDATA_SERVICE_ENABLE` only).
Added new API/CLI for reference devices to set allowed ranges of
router IDs. When the allowed ID range is set, the leader will only
assign router IDs in the range. In this way, we can assign
non-overlapping router ID ranges to different thread networks so that
no RLOC16s will collide across multiple thread networks.
Apply all CSL accuracy rules from latest spec draft:
- If the Mode TLV in the Parent Request had the 'R' flag set to zero
AND the Version TLV indicates that the version of the attaching
device is Thread 1.2 or greater, the Parent SHOULD include the CSL
Accuracy TLV in the Parent Response.
- A Parent that receives a Child Update Request which includes the CSL
Synchronized Timeout TLV MUST include the CSL Accuracy TLV in the
response.
- A Child that receives a Child Update Request which includes the CSL
Accuracy TLV MUST include the CSL Synchronized Timeout TLV in the
response if the Child is currently acting as a CSL receiver.
- double wait time for advertising proxy top update and multicast the
SRP updates
- adjust waiting time to avoid collision with lease time schedule
- fully remove the service before starting next test case
- add debug logging
This commit adds support for joining and leaving multicast group in
order to send proper Multicast Listener Reports from thread network to
backbone link.
This commit adds two simulation tests to verify that SRP clients can
register 500 services to one SRP server:
- Virtual time simulation test with one SRP server and 25 SRP clients,
each client registering 20 SRP services.
- OTBR simulation test same as above, but run SRP server on OTBR
(Docker).
This commit uses `AsCoreType()` and other functions from header
`as_core_types.hpp` to cast between public OT C style definitions to
the related C++ core types in the core modules.
In the previous version of this test case, the ED node was actually a
REED, where the test plan asks it to be a ED. Changing the node to ED
makes the topology more stable. I've run the test case 50 times
locally and none of them failed.
If we configure CSL parameters before a command to attach, then the
child has configured valid CSL state, but when trying to configure the
auto-sync CSL poll timeout, the check to IsCslEnabled->IsCslCapable
fails because IsChild() fails.
When handling the child ID response success, we now trigger
poll-sender's recalculation, and rx-on-idle states, after role change
to child.
This commit exports private spinel utility functions to access vendor
implemented properties from the host.
The commit also reserves the vendor property range for Espressif to
avoid collision.
This commit implements part of the OTBR firewall. This implementation
focuses on the ingress filtering part. We may also introduce egress
filtering part when necessary.
For security purpose, there are some packet forwarding rules to
follow, which were originally introduced in the spec.
- Inbound packets initiated with On-Link addresses source (OMR and
mesh local prefix based addresses) should be blocked.
- Inbound unicast packets whose destination address is not OMR address
or DUA should be blocked.
- Inbound unicast packets whose source address or destination address
is link-local should be blocked. Note that we don’t need to
explicitly add rules for link-local addresses since this should
already be handled by the kernel.
These rules can be easily implemented by iptables and ipset.
- Before otbr-agent starts, there is a script creating the iptables
rules. The rules themselves are constant so we don't need to change
them dynamically.
- During the runtime of otbr-agent, otbr-agent updates ipsets
accordingly whenever there's a change of on-link prefixes.
This commit adds a new macro `SuccessOrAssert()` which checks a given
status value against zero (zero status indicates success or no error)
and `OT_ASSERT()` if it is not. This helper macro is then used by
other modules where we want to assert that some method/function is
not returning an error.
This commit uses a longer duration (10s) to make the test more
reliable.
The root cause why LEADER does not become Leader within 4s is still
unknown and to be investigated.
Thread Test Harness requires devices to operate as if they were
commissioned using CCM. This commit adds the ability to configure the
device to behave as if it was commissioned using CCM. This
functionality requires `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` to
be enabled.
Problem:
I have encountered CslTxScheduler entering the incorrect state causing
the device to be unable to perform csl transmission. The state is
when mCslTxChild is null but mCslTxMessage is not null. As a result
Update() call does not have any effect.
I think that we enter the incorrect state when the following happens:
1. CSL transmission on mac is requested (mCslTxChild is set to the
best child found in RescheduleCslTx(), mCslTxMessage is set to the
child's IndirectMessage in HandleFrameRequest())
2. During the ongoing mac CSL transmission, Update() is called (this
method can be called from multiple places)
3. The mCslTxChild's IndirectMessage differs from the mCslTxMessage
==> mCslTxChild is set to nullptr
4. After the finished csl transmission on mac, the HandleSentFrame()
is called but it does not call RescheduleCslTx() so the mCslTxChild
remains nullptr
Then every Update() call does not have any effect. To change that we
would have to call RescheduleCslTx() or set the mCslTxMessage to null
but there is no way of doing that.
Solution:
I believe that mCslTxMessage is "tracking" the mac transmission - it
is to be set when transmission is requested, and to be cleared when
the transmission ends. In this commit we are doing it in a clear way.
This commit adds a member mDryRun in otPlatformConfig, allowing the
app to initialize in 'DryRun' mode. In this mode, many modules won't
be initialized. For example, the settings file and the tun device.
Background:
The otbr-agent provides a way to query the RCP version in a single run
which we call as 'DryRun'. During this process, the full posix daemon
initialization will be done (including initialization of the settings
file, access the tun device, create the sock file, etc). This will
cause such problem - In production, otbr-agent usually runs as a
service in some non-root user and is granted with the capability and
access it requires. But otbr-agent could sometimes also run by other
users to query the RCP version. For example, developers do that from
the console with the root user. In such case, otbr-agent will create
some files owned by the root user first. And then when the service
tries to start (with a non-root user), otbr-agent will find that it
doesn't have enough permission to open the file.
So in this commit, we try to prevent otbr-agent from touching any
files and other permission related stuffs if the DryRun option is set.
However it still needs to access the radio device (for example, the
'spi') since it needs to get the radio version. But accessing the
radio device with the root user doesn't affect the upcoming usage by
other non-root users.
Some enhancements for cert test run:
- Use a different log name for every test run. With the help of this
we can get all logs & pcaps after running a test case when MULTIPLY
> MAX_JOBS.
- While running test cases, print a line showing the test case being
run.
This commit adds a new common `Timestamp::Compare()` methods which
compares two given `Timestamp` pointers (determines whether they are
equal or one is ahead or behind the other one). The new method allows
either input (or even both) to be `nullptr`. A null timestamp is used
to indicate when there is no timestamp. In terms of comparison
result, a non-null timestamp is considered to be ahead of (or larger
then) a null one and two null timestamps are considered equal. The
new method is used in all different places where the `Timestamp`s are
compared.
This commit also adds a unit test to verify the `Timestamp` class (the
existing `test_steering_data` is renamed to `test_meshcop` which is now
used to include unit tests for all MeshCoP related definitions).
Add steps which verify the bug fix contributed to OTBR:
https://github.com/openthread/ot-br-posix/pull/1020
That is, verify that SRP updates which modify both a host
and a service can be successfully completed.
Current implement will start evaluating on-link prefix before
successfully sending kMaxRtrSolicitations=3 RS messages. This commit
fixes this issue by retrying sending failed RS messages in
kRtrSolicitationRetryFailDelay=60 seconds.
tcplp uses stdio.h which, for some libc implementations, can depend on
Kconfig defines.
These Kconfig defines can be included through compile options in
ot-config.
Link with ot-config to get the compile options.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit addresses an issue when forwarding received messages under
`MUTI_RADIO` config. We clear the radio type (which indicates the
radio on which the `Message` is received) when the same `Message`
instance is forwarded back to the Thread mesh to be sent out to a
neighbor. This then ensures that `RadioSelector` picks the radio to
send deadpanning on the neighbor's supported radios and their
preference.
This commit also updates `test-703-multi-radio-mesh-header-msg.py` to
verify and cover this situation.
This commit updates some of the `SpinelDecoder::Read{Item}()` methods
to initialize their local pointer variables to `nullptr`. Though we
technically do not need this change (since the call to `Read(aPtr)`
will set the pointer value on success), some toolchains cannot infer
this from the code and generate error/warning of "pointer may be
used uninitialized".
This commit changes `KeyManager` to use `SetAllMacFrameCounter(0)` to
reset the frame counter(s). This would then ensure that the new
counter value is also set on `SubMac` and radio platform layer
(which can handle the 15.4 frame counter assignments). This addresses
an issue where on Key Sequence update the frame counter values on
`SubMac` and radio platform can remain unchanged.
This commit updates CLI to not include the CLI prompt string "> " when
emitting the command's input and output to the logs under the config
`OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_ENABLE`. It also changes how
the input command is logged to avoid logging empty lines or extra
spaces in between the args.
This commit adds a check in `SignalFrameCounterUsedOnTxDone()` to
ensure that radio platform did indeed update the header (i.e.,
assigned a frame counter) before reading the counter value from the
frame and signaling its use.
This commit fixes two related aspects of updating of the frame counter
in `SubMac` and synchronizing the value with `KeyManager`.
It fixes an issue (when radio platform handles tx security and frame
counter management) where the counter value in `SubMac` and
`KeyManager` were set to old value used in the last transmission
(from `TxDone` callback). This would then lead to an already used
frame counter value to be included in MLE Link Frame Counter TLV.
Under `MULTI_RADIO` this could cause more harm since when appending
MLE Link Frame Counter TLV we move all counters for each radio link
up to max value among them and set the counter value on all radio
links(which would then cause the counter on radio platform to be set
to an older value).
This commit also updates the code to handle the case where the counter
value updates may be signaled out of order. This may happen due to a
new counter value being used for an enhanced-ack by radio platform
during tx of a frame. Note that the newer counter used for
enhanced-ack is processed from `SubMac::HandleReceiveDone()` which
can happen before processing of the older counter value from
`HandleTransmitDone()`.
This commit the libraries that I wrote as part of TCPlp to handle data
buffering. These libraries are intended to replace the mbuf-based data
buffering in the FreeBSD TCP implementation. They implement the send
buffer as a linked buffer chain (consistent with otLinkedBuffer in
OpenThread's TCP API) and the receive buffer as a circular buffer and
bitmap (used to keep track of which bytes were received out-of-order).
This commit updates and simplifies processing of Active/Pending
Timestamp TLVs (in MeshCoP and MLE) by using TLV helper methods
that read/write the TLV's timestamp value from/in a message.
This commit removes the `OT_TOOL_PACKED` requirement from types
`otMacKeyMaterial` and `Mac::KeyMaterial`. Generally, we define a
type as "packed" if it may be embedded in a message/buffer (e.g. a
TLV) and/or may be cast from a buffer pointer. Neither case applies
to `KeyMaterial`.
For certain external mbedTLS configurations, there is no much sense to
define MBEDTLS_SSL_EXPORT_KEYS when OT has Joiner || Commissioner ||
DTLS functionalities disabled.
This commit only ensures that such builds don't fail. The
mbedtls_ssl_key_export_type type is defined only when
MBEDTLS_SSL_EXPORT_KEYS is defined, while dtls.hpp is always taken
into the build process.
This commit fixes `DatasetManager::HandleSet()` to add a check to
ensure that the message contains `PendingTimestampTlv` when the
Pending Dataset is being updated.
This commit fixes the `NetworkName` check (for its length to be larger
than zero) which was recently added in commit e2f0afab5d. This commit
moves the name length check to method `Set(const NameData &aNameData)`
and after the `newLen` is calculated.
This commit also updates `TestMacNetworkName()` in unit test to verify
that setting the network name to an empty string correctly fails with
`kErrorInvalidArgs`.
This commit adds a new class `Cli::Output` which now includes all the
simple `Output{Item}()` methods that are used by CLI and its
sub-modules. It also adds new `Output` method flavors that output an
item (e.g., an IPv6 address) with an appended newline at the end.
These patterns are often used by CLI modules so having such new
methods help simplify the code.
The commit also adds `OutputWrapper` which is a wrapper over an
`Output` instance providing similar methods. This class is used as
the base class of different CLI sub-modules (e.g., `Cli::Dataset` or
`Cli::Joiner`, etc.) which helps simplify their implementation
(allow them to use the same set of `Output` helper methods as the
ones used by the `Cli::Interpreter` class).
This commit updates the `NetworkData` implementation to simplify it
and make it more flexible. It changes `NetworkData` class such that
it delegates providing the buffer space to store the TLVs to its
sub-classes (`Local`/`Leader`) or its users. This allow us to remove
many `static` methods that expect inputs of `(aTlvs, aTlvsLength)`
and instead the use the `NetworkData` methods directly. Basically,
the `NetworkData` class can now be considered as a wrapper over a
pointer to a buffer containing a sequence of TLVs which provides
methods to parse and process the TLVs. `NetworkData` class assumes
that the TLVs (buffer content) is immutable and we have a new class
`MutableNetworkData` which provides methods to update (add, remove,
or modify) the TLVs.
This commit updates the `Message::Chunk` type to use `Data` as its
base class (thus inheriting the common helper methods from it) which
helps simplify its use. This commit also adds couple of new methods in
`Data` class (method `SetLength()` to change the `Data` length, and
`MatchesBytesIn()` to compare the `Data` content with bytes from a
given buffer). The `test_data` unit test is also updated to check the
newly added `Data` methods.
This commit updates and simplifies the `alarm` platform implementation
under simulation by adding new functions to determine whether a timer
is expired and calculate the remaining time. The new code does not
use casting a `uint32_t` value to an `int32_t` (since its behavior is
toolchain/compiler dependent and it is not defined by the C++
standard).
This commit adds forward compatibility with mbedTLS 3.0.
Changes that affected OpenThread implementation:
- Rename mbedtls_*_ret() cryptography functions whose deprecated
variants have been removed (migration guide)
- Replace MBEDTLS_SSL_MAX_CONTENT_LEN with MBEDTLS_SSL_IN_CONTENT_LEN
and MBEDTLS_SSL_OUT_CONTENT_LEN options (migration guide)
- Signature functions now require the hash length to match the
expected value (migration guide)
- SSL key export interface change (migration guide) - this change
affected us a little bit more, since Key Block for KEK generation is
not part of mbedTLS callback anymore. I was able, however, to
retrieve it from Master secret (did successfully commissioning
between 2.2x vs 3.0). By the way, I clean up the code for KEK
generation - I don't know why we also executed it for application
CoAP secure?
- Separated MBEDTLS_SHA224_C and MBEDTLS_SHA256_C (migration guide)
- Most structure fields are now private (migration guide) - we use
private fields just in two files in dtls.cpp and ecdsa.cpp. For now,
I used a workaround by defining MBEDTLS_PRIVATE macro but we should
request the mbedTLS team to provide us support for public
getters.
Background:
In an early stage of developing a new product, developers may want to
verify the Thread related hardware functionality, for example, send,
receive, etc. However if the product uses the posix <-> RCP mode,
it's hard to verify it before the posix daemon can run on the
host. cli-ftd and cli-mtd could be an alternative. However, if the
product uses the posix <-> RCP mode, the space of the 802.15.4 radio
chip will be very small. For example, nRF52811 doesn't have enough
space to flash cli-ftd or cli-mtd firmware. So this PR creates a new
firmware ot-cli-radio which has very limited functionality for
verifying the hardware.
Basically, the ot-cli-radio consists of openthread-radio and
libopenthread-cli-radio.a. It supports very few cli commands. The most
important command is diag. Currently, there are: diag, help, reset,
version.
Currently, the diag commands have different implementation on RCP:
- For commands like diag start, the process function
(Diags::ProcessStart) is first called on host. Then host sends an
SPI frame to the RCP and Diags::ProcessStart (different
implementation) is called again on RCP.
- For commands like diag send, Diags::ProcessSend is first called on
host. Then host sends an SPI frame to the RCP, directly calling
send API. And there is no Diags::ProcessSend implemented on RCP.
Let's call the implementation of Diags::Process* currently on host as
native diag commands. When we run ot-cli-radio, we should use the
native diag commands because it won't interact with a posix daemon and
it processes the diag commands through the whole process. So this PR
adds a new option OPENTHREAD_CONFIG_DIAG_NATIVE_CMDS_ON_RCP to control
whether to use the native diag implementation on RCP. When we use a
normal RCP, the option should be disabled. While when use
ot-cli-radio, the option should be enabled.
This commit adds support in `HistoryTracker` to record the history of
changes to the Thread interface's unicast and multicast IPv6 addresses.
An entry is recorded when an address is added or removed. For unicast
addresses, each entry provides:
- Timestamp
- Event: Added or Removed
- Address : Unicast address along with its prefix length (in bits).
- Origin: Thread, SLAAC, DHCPv6, or Manual.
- Address Scope.
- Flags: Preferred, Valid, and RLOC (whether the address is RLOC).
For multicast address history, each entry provides:
- Timestamp
- Event: Subscribed or Unsubscribed.
- Address : Multicast address.
- Origin: Thread or Manual.
This commit also updates CLI and adds `history ipaddr` and
`history ipmaddr` commands to get the lists. It also updates the
documentation in `README_HISTORY.md`.
This commit adds a new class `AnycastLocator` which can be used to
locate the closest destination of an anycast IPv6 address (i.e., find
the related mesh local EID and RLOC16). The closest destination is
determined based on the the current routing table and path costs
within the Thread mesh.
The implementation uses a CoAP confirmable post request to a newly
added URI path ("a/yl"). The destination IPv6 address of such as
request message is set to the anycast address to be located. The
receiver of the request message sends a CoAP response which includes
the "Mesh Local EID" and "Thread RLOC16" TLVs.
This commit also adds support this new feature in CLI (adding a new
`locate <anycast-addr>` command).
Finally this commit adds `test_anycast_locator.py` to test behavior of
the new feature.
This commit adds header file `common/as_core_type.hpp` which adds
helper functions `AsCoreType()` which help convert from a
public C OpenThread type to its corresponding C++ core type (e.g.,
`otIp6Address` to `Ip6::Address`). This commit also adds `MapEnum()`
function to convert between public and core `enum` definitions (e.g.,
`otMacFilterAddressMode` and `Mac::Filter::Mode`). These helper
function act as syntactic sugar helping simplify the implementations
of OT API functions (in `api/{module}_api.cpp` files).
This commit adds new types `NetworkData::ServiceData/ServerData`
(which use the `ot::Data` class) which help simplify different
`NetworkData` methods dealing with Service and Server TLVs.
This commit adds two new generic types `Data` and `MutableData` which
are simply wrappers over a pointer to a buffer and a given data
length. The data length can be either `uint8_t` or `uint16_t` which
is determined by a template parameter. The `Data` treats the content
of the buffer as immutable whereas `MutableData` allows it to be
changed. This commit also adds a unit test `tes_data` to verify the
behavior of newly added types.
This commit ensures to call `UpdateRoutes()` on rx of a first lowpan
fragment frame. `UpdateRoutes()` can then update the snooped address
cache entries and check if the message is from a previous child (which
indicates that the child has switched to a new parent). This change
should help address an issue with "inform previous parent" behavior
not removing the child when `MULTI_RADIO` is enabled (due to frag
header added to the frames for duplication detection under
multi-radio).
This commit fixes a potential bug that delayed Data Requests may use
wrong Active and Pending Timestamps because the Active & Pending
Timestamps may change while a Data Request is being delayed.
This commit disallows concurrent commands.
With this commit, the CLI only execute a new command after it complete
the previous command. CLI can also prompt properly after the command
execution is done.
Other fixes and enhancements:
- Fixes premature command prompt
- Add ping async command for ping in async mode: output Done
immediately but print ping responses later on.
- Fixes networkdiagnostic get outputs multiple Done by always waiting
for 5 seconds.
This commit updates `Start()`, `Stop()` and `SendAnnounce()` in `Mle`
to remove the extra parameters from the `public` versions of these
methods (adding a `private` version with extra parameter for use by
`Mle` class itself). It also adds `StartMode`, `StopMode`, and
`AnnounceMode` enumerations to use as parameter type (instead of
`bool`) in these methods which helps with code readability.
This commit updates the `Message::Settings` such that it directly
inherits from the `otMessageSettings` C struct definition. This helps
simplify the initialization of the constant default `Settings`
instance (from `GetDefault()`) to avoid calling object constructor.
It also simplifies the conversion from an `otMessageSettings *` to
a `Settings` (if the pointer is not NULL, the `otMessageSettings`
instance itself can be directly used instead of creating a copy).
According to SPEC-981, we need to verify 3 more things while setting a
network name:
- The name length >= 1.
- There are no UTF control characters in the name.
- There are no UTF NUL characters in the name. This is covered by the
second rule.
This commit updates `Srp::Server` to add support for selecting its
address mode (unicast or anycast). The address mode specifies how the
SRP server determines its address and port number and how this info
is published in Thread Network Data.
In anycast address mode, the SRP server will use port number 53 which
is also used by DNS resolver/server. So if both `Srp::Server` and
`Dns::ServiceDiscovery::Server` are enabled on a device, they both
need to listen on the same port number and share the same UDP socket
instance. This commit adds the mechanism in the code to realize this.
The `Srp::Server` will monitor when/if DNS-SD is active and checks
whether the port numbers match and if so it will close its own socket
and re-use the one from DNS-SD. In this case, an incoming UDP message
is first given to `Srp::Server` to process and if it fails to process
it then the message is given to DNS-SD.
This commit also adds CLI commands under `srp server` to get/set the
address mode (and update the `README_SRP_SERVER.md` documentation).
It also adds a new test `test_srp_server_anycast_mode` which covers
the SRP server address mode and the newly added behaviors.
- New format for MAC keys, as a union between literal key and keyrefs.
- Modified key_manager to handle both literal keys or keyrefs.
- Modified MAC and sub_mac modules to handle both Literal Keys or keyrefs.
- Updated Crypto Modules to use abstracted APIs.
- New CLIs to handle networkkey and pskc references.
When brew install ninja, python 3.9 is being installed as a
dependency. However, the installation failed because there is a
conflict on binary /usr/local/bin/2to3.
This commit simplifies the `Metadata` definition in `Message` by
rearranging the member variables (to avoid alignment gaps). It moves
the definition to be sub-type of `Buffer`. It also removes the
doxygen documentation for `private` or `protected` definitions
(mainly for simple getters/setters).
This commit adds `OPENTHREAD_CONFIG_LOG_PREPEND_UPTIME` config to
prepend the current uptime (as "[x days] hh::mm::ss.mmmm") to the
OpenThread log messages.
This commit adds a new module `Uptime` which tracks the number of
milliseconds since OpenThread stack initialization as an `uint64_t`
value. It also adds public OT APIs to get the current uptime value
(either as the number of milliseconds or in human-readable string
format like "2 days 12:45:12.762"). A CLI `uptime` command is also
added. This feature can be enabled using the newly added config
option `OPENTHREAD_CONFIG_UPTIME_ENABLE` (or the related CMake
`OT_UPTIME` option).
This commit adds a new header `common/const_cast.hpp` which provides
template functions `AsConst()` and `AsNonConst()` to cast between
const and non-const references or pointers. The template functions
simplify the code (act as syntactic sugar) by allowing the compiler
to infer the underlying reference/pointer types.
This commit simplifies the `NetworkData` class by removing the `mType`
Instead we add a new parameter in `SendServerDataNotification()` which
indicates whether to append the Network Data TLV to the message or
not (which was previously determined by `mType`).
This commit simplifies USB connection handling after resetting (hard reset)
RCP device with USB transport.
It drops udev dependency making the new approach generic for USB CDC ACM
across all platform.
It is working also on dockers.
The feature is enabled by new radio Url parameter: 'uart-reset'.
Radio url example:
spinel+hdlc+uart:///dev/serial/by-id/SYMLINK_TO_RCP_DEVICE?uart-reset
It is meant only for connection with RCP devices working with USB
transport and performing hard reset on host reset command.
This commit simplifies `test_platform` module which defines the
platform APIs used by unit tests. It removes the unused global
variables and the function pointer mechanism to override platform
APIs. Instead the platform APIs in `test_platform` are defined as
`OT_TOOL_WEAK` allowing individual tests to override any of the
default implementation with their own version (e.g. `test_timer`
provides its own alarm platform APIs).
This commit updates `platformAlarmGetNext()` in `alarm-sim` in
virtual-time simulation platform to return the remaining duration
to the next alarm as `uint64_t` (in microseconds). This fixes the
issue with potential overflow in calculating the next alarm time.
RFC 6763 Section 6.1 states the following:
An empty TXT record containing zero strings is not allowed [RFC1035].
DNS-SD implementations MUST NOT emit empty TXT records. DNS-SD
clients MUST treat the following as equivalent:
o A TXT record containing a single zero byte.
(i.e., a single empty string.)
o An empty (zero-length) TXT record.
(This is not strictly legal, but should one be received, it should
be interpreted as the same as a single empty string.)
o No TXT record.
(i.e., an NXDOMAIN or no-error-no-answer response.)
This commit reflects the second requirement.
This commit changes `radio_platform.cpp` to use `otError` in the
function definitions (weak/default implementations of) radio
platform APIs. This ensures the definitions are consistent with
their declarations in `radio.h`.
This commit updates `RouterTable` to ensure signalling removal of
neighbor routers when router table is fully cleared or when a
`Router` with a specific released router ID is cleared.
This commit adds support in `HistoryTracker` to record the history of
changes to the neighbor table. An entry is recorded when a child or
router neighbor is added, removed, changed, or being restored (the
restored entries are only used for the previous children list
retrieved from non-volatile settings on the device (re)start). Each
entry provides:
- Timestamp
- Type: Child or Router
- Event: Added, Removed, Changed
- Extended Address
- RLOC16
- MLE Link Mode (rx-on-when-idle, FTD/MDT, full-netdata).
- Average RSS (in dBm) of received frames from the neighbor at
the time the entry was recorded.
This commit also updates CLI and adds `history neighbor` command
to get the neighbor history. It also updates the documentation.
This commit fix addresses few problems:
- Method ScheduleMessageTransmissionTimer at first call after CSL is
enabled calculated interval incorrectly.
- Data Polls after transition from MED to SED were triggered with
incorrect interval.
This commit fixes the test by removing the unnecessary argument
in the call to `srp_client_remove_host()`. Removing the host on
SRP client also removed all previously registered service so
we can remove the call to `client.srp_client_remove_service(...)`.
This commit adds a new parameter `aSendUnregToServer` to SRP client's
`RemoveHostAndServices()` API. This parameter determines the behavior
when the host info is not yet registered with the server. If it is
set to `false` (which is the default/expected value) then the SRP
client will immediately remove the host info and services without
sending an update message to server (no need to update the server if
nothing is yet registered with it). If it is set to `true` then the
SRP client will send an update message to the server. Note that if
the host info is registered then the value of `aSendUnregToServer`
does not matter and the SRP client will always send an update message
to the server requesting removal of all info.
One situation where this parameter can be useful is on a device
reset/reboot where the caller may want to remove any previously
registered services with the server. In this case, caller can
`SetHostName()` and then request `RemoveHostAndServices()` with
`aSendUnregToServer` as `true`.
This commit also adds `test_srp_client_remove_host.py` which
verifies the behavior the newly added mechanism between client and
server.
This commit changes the check for the number of host addresses in
a newly received SRP update message such that if we have a non-zero
lease, we ensure that there is at least one valid address. It also
moves this check from `ProcessHostDescriptionInstruction()` to
after the Lease Option in the Additional Section is parsed (in
`ProcessAdditionalSection()`) so that we check after we determine
the host lease interval and whether the host is being removed or
registered.
This commit enables use of range-based `for` loop for iterating over
all the entries in a `LinkedList`. It adds private implementations of
`Iterator` and `ConstIterator` which inherit from `ItemPtrIterator`
and use the `GetNext()` to go to the next entry. The range-based
`for` loop practically acts as a syntactic sugar helping simplify the
code and does not add any code size (or any expected run-time)
overhead.
We discovered that dns resolve takes a little longer i.e. 15sec to
finish (rather than default timeout of 10s). Thus using a larger
timeout for dns resolve (and other dns commands), e.g. 30s has helped.
Currently, we disable retries on radio/submac of data polls with CSL
IE (I believe to avoid sending outdated CSL IE). To compensate for
this, we use kMaxCslPollRetxAttempts (default 15) instead of
kMaxPollRetxAttempts (default 4), which gives us more possible retx on
mac.
Assuming we get NoAck error, depending on the presence of CSL IE,
there will be:
a) 4 attempts (on mac) with up to 15 retries on radio/submac (if no
CSL IE)
b) 4 attempts on mac (if CSL IE present) because child is considered
detached from parent after 4 data poll transmissions that returned
NoAck error.
So in the end, the increased number of RetxAttempts does not have a
full effect - we start to reattach after 4 retx while having 15 retx
allowed.
This commit adds kFailedCslDataPollTransmissions constant that will be
used instead of kFailedRouterTransmissions in case of data poll with
CSL IE on Child-Parent link.
This commit removes the PACKAGE_VERSION definition from the global
config target so that when the git commit id is changed, only a few
sources will be re-compiled.
MIC is a part of data payload, so if it's present, data payload is not
empty even if the data message is empty (ieee802154-2020 7.2.1 -
General MAC frame format). If so according to Termination IE
inclusion rules (ieee802154-2020 7.4.2.1 Table 7-6) Header Termination
IE2 need to be applied.
This commits adds a new `otNeighborTableEvent` which indicates that a
child's Device Mode is changed (in addition to existing events which
indicate that a child or a router neighbor is being added or
removed).
This commit renames and moves the related types in `Netif` module like
`UnicastAddress`, `MulticastAddress`, etc. under `Netif` class (as a
nested type). It also moves iterator types under the related type
(for example, `ExternalMulticastAddressIteratorBuilder` becomes
`Iterator::Builder` under `ExternalMulticastAddress` class. These
changes help simplify the code (allow us to use shorter names in the
`Netif` implementation).
This commit updates `Mle::SetRloc16()` to skip removing and re-adding
of the `mMeshLocal16` IPv6 address when it does not change.
It also updates how the cached CoAP messages are cleared such that
they are cleared only if the address gets changed.
This commit changes the Makefiles so that the TCPlp module is linked
in to the code when building OpenThread using CMake. This is necessary
when script/build or script/cmake-build is used to build OpenThread.
This commit updates `Mac` under `MULTI_RADIO` config to limit the
radio links used when sending a MAC Beacon frame (which uses
broadcast destination and therefore by default would be sent on all
radios) to the same radio links from which the triggering Beacon
Request frame(s) were received. This ensures that when a multi-radio
node scans another multi-radio node we get one Beacon response on
each radio link.
This commit updates the `test_netdata_publisher` to add extra wait
time between adds (where the same on-mesh prefix is published on all
routers). This should help make the test robust and avoid the
situation where publishing the same prefix on all routers all
together could cause the number of entries in the Network Data to
temporarily go above the desired number. This can happen (though not
often) due to the randomness in how/when nodes using `Publisher` add
their entry in the Network Data.
This commit updates `Mle::DiscoverScanner` to check that IPv6
interface is enabled from `Discover()` (returns `kErrorInvalidState`
if netif is not up).
This commit adds History Tracker feature and its CLI support. This
feature records history of different events as the Thread network
operates (e.g., history of RX and TX IPv6 messages or network info
changes).
Recorded entries are timestamped. When the history list is read, the
timestamps are given as the entry age relative to the time the list
is being read. For example in CLI a timestamp can be shown as
`02:31:50.628 ago` indicating the entry was recorded 2 hours, 31 min,
50 sec, and 628 msec ago. Number of days is added for events that are
older than 24 hours, e.g., `31 days 03:00:23.931 ago`. Timestamps use
millisecond accuracy and are tacked up to 49 days. If an event is
older than 49 days, the entry is still tracked in the list but the
timestamp is shown as old or `more than 49 days ago`.
The `HistoryTracker` currently maintains 3 lists. The Network Info
history tracks changes to Device Role, Mode, RLOC16 and Partition ID.
The RX/TX history list records information about the received/sent
IPv6 messages:
- Message type (UDP, TCP, ICMP6 (and its subtype), etc.)
- Source and destination IPv6 addresses and port numbers
- IPv6 payload length
- The message checksum (for UDP, TCP, or ICMP6).
- Whether or not the link-layer security was used
- Message priority: low, norm, high, net (for control messages)
- Short address (RLOC16) of neighbor who send/received the msg
- Received Signal Strength (in dBm) for RX only
- Radio link info (15.4/TREL) on which msg was sent/received
(useful when `OPENTHREAD_CONFIG_MULTI_RADIO` is enabled)
Config `HISTORY_TRACKER_EXCLUDE_THREAD_CONTROL_MESSAGES` can be used
to configure `HistoryTracker` to exclude Thread Control message
(e.g., MLE, TMF) from TX and RX history.
The number of entries recorded for each history list is configurable
through a set of OpenThread config options, e.g., number of entries
in Network Info history list is specified by OpenThread config option
`OPENTHREAD_CONFIG_HISTORY_TRACKER_NET_INFO_LIST_SIZE`. The
`HistoryTracker` will keep the most recent entries overwriting oldest
ones when the list gets full.
This commit also adds support for `HistoryTracker` in CLI. The CLI
commands provide two style for printing the history information: A
table format (more human-readable) and list style (better suited for
parsing by machine/code). `README_HISTORY.md` is added to document
the commands and the info provided by each history list entry.
This commit also adds `test_history_tracker.py` test-case which
covers the behavior of `HistoryTracker`.
This commit refines system initialization and de-initialization by
separating the process before and after OpenThread instance creation
and destruction:
otSysInit():
Call platformInit()
Create OpenThread Instance as `gInstance`
Call platformSetUp()
otSysDeinit():
Call platformTearDown()
Destroy OpenThread Instance `gInstance`
Call platformDeinit()
This commit should help fix the issue that platform UDP sockets can
not be created when constructing OpenThread instance.
This commit contains other related changes:
- otSysDeinit now destroys the OpenThread instance
- posix/platform code use a global variable gInstance to track the
single global OpenThread instance, instead of using multiple
pointers in multiple files.
This commit adds helper functions to convert a `RoutePreference`
to/from a 2-bit unsigned encoded value. These are used in
`NetworkData` (for on-mesh prefix or external route) and also in
`RoutingManager` and `RouterAdv`. This change ensures that we do not
use bitwise shift of a signed and potentially negative value (`a >> b`
where `a` is negative). Note that the behavior of right bitwise shift
of a negative value is not specified by C++ standard and it is
implementation/toolchain dependent.
Per RFC 4862 section 5.5.3, the SLAAC address of a on-link prefix
will not immediately be invalidated even if the on-link prefix is
sent with zero PIO valid lifetime but we currently removes the
external route for the on-link prefix when we see zero valid lifetime.
This results in an error case that a Thread device can not reach
a valid SLAAC address of a Wi-Fi host on the same infra link because
there is no routes for this address.
This commit fixes this issue by delay removing the external route
for the discovered on-link prefix untill its valid lifetime expires.
Meanwhile, the Border Router now considers a deprecated (zero preferred
lifetime) on-link prefix not usable. Thus, the Border Router will
start advertising its own on-link prefix when current on-link prefix
is deprecated.
There is a potential bug in
DuaManager::ProcessDuaResponse(Coap::Message &aMessage).
The original code finds the Child by Child *child =
Get<ChildTable>().GetChildAtIndex(mChildIndexDuaRegistering);, which
assumes that the DUA.rsp must be targeting the current registering
Child. This is true for DUA.rsp, but not correct for DUA.ntf because
BBR may send DUA.ntf at any time to any device.
So, this commit changes DuaManager::ProcessDuaResponse code to search
for the correct Child with the target DUA instead of using
mChildIndexDuaRegistering.
This commit also contains other refactoring on
mChildIndexDuaRegistering usage.
This commit implements a new feature "Network Data Publisher" which
provides mechanisms to limit the number of similar entries (service
and/or prefix) in the Thread Network Data by monitoring the Network
Data and managing if or when to add or remove entries. This feature is
enabled using `OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE` config, or
`NETDATA_PUBLISHER` in autoconf, or `OT_NETDATA_PUBLISHER` cmake
option.
This commit adds support for publishing DNS/SRP anycast/unicast
service, on-mesh prefix, and external route prefix entries.
When there is a request to publish an entry, the `Publisher` monitors
the Network Data and counts the number of similar entries. If there
are fewer entries than a desired target number, the entry is added
after a short random delay.
If there are too many similar entries, `Publisher` starts the process
of removing its own entry (again after some random wait time). When
removing entries, certain entries are preferred over others (e.g., an
entry from a router over one from an end-device or if they are from
the same type of node, the one with smaller RLOC16). If `Publisher`
determines that its own entry is a preferred one, it adds an extra
wait time before removing its entry. This gives higher chance for a
non-preferred entry from another device to be removed before removing
a preferred entry which helps towards quicker convergence of the
process to the desired number of entries.
On-mesh prefix and external route entries have a "preference" field.
When publishing such an entry, a matching entry in the network data is
counted only if its preference is same or higher than the entry's
preference. This ensures that a device with a higher preference entry
publishes its entry even when there are many lower preference similar
entries in the network data (potentially causing a lower preference
entry to be removed).
This commit also adds `test_netdata_publisher.py` to verify the
behavior of the `Publisher`.
This commit replaces the `enum` constants with `constexpr` definitions
in all the modules under `core/utils`. This commit also contains
some smaller changes: typo fixes in the comments, removal of unused
constants, and adding `uint` type to the named `enum` definitions.
This commit replaces the `enum` constants with `constexpr` definitions
in all the modules under `core/meshcop`. This commit also contains
some smaller changes: removal of unused constants, and adding `uint`
type to the named `enum` definitions.
The compile-time log level definition is the lowest log level
that can be set by `otLoggingSetLevel`. This is useful for
dumping more logs for testing.
This commit adds two new helper methods in `MessageQueue` and
`PriorityQueue` which provide functionality that is commonly used in
other modules: `DequeueAndFree()` which dequeues and frees a message
from the queue), and `DequeueAndFreeAll()` which removes and frees
all messages in the queue).
When a platform provides `OT_RADIO_CAPS_TRANSMIT_SEC` capability,
it updates the frame header with the dynamic data (frame counter,
key id...) and returns it back to MAC together with the transmission
result.
So far the `mIsARetx` flag was being used to instruct the radio
whether to update the header or not, but there was no mean to know
if the radio was able to do so.
This commit introduces the `mIsHeaderUpdated` flag which is used in
both directions, so the MAC layer can react to cases in which the
frame header was not properly updated by the radio platform.
The usage of mIsARetx remains restricted now to two cases:
- When a SSED decides to re-synchronize CSL parameters after a
retransmission.
- To check if sequence number was set for CSL/indirect retransmissions.
This commit includes a test case to verify that multiple border
routers can publish their meshcop services successfully without
instance name conflicts.
This commit changes MLE module such that during an attach attempt in
the third phase where we send MLE Announce on all channels we wait
till the end of the phase (i.e., after MLE Announce tx on all
channels and transition from `kAttachStateAnnounce`) to process any
received "Parent Response" and try to attach to a parent. This
ensures that we wait long enough to receive "Parent Response" from
all potential parents during this phase. Note that at the start this
phase we send an extra "Parent Request to routers/REEDs" to have
another chance to find a parent.
This commit simplifies the logging macros by removing the input
string parameter `aRegionPrefix` in the call to the underlying log
function and instead converts the `aLogRegion` to the proper string
from the private `Log()` function. The removal of the additional
argument in the call to the logging functions helps reduce the
overall code size. This is applicable to the default and commonly
used configuration where logging uses functions. In the case where
logging is fully implemented as macros the `aRegionPrefix` is still
needed and used.
This commit adds a new config in `Srp::Client` which specifies whether
the SRP client is allowed to switch server (when auto-start feature
is enabled) on timeouts when host or service info were previously
successfully registered with the currently selected server. Note that
independent of this config, auto-start will always switch and select
a new server when the entry in the Network Data corresponding to the
currently selected server gets removed.
When a new service with subtypes is added to an existing
host, the SRP server incorrectly merges the subtype service
copies so that the TXT information is lost, i.e. 0-length
TXT record is created.
Moreover, the OT DNS client cannot parse services with
0-length TXT record (instead of ignoring the TXT record
itself) causing that such a service cannot be examined
at all.
The problem is caused by incorrect merging of the service
description structure which is shared across all services
with the same instance name (i.e. among the base type
service and its subtypes).
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
This commit replaces the `enum` constants with `constexpr` definitions
in all the modules under `core/thread`. This commit also contains
some smaller changes: typo fixes in the comments, removal of unused
constants, and adding `uint` type to the named `enum`s.
This commit introduces two changes. First is adding capability to turn
off CSL, by implementing missing 0 value handling.
Secondly adds proper transition between SSED (CSL on) and MED states
(CSL off).
This commit aims to update the meshcop service instance name in
test_publish_meshcop_service.py to make it consistent with the change
on ot-br-posix side.
This commit fixes methods `SendLinkMetricsManagementResponse()`,
`SendLinkMetricsManagementRequest()` and `SendLinkProbe()` in `Mle`
to ensure that the allocated MLE message is freed on an error. Note
that on success the `Mle::SendMessage()` will take the ownership of
the allocated `Message`.
This allows for registering a callback on all lines read from a
device, making it possible to react to output from asynchronous cli
commands while concurrently executing new commands on the same
device. Normally, executing those new commands would result in the
async command output being lost.
Known caveats:
1. The same limitations as with wait apply to OtbrSshCommandRunner
(you can't get async output).
2. For OtCliCommandRunner, any commands sent to the device in the
callback need to be offloaded to another thread. Otherwise the read
routine thread will be blocked, and the command will timeout.
This commit fixes reporting expect failures by adding fail on error
flag to the ot_exec_expect_script function in script/test script.
This commit also fixes failing expect tests and removes expect tests
on macOS for unstable issues.
This commit fixes an issue in `CoapSecure::Stop()` accessing an
already dequeued and freed `Message` instance (from the `for` loop
iteration trying to `GetNext()` message). The code in this commit
removes the head element one by one (`MessageQueue::GetHead()`)
until the queue becomes empty.
This commit fixes a bug in `RemoveDataResponseMessages()` where
`GetNext()` method may be called on an already dequeued and freed
`Message` instance (within the `for` loop iteration). The change in
this commit ensures to get and retain the `next` message before
potentially removing the message from the `mSendQueue` and freeing
it.
This commit adds template `Find/ContainsMatching<Indicator>()` methods
which search in the array to find the first element matching a given
indicator. Unit test `test_array` is also updated to check the
behavior of newly added methods.
This commit enhances the template `Array` class implementation to
allow the `uint` type used for array size (which is also used for
length and index) to be specified as a template type parameter. If
not explicitly specified, a default `uint` type is selected based on
the array size `kMaxSize`, i.e., if `kMaxSize <= 255` then `uint8_t`
will be used, otherwise `uint16_t` will be used.
This commit replaces the `enum` constants with `constexpr` definitions
in all the modules under `core/net`. This commit also contains some
smaller changes: typo fixes in the comments, removal of unused
constants, and adding `uint` type to the named `enum` definitions.
When compiling OpenThread public header files independently, the
compiller generates errors, such as `unknown type name "size_t"`
and 'unknown type name "otLogLevel"'.
This commit adds the corresponding header files to the public
headers to resolve this issue.
This commit adds a generic `Array<Type, kMaxSize>` class which
represents a fixed size array of elements of template `Type` which
tracks its current length. Entries can be appended to the array
(`PushBack()`) and removed from the end of array (`PopBack()`). This
simple data model is used in some other modules, so having a generic
version can help simplify the code. This commit also adds a unit test
to verify `Array` methods.
This commit replaces the `enum` constants with `constexpr` definitions
in all the modules under `core/common`. It also adds type to the
names `enum` definitions.
This commit contains style changes, simplifications, and renames in
Link Metrics modules. It moves all the definitions under a new
namespace `LinkMetrics` which allows the use of shorter and simpler
names for types, methods, and constants (omit the `LinkMetrics`
prefix from names). For example, `LinkMetricsTypeIdFlags` and
`LinkMetricsSeriesInfo` are renamed to simpler `TypeIdFlags` and
`SeriesInfo` respectively.
This commit replaces the `enum` constants with `constexpr` definitions
in all the modules under `core/mac`. The `constexpr` constants have
the advantage that they are explicitly typed while still being
compile-time constants with no code size overhead.
This commit also contains some smaller changes: typo fixes in the
comments, removal of unused constants, and adding type to the named
`enum` definitions.
The OpenThread instance has already been deinitialized before the
platform MulticastRoutingManager is deinitialized. We can never
reference to mInstance in Deinit.
This commit adds empty implementations of `otPlatInfraIf` platform
APIs under simulation. It also adds `otPlatInfraIfHasAddress()` in
`test_platform`. This allows the unit tests and simulation platform
builds to succeed when `OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE` is
enabled.
This commit fixes a bug in `RadioSpinel` platform implementation where
the request from OT core stack to enter RX mode may be ignored
causing the RCP/radio to stay in RX mode on an incorrect channel.
This situation can happen after a frame TX request on a different
channel (note that the `otRadioFrame` struct specifies the channel on
which the frame should be transmitted). After frame TX, radio driver
is expected to enter RX mode on the same channel on which the frame
TX happened. The OpenThread MAC layer always explicitly instructs the
radio to enter RX mode on the PAN channel (from `Mac::UpdateIdleMode()`
which in turn calls the radio platform API `otPlatRadioRecive()` with
the channel passed in as a parameter). The earlier `RadioSpinel`
platform implementation did not update `mChannel` on a tx request
which caused the subsequent `Receive()` to skip setting the channel on
RCP if the channel was same as before.
Dump the RA messages sent/received on infra if for testing scripts.
This commit removes the requirement of OT_REFERENCE_DEVICE but always
dump the RA messages at log level DEBG.
In the issue, compiler complained we were copying 16 bytes to a
location of 12 bytes. This was because in the check, the compiler
thought we are going to copy data to a nlmsghdr which is 12 bytes. The
reality is that we're copying data to a place behind nlmsghdr in req
struct.
This commit relaxes BBR dataset matching to only compare the first
byte of Service Data (i.e. 0x01).
This commit also requires all Service TLV searching methods to
explicitly specify aExactServiceDataMatch argument, helping to reduce
unconscious mistakes.
This commit adds `OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_ENABLE`
option which configures the CLI module to log its input command
string and the resulting output. This is done in addition to emitting
the output string to the console. By default this config is enabled
on all POSIX based platforms and when `LOG_OUTPUT` is not set to use
CLI console itself.
OpenThread uses the compile option
-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=openthread-core-posix-config.h
to specify the OpenThread configuration file. Some build systems do
not support this usage.
This commit includes the default user implemented configuration header
file to avoid specifying the configuration file.
This commits updates `thread-cert/Makefile.am` adding some existing
tests that were not included in the Makefile when the tests were
added. It also sorts the entries to be in alphabetical order.
This commit also updates the access control mode for all script files
to be executable by all (`chmod 755` or "-rwxr-xr-x").
This commit updates the logging in `netif` module under posix platform
code. It adds a prefix `[netif]` to the log line to help distinguish
the logs from this module from other platform layer logs.
It also removes some of the extra logs (e.g., logging `processTx: OK`
or `processRx: OK` on every rx and tx) and only logs failures
(at warning log level).
This commit updates the logs in `RoutingManager` so that the log
messages start with capital letter (making them consistent with
logs in other modules).
This commit adds a new static method `Timer::RemoveAll()` which
removes all running timers from the `Scheduler`. This method is only
intended for use by by `test_timer` unit test, allowing it to remove
any timers that may be started from constructors of different objects
in an OT instance before starting the unit test. With this change, we
can have timers started from constructors.
To ensure that the `RemoveAll()` is only used by the unit test, it is
defined as a `protected` method which can still be used in the test
which defines and uses `TestTimer` as a sub-class of `Timer`.
This commit refactors and simplifies the `Timer` module, mainly
declaring the corresponding `Scheduler` as a nested type of `Timer`,
`TimerMilli` or `TimerMicro` classes. It also changes the `Scheduler`
methods to be `protected` or `private` limiting access to them.
This commit fixes a couple issues with sending MGMT_SET.req to udpate
the leader with a new operational datset.
- When handling an MLE Child ID Response message,
DatasetManager::Save() is called before the role is updated to
child. As a result, a device with a newer dataset prior to attaching
the network will not send a MGMT_SET.req message. This commit adds a
delay to allow the role to change to child.
- When receiving a MGMT_SET.rsp, the device will immediately check if
it should send a MGMT_SET.req message again. However, the
operational dataset may not have had a chance to propagate from the
leader. This commit adds additional delay to allow the new
operational dataset to propagate.
This commit allows a zero-len prefix `::/0` to be added as an external
route in Network Data. Such a prefix can act as a default route. This
commit also adds `test_zero_len_external_route.py` testcase to verify
the network's behavior using a zero-len external route.
This commit adds a new feature in DNS client to automatically set and
update the server's IPv6 address in the default config. This is done
only when user does not explicitly set or specify the server address.
This behavior requires SRP client and its auto-start feature to be
enabled. SRP client will then monitor the Thread Network Data for
DNS/SRP Service entries to select an SRP server. The selected SRP
server address is also set as the DNS server address in the default
config.
This commit also adds `test_dns_client_config_auto_start.py` which
verifies the behavior of the new feature. In particular, that the DNS
client's default config gets changed and mirrors the SRP client
selected server address (when not set by user) and that it remains
unchanged if user explicitly sets the address in the default config.
This commit updates `AddressResponse::GetNat64Prefix()` to search in
Network Data to find NAT64 prefixes added by BRs. Prefixes with
higher preference are selected first.
Verified that this commit fixes the infinite DUA.req loop.
This is a quick fix. We still need to reactor
mChildIndexDuaRegistering because there are still potential issues.
The default Thread version has been set to 1.2 when building. Our test
script which checks building hasn't been updated accordingly. This
commit fixes this error.
We should remove the UpdateMetadata before committing the SRP update
to ensure that the same UpdateMetadata (and the Host object) can never
be touched again.
This commit updates `Dns::ServiceDiscovery::Server` to add support for
browsing a service subtype. In particular, it updates the code which
breaks a DNS name into its components such that it can correctly
parse and accept a service subtype name. It also updates how the
service name compression is done to handle the subtype names.
This commit also updates `Dns::Client` to remove the extra check of
service name (which is already verified) when trying to find a PTR
record for a given service instance name. This change enables browse
for service subtype (parsing the browse response).
This commit also updates and enhances the `test_dnssd.py` script
adding test-cases for browsing for service subtype.
This commit adds support for service subtypes in SRP server. It
updates the internal data model to store services in `Srp::Server`.
Every `Host` now has a list of `Service` entries along with a list of
`Service::Description` entries. These types mirror the SRP update
message format and the set of instructions that form the SRP message.
The `Service` entries represent the "Service Discovery Instructions",
i.e., the PTR records mapping a service name or a subtype name to a
service instance. A `Service::Description` entry represents the the
SRV and TXT records. A `Service` entry is always associated with a
`Service::Description` and the subtypes of the same service instance
all share the same `Service::Description` entry.
This commit also adds a new method `Host::FindNextService()` and the
public API `otSrpServerHostFindNextService()` which is very flexible
and can be used in different ways. It can be used to iterate over the
full list of services, or over a specific subset of services matching
certain conditions, e.g., iterate over all base services excluding
subtypes, or over all subtypes of an instance, or over all deleted
services, etc. It can also be used to find a specific service with a
given instance and service names.
This commit also simplifies and enhances the logging in `Srp::Server`.
In particular, when a new host is added, we now also log the list of
services being added along with it. Also a change to a `Service` is
only logged if the `Service` is marked as committed. This ensures
that temporary `Service` entries associated with a newly received SRP
update message are not logged (e.g., when an associated temporary
`Host` object is being freed after its content is merged with an
existing `Host` entry).
Finally, this commit adds a test `test_srp_sub_type.py` to cover the
subtype service registration on SRP client and server.
This commit adds support for service subtype in `Srp::Client`. The
`otSrpClientService` now includes a pointer to an array of service
subtype labels (which can be set to `NULL` if there is no subtype).
Each subtype is appended as a PTR record (i.e., a Service Discovery
Instruction) in the SRP update message.
This commit also updates The `Utils::SrpClientBuffers` to provide an
array for the subtype labels (pointers). The default size of the
service name buffer is also incremented so that it can be used for
saving subtype label strings.
The CLI `srp client` implementation is also updated to support service
subtypes where the `<servicename>` can optionally include a list of
subtype labels separated by comma (e.g., `_ser._udp,_s1,_s2`).
This commit removes the API to enqueue an out of band frame for
transmission by MAC layer. This API was added as a work-around to
enable legacy (non-Thread based) frames to be sent along with Thread
frames. This model is no longer used and generally not recommended.
The preferred way to handle multi-radio/multi-protocol is to add
support for it in radio platform layer.
In wait, match_line is called with the arguments flipped. The first
argument is supposed to the be the line being checked, and the second
is supposed to be the pattern to match. The reason this still works
for strings is because output is treated as a list of lines to expect,
and each is just compared with == to the actual expected line
This commit changes `ParseCmd()` such that as `aArgs` array entries
are populated with parsed arguments from a command line string, the
remaining unused `aArgs` entries in the array are marked as "empty".
We also ensure that the `aArgs[]` array always end with an "empty"
`Arg` which indicates end of the list (this is similar to how C
string ends with a null '\0' character). This commit also changes
different methods of `Arg` class (`Arg::ParseAs{Type}()` or overload
of operator `==`, etc) to check and handle when `Arg` is marked
as "empty".
These changes help simplify how the arguments are processed in CLI
modules. In `Cli::Process{Command}()` methods we can just pass the
`aArgs[]` array and do not need to pass a separate args length
parameter. In many cases the args length checks can be removed since
it will be checked from `ParseAs{Type}()` call.
This commit updates `VerifyOrQuit()` and `SuccessOrQuit()` macros to
include the failed condition in the error message that is printed on
a failure (in addition to function name and line number where the
error happened). This commit also changes the second parameter
(`aMessage`) to in these macros to be optional.
This commit also updates unit tests to remove the second `aMessage`
string in cases where the failure can be inferred from the condition
itself.
This commit updates the `simulation/radio.c` and removes the uses of
core internal macro `VerifyOfExit()` and replaces them with
`otEXPECT_ACTION()`. This ensures that radio platform layer does not
include the internal OT header like "common/code_utils.hpp".
This commit implements the boilerplate code for implementing the TCP
API in #6491. It creates a TCP class in src/core/net, and implements
the functions needed to transfer control there when a TCP API function
is called.
This commit updates `Srp::Server` to clear `mHasRegisteredAnyService`
when server is stopped and all the hosts and services are deleted.
This boolean flag is used to save the port number in non-volatile
settings so that we can ensure to pick a different port number the
next time the server starts.
This change addresses an issue where the port number may not be saved
and therefore not changed if the server is stopped and restarted
two times in a row.
This commit updates `test_srp_server_reboot_port` to restart the SRP
sever instead of performing a full device reset. The SRP restart will
trigger the port number change by the server which is the behavior
this test is intended to verify. This change should help address
intermittent failures on this test.
This commit splits OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE macro
into two subsequent ones:
- OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
- OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
This commit adds new feature in SRP client to switch server on failure
(when auto-start feature is used). When enabled, the client will try
to select the next server from entries in Thread Network Data when
the current server rejects an SRP update or there are timeouts
(no response) after multiple attempts.
This commit contains misc enhancements to OTCI:
- Allow connecting to OTBR without password
- Allow not using sudo for ot-ctl commands
- Use -- to separate OT-CLI commands.
This addresses `clang-tidy` warning for unused `using` statement. This
commit also ensures `OT_DNSSD_SERVER` is enabled in `make-pretty`
script and therefore covered by github action `build pretty`
workflow.
This commit ensures that in `Srp::Server::CommitSrpUpdate()` the
`aHost` parameter is correctly freed in case of an error and an early
jump to exit (e.g., from `SuccessOrExit(aError)` at the start of this
method). The `aHost` is now freed at the `exit` label and a boolean
`shouldFreeHost` tracks whether or not it needs to be freed. The
boolean variable is set to `false` when the ownership of `aHost` is
taken over (e.g., from the call to `AddHost(aHost)`).
This commit changes the `Srp::Server` to take ownership of resources
(e.g., heap allocated buffer for TXT data) when updating an existing
`Service` entry (instead of copying the data). With this change, the
method `Service::SetTxtData()` is no longer needed and is removed.
This commit enhances `CmdLineParser` methods that parse a hex string
adding a new version which allows a (longer) hex string to be parsed
in short segments sequentially. The unit test `test_cmd_line_parser`
is also updated to verify the behavior of the newly added method.
This commit also updates CLI `UdpExample` implementation to use the
new method for parsing message payload data from input hex string and
simplifies how `ProcessSend()` parses different arguments indicating
message payload options.
This commit adds a new flavor of function `StringFind()` which finds
the first occurrence of a given sub-string within a string. It also
adds `StringEndsWith()` function that works with a sub-string. The
unit test `test_string` is also updated to cover the new behavior of
the newly added function.
Regarding:
semiWindow = elapsed * (Get<Radio>().GetCslAccuracy() + mCslParentDrift) / 1000000;
Consider that the worst Get<Radio>().GetCslAccuracy() and
mCslParentDrift are both 255, the max of uint32 is 4294967295, so when
elapsed is about 8500000(just 8.5s elapsed since the last CSL sync),
the product of elapsed and (Get<Radio>().GetCslAccuracy() +
mCslParentDrift) will overflow.
This commit changes the type to uint64_t from uint32_t to avoid the
overflow.
This commit adds a new class `HeapString` as heap allocated string.
The buffer to store the string is allocated from heap and is manged
by the `HeapString` class itself, e.g., it may be reused and/or freed
and reallocated when the string is set. The `HeapString` destructor
will always free the allocated buffer.
This commit also adds a unit test `test_heap_string` for the new
class.
Having this value sufficiently large is important to reduce latency
when multiple simultaneous requests come in to a BR for many if not
all the nodes on the network. This could happen when a client
reconnects on Wifi and needs to query and/or update the state for many
nodes at the same time.
MLE Announce messages are sent with link security enabled. This commit
ensures that REEDs always send MLE Announce messages to the broadcast
destination address.
This commit relaxes the condition for invoking the callback from SRP
client allowing it to be invoked when client is stopped.
Note that the user can call SRP client APIs to add or remove services
while it is stopped. A remove request may be processed immediately
(if the service has not yet been registered) and then the callback is
invoked to notify the caller to reclaim the service entry.
This commit enhances THCI for 1.2 Certification:
- OpenThread.py: 1.2 non-BR
- OpenThread_BR.py: 1.2 BR and Host (otbr-agent solution)
This commit should also make THCI work for both TH1.1 and TH1.2.
If OpenThread is part of an OS with it's own IP stack filtering only
control messages is insufficient. Example could be that if application
is using OpenThread API to listen for CoAP messages received messages
are passed also to the IP callback. The message then is delivered to
the OS IP stack and generates error response: "ICMPv6 Destination
Unreachable (Port unreachable)" as the port is not open on the OS
side. OS IP stack is unaware of the OpenThread existence so it can not
be filtered on that level and the shim layer does not receive port, or
protocol information from OT so it can not filter out a frame without
parsing it first. Extended filtering also to ports originating from
OpenThread.
The assertion is verifying the (linux) host SLAAC behavior which is
not guaranteed on different platform and linux
distributions. Moreover, it is required for testing the BR behavior.
This commit updates how the arguments are passed to different CLI
command handles such that the same model is now used by all CLI
modules where all the previously parsed and consumed arguments are
removed and only the remaining un-parsed arguments are passed to the
next handler.
This commit simplifies the handling of request commands (get, post,
put, delete, and observe) in `Cli::Coap` and `Cli:CoapSecure`
classes. It also updates parsing and processing of arguments for
`CoapSecure` request command by removing the optional and actually
unused dest IPv6 address argument. Finally, it removes the use of
OT core headers/types (mainly the `ot:Coap::Message::BlockType`
enumeration) in CLI CoAP modules.
This commit implements a mechanism to let an SRP server listen to a
different UDP port on a reboot.
- When an SRP server starts, it reads the UDP port used in the last
time from Settings. Then the SRP server listens to the next port in
the reserved range.
- When SRP server successfully starts, store its UDP port in Settings.
This commit reverts the change from PR #6639 which added logging
of the CLI output. Note that the CLI output can be generated and
outputted in smaller pieces (not as a whole line) so the model
from PR #6639 would emit each piece as a different log line which
is not desirable.
This commit adds a new public API `otNetworkNameFromString()` to set
an `otNetworkName` instance from a given null terminated C string. The
new API will also validate that the given name string follows UTF-8
encoding and its length is not longer than max network name size.
This commit also simplifies the UTF-8 validation of `NetworkName` by
moving the check from `Mac::SetNetworkName()` to a newly added method
in `Mac::NetworkName` to set it from a C string.
It also defines `DomainName` as a `typedef` of `NetworkName` which
helps simplify its use and remove repeated code.
Finally, it updates the `Cli::Dataset` to use the new public API for
validating `otNetworkName`.
This commit adds a set of helper methods in `Cli` to process simple
commands where we are getting and/or setting a single integral value.
This replaces common pattern in processing of commands where if there
are no arguments, we output the value we retrieve by calling a related
getter OT API, otherwise we parse the argument (to get the proper
`int` value) and call a related setter OT API. For example, for
"channel" command, we use the `otLinkGetChannel()` as the getter and
`otLinkSetChannel()` as setter.
This commit adds a helper method `OutputTableHeader()` that can be
used to print a table header from a given array of column widths and
title strings. This is then used in CLI module for different tables
(child/neighbor/router table, active/energy scan result, etc).
This commit adds public API `otIp6SockAddrToString()` which converts
an IPv6 socket address (`otSockAddr`) to human-readable string. The
CLI modules (e.g. `ProcessNetStat()`) are then updated to use the new
API.
The current implementation will go into an infinite loop when
mEphemeralPort == Tmf::kUdpPort, since rval is never updated in the
loop. This commit fixes this issue.
This commit updates the `Settings` implementation. It adds template
versions of methods `Read<EntryType>()`, `Save<EntryType>()`, and
`Delete<EntryType>()` which make it easier for other modules to use,
while ensuing to share a common underlying implementation for all
entry types.
The settings entry types (e.g., `NetworkInfo`, `ParentInfo`, etc.) are
changed in this commit to provide a constant `kKey` specifying the
associated setting key with the entry. For simple entries, a related
class is added to define the `kKey` constant and the associated value
type (e.g., `OmrPrefix` defines `Ip6::Prefix` as its `ValueType`).
This model makes it easier to add new setting keys and entries in
future.
This commit also simplifies the logging in `Settings`. The entry types
now provide `Log()` method to log their data and a common
`Settings::Log()` method is added which handles all logging (on
success or in case of an error).
Finally, this commit moves the `SettingsDriver` definition to its own
`common/settings_driver.hpp` header file and and ensures that its
methods are defined as inline.
When using platform TCP, `Ip6::HandlePayload()` will be called with
`aIpProto = kProtoTcp` and `aMessageOwnerShip =
kTakeCustody`. `FreeMessage()` will be called with `message =
nullptr`, causing the message to leak. This commit fixes this issue.
This method clears a service from SRP client, immediately removing it
from the list. Unlike `RemoveService()` which sends an update message
to server to remove/unregister the service, this method clears the
service from client list without any interaction with server. On a
successful call to this method, the `Callback` will NOT be called and
service entry can be reclaimed and re-used by the caller immediately.
This method can be used along with a subsequent call to `AddService()`
(potentially reusing the same service entry with the same service and
instance names) to update some of the parameters in an existing
service.
This commit adds `otSrpClientClearService()` as a related public OT
API and support for this in CLI (command `service delete`). It also
adds support for the deleting service in `NcpBase` and spinel.
For multi-layer application, the radio requires from the upper layer
to provide information for security processing like Key Identifier,
in the Auxiliary Security Header according to IEEE802.15.4-2015.
This change matters for handling security processing by radio only.
This commit adds support for a new feature in SRP client which allows
it to save the selected server info (by the auto-start feature) in
non-volatile settings. On SRP client restart (e.g., due to a device
reset) the client will select the same server when searching to
discover and pick one from the Thread Network Data service entries.
Config `OPENTHREAD_CONFIG_SRP_CLIENT_SAVE_SELECTED_SERVER_ENABLE` can
be used to enable/disable this feature.
The server info is saved only after the host info is successfully
registered with the server and if it is selected by auto-start from a
network data SRP *unicast* service entry.
This commit also adds `test_srp_client_save_server_info.py` test-case
which verifies the behavior of the new feature.
We have run the static code analyser on the OpenThread code and some
issues were discovered.
This commit addresses those that were marked as High impact and were not
marked false positive after the inspection.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
This commit changes the `String<kSize>` class to inherit from
`StringWriter` class. It helps simplify their use allowing
`StringWriter` methods to be directly called on an `String` instance
while ensuring the implementation is still shared among all template
variants of `String<kSize>` class. This change also ensures that
`String<kSize>` is always initialized and set to an empty string from
its constructor.
This commit allows the platform implementations to access the name and
the type of the queries, thus reducing the memory overhead of extra
bookkeeping.
This commit modifies the (<=) usage in two ‘if’ conditions as these
operations as written today (with constants), are resulting in the
compile time warnings (and cmake errors) specifically when working
with proprietary radio configurations and setting Channel Min to 0.
Updated the radio header to get rid of OT_RADIO_CHANNEL_PAGE_MAX. Also
adds a compile-time error, if a user sets the proprietary channel page
to a value greater than 31, as it is currently not supported.
The SRP server tries to notify the advertising proxy when a service is
expired. The expired service is firstly removed from the service list
and later added back to the head of the service list if the service
name should be retailed. This will result in deadloop when there are
two or more services on the same host.
This commit fixes this issue by keeping the expired service in the
service list by simply mark the service deleted and pass all services
of the host to the advertising proxy. The advertising proxy will
republish those services that are not expired but this should be fine
since service expiration is not a common case.
Also update the advertising proxy test case to cover multiple
services.
This commit adds new public OpenThread APIs to convert an IPv6 address
or an IPv6 prefix to a human-readable string representation. The
implementation is shared with the `Address/Prefix::ToString()` used by
core modules (through adding a private `ToString(StringWriter &)`
method which can then be used with a `String<kSize>` or a char
buffer).
Summary of changes:
- Enable building OpenThread RCP image on the Raspberry Pi (aarch64)
directly (using Ubuntu)
- Fix problem with not having access to the /opt folder as a user
This commit enhances DUA response handling for ST_DUA_REREGISTER:
- Parent will stop registering DUA for MTD Child until the next Child
Update Request.
- MTD Child will re-register its DUA by Child Update Request or
DUA.req.
This commit contains the following changes:
- It adds `TlvIterator` to help iterate over TLVs of a given type
in a given sequence of TLVs or sub-TLVs of another TLV.
- It adds helper method `PrefixTlv::FindSubTlv<TlvType>()` to
search within the sub-TLVs for a specific one.
- It moves the `static` helper methods which find a TLV (with a
given type) to `NetworkDataTlv` (from `NetworkData`).
This commit allows launching an OpenThread daemon which was built with
backbone-router and border-routing support but disabling them at runtime
by not specifying the `-B` option.
This commit removes dummy implementation of ChildSupervisor and
SupervisionListener. And add macro to ensure that these data members
only exist in ThreadNetif when child supervisor option is enabled. In
particular, ChildSupervisor only exists when child supervisor option
is enabled and it is FTD.
This commit handles the situation when RCP(USB CDC) performs hard
reset. This commit brings an alternative to pseudo reset by handling
the connection with RCP(USB CDC ACM) by reset the socket connection
after the device is reset.
When RCP is connected by USB CDC and we reset it, the RCP device is
numerated in host operating system. So far for RCP(USB CDC) pseudo
reset has been performing meaning only specific parts of firmware were
reset thanks to results the connection hasn't been broken. For hard
resetting RCP(USB CDC) device the host needs to handle the connection
properly.
It uses udev library to check if device enumeration has ended if
libudev-dev package is present in the host system otherwise it waits
few seconds.
It works based on symlink to the RCP device created by udev in
/dev/serial/by-id/ directory.
This commit allows Reference Devices to send UDP messages to TMF port,
which was prohibited by #5911 .
Background: TestHarness sends constructed TMF messages in many TCs to
validate the behavior of nodes on receiving these TMF messages.
Fixes DUA-TC-09
This commit makes the CLI command output consistent under all cases:
- Output Error 6: Parse when the command line is too long (no output
originally).
- Output Error 7: InvalidArgs when the command line has too many
arguments. The original output is Error: too many args (max %d),
which does not strictly follow the Error <code>: <msg> pattern.
- Output Error 13: InvalidState for running non-diag command in
diagnosis mode to follow Error <code>: <msg> pattern.
This commit adds a new header file `networks_data_type.hpp` and its
related `cpp` file which now contain all the Network Data related
types and config definitions (for on-mesh prefix, external route,
service, and server entries) and their implementation (moved from
`network_data.hpp`).
It adds `IsValid()`, `ConvertToTlvFlags()`, and `SetFromTlvFlags()` in
`OnMeshPrefixConfig` and `ExternalRouteConfig` to validate the config
and convert it to/from the corresponding TLV bitmask flags. These
changes help simplify the use of the configs by other classes.
This commit updates `UpdateSnoopedCacheEntry()` to perform the
common checks before adding a snooped entry (e.g., ensuring the
snooped entry source is not an MTD child of the device).
If a device is a REED and waiting the random delay to upgrade to a
router, the device will wait to register its network data, since it
will have to register again after upgrading to a router. However, the
maximum delay for becoming a router is up to 2 minutes, which is a
long time to wait.
This commit limits the delay that a device will wait to register its
network data.
This commit adds new network data service entry definitions to
indicate presence of DNS/SRP servers within the Thread mesh and
provide info about them. Two service TLV formats are added:
`NetworkData::Service::DnsSrpAnycast` indicates that DNS/SRP client on
a device can use the associated anycast address with this service TLV
to reach the DNS/SRP server. The use of anycast address ensures that
the messages are routed to the nearest node which has added such a
service entry in the network data. The service TLV data in this model
contains a one byte sequence number which is used to notify the SRP
clients if they need to re-register with the server(s) (e.g., due
server reset/reboot and/or loss of previous registrations).
`NetworkData::Service::DnsSrpUnicast` directly provides the IPv6
address and port info for a DNS/SRP server which can be included as
part of the service TLV data and/or the server TLV data. Using service
TLV data allows the info about a common infrastructure SRP/DNS server
to be added by multiple BRs. In the case of server TLV, the IPv6
address info can be optionally omitted (i.e. just a port number is
provided) which then causes the associated RLOC/ALOC address of the
node who added the service entry to be used as the server's IPv6
address.
This commit updates the `Srp::Client` to use the new service entries
to discover/select the SRP sever when auto-start mode is enabled. The
client prefers and uses a `DnsSrpAnycast` over `DnsSrpUnicast`
entries. The `Srp::Server` is also updated to publish its info as
`DnsSrpAnycast` entry (using mesh-local address).
This commit also updates the `test_network_data` unit test to cover
the behavior of newly methods which iterate and parse different
service entry formats.
The test case failed because pktverify failed to find an ACK packet
sent to TD. However, TD_RLOC has changed during the test while we were
using the latter RLOC to verify the packet. Therefore it wasn't able
to find the packet.
For this test case, we can verify the existence of that ACK packet
using the source address of its according CON packet.
The exit command should only exit ot-ctl itself in daemon mode. This
commit adds processing exit command in the ot-ctl.
This commit also moves the exit command implementation out from core
as a user command on simulation and posix cli mode.
This commit updates `Srp::Client::AddService()` to reject and return
`kErrorAlready` if the caller tries to add duplicate service entries
(services with matching service and instance names).
This commit updates `MleRouter::HandleChildUpdateRequest()` related to
how a "Child Update Request" message from a child is processed on a
parent. If the child is present in the parent's child table but it is
not yet in valid state, the parent ignores the received "Child Update
Request". This applies to a child being restored due to parent's reset
(child is in `kStateRestored`) or a child which is in the middle of
attach process (e.g., child is in `kStateParentRequest`). If a
matching child entry cannot be found in the parent's child table, the
behavior remains as before (i.e., parent sends a response with an
error Status TLV to notify the child to re-attach).
This change ensures that after a parent reset to restore a child, the
parent node is the one initiating and sending a "Child Update Request"
to the child and then receives a "Child Update Response" from it. Such
an exchange between the parent and the child will then include a
random challenge and response (authenticating the child and providing
replay protection). Also in this exchange the "Child Update Response"
from the child will include the the child's current MAC and MLE frame
counters, therefore ensuring that the parent correctly learns and
tracks the frame counters being used by the child.
List of changes:
- modified Autotools, CMake and Android build systems
- increased heap size as new version requires additional 64B
- replaced deprecated API (mbedtls_ecdsa_sign_det)
- removed workaround with defining mbedtls_ecp_restart_ctx
This commit adds single-band proprietary radio support for
OpenThread. This feature will enable users to configure OpenThread
stack with proprietary radio parameters and use a PHY as defined by
the Platform.
More specifically:
1. Introduced the following platform configuration options:
- OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_SUPPORT
- OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_MIN
- OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_MAX
- OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_MASK
- OPENTHREAD_CONFIG_PLATFORM_RADIO_PROPRIETARY_CHANNEL_PAGE
2. Updated the radio and meshcop tlv implementation to incorporate the
proprietary radio configurations
3. Updated the network diagnostics code to support channel page mask
value up to 32.
This commit fixes an issue with some of the log related methods where
`String` object may be used without being initialized (this was added
from commit b39f5b6dd and PR #6564).
This commit ensures that `String` variable definitions are always
immediately followed by a `StringWriter()` definition which then
initializes the string buffer (sets it as empty).
This commit also updates `test_string` unit test.
The second to the last packet verification statement expects a ping
request sent by Router_1 after BR_2 becomes the PBBR. However, this
statement wrongly matches a ping request sent by Router_1 before BR_2
becomes the PBBR. Added a restriction of the echo identifier to make
sure the packet verification statement doesn't match the previous ping
request.
This commit moves methods of String out of the header file to save code
size.
Since most use cases of String writers ignores errors, this commit
changes the return of writers to the Writer object itself for chained
writes.
This commit adds native commissioner support with the following changes:
* Accept unsecure traffic when Thread is not enabled.
* Accept traffic to border agent service when native commissioner is
allowed.
This commit changes the `MleRouter::HandleChildUpdateRequest()` to
clear the "last rx fragment tag" only if the "Child Update Request" is
from a detached child trying to restore its link with its parent. This
is indicated by the presence of Challenge TLV in the received message.
The "last rx fragment tag" is used for duplicate frame detection when
`MULTI_RADIO` is enabled.
This commit adds a new `Arg` class in `parse_cmdline` which represents
a single argument (wrapper over a C string). The `Arg` class is then
used in CLI modules. This helps simplify the CLI code mainly using
simpler syntax, e.g., using an overload of `==` operator to compare an
argument with a C string, or calling `ParseAs{Type}()` methods
directly on an `Arg` instance.
The commit enhances the Routing Manager to learn RA header and
parameters from RA messages initiated from infra interface. This
addresses the issue that the BR may be using different RA header
against another RA daemon which is working on the same infra interface
(Have BR and another RA daemon working on the same interface is common
for Wi-Fi + Thread routers).
We also changed to accept RS messages initiated from the infra
interface: this is for case that multiple Border Routers run on the
same host (as we are trying to support multiple ot-daemons on the same
host).
This commit updates `toranj/build.sh` script for posix based builds to
generate CLI executable. It also updates the posix platform to provide
log functionality when `LOG_OUTPUT` is set to `LOG_OUTPUT_APP`.
This commit also adds CI build checks for multi-radio and TREL build
configurations under posix platform.
This commit updates `Coap::Message` to check and remove the payload
marker byte which is added at the end of header options in the case
that the message contains no payload. This check is performed in
`Finish()` method which finalizes the message for transmission. Note
that the presence of a marker followed by a zero-length payload is
processed as a message format error by receivers.
This change helps simplify the preparation of CoAP message by other
modules (i.e., they no longer need to check for empty payload to
remove the marker themselves and can rely on common code in
`Coap::Message`).
This commit updates and enhances the `AnnounceSender` feature. When
this feature is enabled, routers and REEDs periodically send MLE
Announcements (on all channels from the channel mask in the current
Active Operational Dataset). This commit updates the implementation to
use `TrickleTimer` such that a device monitors the number of received
Announce messages within a cycle and if the number is above a
redundancy threshold, the device skips sending Announcement in that
cycle itself. This helps limit the number of Announcement tx in cycle
in a dense network. The same mechanism is used by both routers and
REEDs.
This commit includes several small changes:
- Add logs for Border Agent Start and Stop events to help analysis
commissioning issues such as openthread/ot-commissioner#193
(comment).
- Start Border Agent when the native commissioner is stopped.
- Add CLI command ba state to get current Border Agent state.
This commit changes `DuaManager::HandleDuaResponse()` to use a pointer
to `aMessage` and `aMessageInfo` (instead of reference) Note that in
case of a failure, the `Coap` module may invoke the response handler
with `nullptr` for these parameters.
This commit adds APIs to get Link/Realm Local All Thread Nodes
multicast addresses. This commit also adds cli command to get
meshlocal prefix alone for writing tests.
This commit uses the receive timing capability from the radio to
schedule CSL receive operations with a higher precision, allowing for
shorter receive windows.
This commit adds a new flag in `NetworkData::HasRouteEntry` to
indicate that an off-mesh route prefix in the Network Data is also a
NAT64 prefix. It updates the public `otExternalRouteConfig` structure
to include `mNat64` bit flag and adds support for it in the core
modules.
It also updates `test_network_data` unit test to cover the new flag
and also adds some smaller style changes in this test.
This commit updates the CLI modules to add support for the new
flag. It also adds smaller enhancements in CLI related to network
data, adding methods `NetworkData::OutputPreference()` and
`OutputIp6Prefix()` to output common info (shared between on-mesh
prefixes and off-mesh routes), also simplifying how the flags are
mapped to char array string (avoiding extra space char in the output
string).
This commit also updates spinel and NCP code to add support for the
new NAT64 flag.
Since OT_TREL is going to be set to ON in OTBR, this commit makes sure
we test OTBR with TREL off.
Also removed -DOTBR_DNSSD_DISCOVERY_PROXY=ON since it's now ON by
default.
This commit changes border agent service to use ephemeral port by
default. This change makes it easier to support multiple Thread
interfaces on a single host.
This commit removes the need of getting LLA of infra interface but
adds a new platform API otPlatInfraIfHasAddress which matches the
infra interface and a given address.
Background:
The infra interface LLA is used in the Routing Manager for only
testing if RA/RS message is initiated from the infra interface.
This commit adds a new method in `NetworkData` class to find and
iterate over all Service TLVs that start with a given Service Data.
Unlike the existing `FindService()` method which searches for a
Service TLV with an exact match with the given Service Data, this
method performs a relaxed check allowing a matching Service TLV to
contain additional bytes after given data bytes to search for.
This commit also updates `test_network_data` unit test to add new
test to cover the behavior of newly added method.
This commit updates `NetworkData::Iterate()` to check that an entire
TLV (or sub-TLV) is contained within the Network Data (up to its
length) and skips over TLVs that are incomplete. It also updates
`FindTlv()` methods to directly use the stricter check in the
`for()` loop used to iterate over all TLVs.
Currently, if using FindNeighbor(const Ip6::Address &aIp6Address,
Neighbor::StateFilter aFilter) when the aIp6Address is the device's
parent's link local address, it cannot be found. This commit fixes
this issue.
The POSIX NCP app(ot-ncp) is simulating of NCP with an RCP. With the
latest otbr-agent, this is not needed any more. It is only used in CI
tests. This commit removes the app to save maintenance efforts.
Sometimes CSL cannot be sent out at the sample windows following the
ping command and may need to wait for one or more CSL periods. Use the
default ping timeout which covers several CSL periods.
This change tackles both problems resolved and introduced by #6427.
For direct transmissions, if the first frame transmission fails,
e.g. due to a CCA failure then retransmissions will contain an invalid
frame counter. It causes problems especially for long IP packets - the
receiver drops a fragment but the transmitter will flood it with the
next fragments since it is not aware that the other party dropped a
fragment. We have identified that it's a root cause of the problem
reported in #6337.
Previous solution (remove the check if a frame is retransmitted) may
cause problems with indirect transmissions where radio frames are
created from scratch and then their frame counter would be
overridden. That is why the best place for setting frame counter and
key index in otPlatRadioTransmit().
This commit updates documentations in `radio.h` and adds more detail
on expected behavior on assigning of the frame counter (on retx or
first attempt frame) when radio provides `OT_RADIO_CAPS_TRANSMIT_SEC`
capability (i.e., radio platform layer handles the tx security and
frame counter management).
For nRF52 platforms in order to achieve the best CSL accuracy frame
security processing was moved to the nrf_802154_tx_started() radio
driver callback which is called from the interrupt context when frame
transmission is started by the hardware peripheral.
There is a possibility that a requested transmission will be aborted
before nrf_802154_tx_started() is called. The frame can be then
retransmitted and if nrf_802154_tx_started() is called it will skip
setting key index and frame counter (so they will remain unchanged
with a value equal to whatever is present in RAM).
It seems that we should always set these fields. Moreover, security is
processed only once which is controlled by
mTxInfo.mIsSecurityProcessed member so checking for retransmission is
redundant.
This commit adds support for NAT64 address translation (from IPv4 to
IPv6) during address resolution in `Dns::Client`. This feature is
enabled using `OPENTHREAD_CONFIG_DNS_CLIENT_NAT64_ENABLE` config
option. When enabled, the caller can specify in the address query
configuration whether to allow or disallow NAT64 address translation
for a specific query. The default behavior can also be set using the
default DNS client config.
When the NAT64 is allowed, if the response from server does not
provide an IPv6 address for the host name, we first check if the
server has provided IPv4 address information in the response, and if
not, start a new query for the IPv4 address. Once the IPv4 address(es)
of the host name are resolved, they are translated to IPv6 address(es)
and reported to the user in the query callback function.
Per 15.4 spec, transmitter cannot modify frame content in
retransmission which will leads to out-of-date CSL IE being sent to
CSL transmitter. This commit fixes this issue by,
1. Send a follow up data poll with CSL IE to resync the CSL
transmitter.
2. Send periodic data poll with CSL IE to keep SSED's parent in sync.
3. Move PrepareDataRequest to data_poll_sender.
4. Add test cases to cover.
* [nrf528xx] ensure HWFC is triggered when SW buffer is full
* [nrf528xx] use UARTE peripheral for TX path
Co-authored-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
This commit adds a helper method `Cli::ParseEnableOrDisable()` which
checks a given string against two common commands "enable" or
"disable". This method is then used in CLI modules.
We are using the SRP Host pointer for indexing an outstanding SRP
update when the Advertising Proxy result is passed back with
otSrpServerHandleServiceUpdateResult. There are chances that an old,
freed Host object may be matched again with a newly allocated Host
object which coincidentally has the same address with the old Host
object.
This commit solves this issue by using a random generated uint32_t SRP
service update ID for indexing outstanding updates.
This commit updates `toranj/build.sh` script to skip over empty ""
arguments at the start. This addresses an issue introduced in commit
531cb3484 (PR #6421) where the `start.sh` adds an empty arg when
invoking `build.sh` when coverage is not enabled.
This commit adds validation of the on mesh prefixes.
With this change, the domain on mesh prefix can be directly configured
after successful verification.
This commit implements DNS-SD Discovery Proxy.
- Implemented DNS-SD Discovery Proxy functionalities - OT part
- Fixed an memory issue of NameCompressInfo (introduced in #6155 , but
somehow revealed by this commit)
Some implementation details:
- Discovery Proxy subscribes to services/service instances/hosts
through callbacks set by a public OT API. It is up to the platform
mDNS implementation to collect service instance/host information and
notify OT via a public OT API.
- Discovery Proxy can handle DNS browsing of one service or DNS
resolving of one service instance/host. We leave browsing multiple
services or resolving multiple service instances/hosts for future
enhancements if necessary.
I have found that the default channel manager CCA failure rate
threshold is not necessarily ideal, and some experimentation is
required to determine a good threshold depending on network
characteristics and packet size/periodicity.
For example, I have a network that experiences ~40% packet loss, yet
only ever reports a maximum 4% CCA failure rate, well below the
default of 10%.
This commit adds functions to get/set the threshold, the API layer,
CLI hooks, and CLI documentation.
Accept RA initiated from the infra interface so that we can detect the
existence of another RA daemon which is working on the same infra
interface.
Also enhance the test_single_border_router.py test script to make it
more readable.
- Ping command in CLI will print Done in the end, after printing
replies and statistics. The old behavior is, ping command prints
Done before any replies.
- In OTCI, let ping function return statistics.
- Support timeout parameter in ping command.
- Fix a bug that the arguments are not properly passed to ping in
node.py.
- Adjust timeouts in tests.
This commit allows the spinel interface to deal with link metrics.
There are 7 new properties introduced:
- THREAD_LINK_METRICS_QUERY
- THREAD_LINK_METRICS_QUERY_RESULT
- THREAD_LINK_METRICS_PROBE
- THREAD_LINK_METRICS_MGMT_ENH_ACK
- THREAD_LINK_METRICS_MGMT_ENH_ACK_IE
- THREAD_LINK_METRICS_MGMT_FORWARD
- THREAD_LINK_METRICS_MGMT_RESPONSE
This commit harmonizes how the feature config checks are done within
OT core modules. In header `.hpp` files, any related `#if` config
check is done immediately after the `"openthread-core-config.h"` is
included. This way the rest of definitions are skipped over if the
feature is not being used. In `cpp` source files the `#if` check is
done immediately after including the related header file.
This commit adds support for "DNS name compression" mode. By default
the DNS name compression is enabled. When disabled, DNS names are
appended as full and never compressed. This is applicable to
OpenThread's DNS and SRP client/server modules. This is intended for
testing only and available when config option
`OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is enabled.
This commit also add a CLI command for this feature as `dns
compression [enable|disable]` and updates the CLI's `README.md`.
In BMLR test, the commissioner may fail to start because the /c/ps
COAP message failed to reach Leader due to unstable links. This
commit makes sure the links are established before starting the
commissioner.
This commit replaces some enum definition with constexpr since these
enum are used for comparing. The compiler would always give warnings
when comparing enum with other non-enum values. With this change, we
can directly compare the consts with other values. And this commit
replaces UpdateIfLarger with OT_MIN.
This commit changes the string lookup tables used in `spinel.c` to
convert the property/command definitions to string to use the full
enum names in the table.
This makes the names "search/grep"-able which is helpful during
renaming/refactoring or when adding a new property (by searching and
copying code for an existing one).
This commit adds support for "service key record inclusion" mode in
SRP client. When enabled, SRP client will include KEY record in
Service Description Instructions in the SRP update messages that it
sends. KEY record is optional in Service Description Instruction (it
is required and always included in the Host Description Instruction).
The default behavior of SRP client is to not include it. This feature
is intended to override the default behavior for testing only and is
is available under the reference device configuration build (i.e.,
when `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is enabled).
This commit also add a CLI command for this feature as `srp client
service key [enable/disable]` and updates the `README_SRP_CLIENT.md`.
Finally, this commit adds new spinel property for SRP client "service
key record inclusion" mode along with its get/set handlers in NCP
build.
In tests/scripts/thread-cert/node.py, the timeout parameter of ping()
function is in seconds. However, in some test cases they called ping()
with a timeout in milliseconds.
I used the following command to list ping() usages with a specified
timeout: grep -rn "ping.*timeout=" tests/scripts/thread-cert/*
This commit contains a small fix in `Mac::ChannelMask::ToString()`
string output (e.g, return `{ 11-26 }` instead of `{ 11-26}`). This
commit also updates the unit test to follow naming style and verify
the `ToString()` behavior.
This commit adds `AppendTo()` method in `Dns::Name` class. This method
allows appending an already encoded name from one message to another.
This is performed by directly copying labels one by one between the
messages and does not require an intermediate buffer to read and store
the labels or the full name. This commit also updates `test_dns` unit
test to cover the behavior of the newly added method.
Make CSL receive window dependent on the accuracy of the crystals
used for scheduling and on the elapsed time since last synchronization.
CSL Receive window scheduling
=============================
a b c d e f g
| | | | | | |
-------------------------------------------------------------------->
a-b: kCslReceiveTimeAhead
b-c: -mCslParentUncert
c-d: -(mCslParentDrift + otPlatRadioGetCslAccuracy)
d: mCslSampleTime
d-e: kMinCslWindow
e-f: +(mCslParentDrift + otPlatRadioGetCslAccuracy)
f-g: +mCslParentUncert
This commit adds `Message::AppendBytesFromMessage()` which appends
bytes to a message read from another or potentially the same message
at a given offset. The bytes are read and copied directly (chunk by
chunk) without requiring an intermediate buffer. This commit also
updates `test_message` unit test to cover the behavior of the newly
added method (for both cases where the source and the destination
messages are the same or different).
This commit adds a new module `Utils::SrpClientBuffers` which provides
string/data buffers and a pool of service entries for use for SRP
client. OpenThread SRP client implementation requires that the
service, string/data buffers passed as parameters to its API to
persist. This allows flexibility in how the SRP client can be used
(users of API can decide on how to manage the memory). The new module
provides an option to OT API user to use the buffer and service pool
to allocate/free items (e.g., service entries). The new module is
enabled by `OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_ENABLE`. A set of new
configs specifies the number of service entries in the pool, number of
host address entries, and the size of different string buffers (e.g,
size of service instance string, etc).
This commit also updates CLI and NCP implementations to use the new
common service pool for SRP client commands.
This commit adds `Ip6::Address::SetFromTranslatedIp4Address()` method
performing NAT64 address translation from an IPv4 address and a NAT64
prefix to construct a corresponding IPv6 address as specified in RFC
6052. This commit also updates the unit test `test_ip6_address.cpp` to
cover the behavior of the newly added method.
This commit updates the implementation `Ip6::Address::FromString()`
simplifying it and handling more special cases where address starts
or ends with `::`. The unit test `test_ip6_address` is also updated
to cover some new test cases.
This commit contains two small changes in `Dns::Client`: simplifying
the `SendQuery()` call and adding a comment about reason for parsing
the response in a separate method.
This commit adds IPv4 address definitions in OpenThread:
- Adds `Ip4::Address` class.
- Adds methods to convert IPv4 address to/from string.
- Updates the `Ip6::Address::FromString()` to use the IPv4
`FromString()` for the case where the IPv6 address contains
an embedded IPv4 address.
- Renames unit test to `test_ip_address` and updates it to
cover the behavior of newly added IPv4 definitions in addition
to IPv6 related tests.
This commit addresses the header file include loop between
the `link_metrics.hpp` and `topology.hpp` by forward declaring
`Neighbor` in `link_metrics` header. It also removes some of the
unnecessary header includes and contains smaller style fixes.
Calling write multiple times may casing different arguments of a
command line reach to the daemon at different times. This commit
composes arguments into a full command line and sends it at once.
This commit adds `Unequatable<Type>` class which adds an overload of
operator `!=` using an existing `==` overload provided by the `Type`
class. The `Unequatable` should follow CRTP-style inheritance, i.e.,
the `Type` class should publicly inherit from `Unequatable<Type>`.
This provides a solution to avoid repeating the simple implementation
of `operator!=()` overload in different classes.
- OPENTHREAD_CONFIG_NCP_UART_ENABLE is now OPENTHREAD_CONFIG_NCP_HDLC_ENABLE
- Pull in cli_uart.cpp UART API interface for sleepy-demo apps.
- Fix some erroneous ifdefs that affect 1.2 SoC builds and 1.1 builds.
- Add OT_RADIO_CAPS_SLEEP_TO_TX to radio capabilities (fixes#5819).
NAME_WLE was added in CMake 3.14 and isn't available in 3.10, which is
the default requirement for openthread.
This switches imported_libs.cmake to NAME_WL, which is in 3.10.
This commit simplifies and enhances the `TrickleTimer` class. It adds
support for suppression behavior and removes unused `Mode` and unused
end of interval callback. It changes the `Handler` function pointer
to be similar to `Timer` callback.
This commit adds CMake support for the efr32 platforms and Silicon
Labs gecko_sdk_suite. It also adds the option to build the efr32
sleepy-demo apps.
Other changes:
- jlinkrtt: remove NordicSemi specific options/definitions/includes
from default build
- Remove old include dirs that don't exist anymore from efr32 automake
files
This commit removes application library CLI/NCP dependency on platform
layer UART APIs. Instead, application layer provides callbacks sending
CLI/NCP data.
With this change, platforms with native support for formatted output
can simply implement the CLI output callback with something like
`vprintf()`.
In Thread v1.2, we enable
OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE on the RCP, since we
have to modify the MAC-layer packet for outgoing transmissions in some
cases (adding IEs for enhanced ACKs, including CSL sync info etc).
For this purpose, we define otPlatRadioSetMacKey and
otPlatRadioSetMacFrameCounter to store the latest security material
for AES-CCM encryption.
However, the bug was that this info was not being inserted and
transmit security not processed on the outgoing packet, since the
mac_fr expects calls to otMacFrameSetKeyId, otMacFrameSetFrameCounter,
and otMacFrameProcessTransmitAesCcm from the user. Included this
piece of code to fix the Thread v1.2 RCP bug.
Other changes:
1. Moved a few pieces of helper code to better organize various 1.2
sections in radio.c, and fix some compilation errors.
2. Added some more clarifying comments in some places.
3. Re-enabled some CSL code which was commented out by accident.
This commit adds an overload of operator `<` in `Ip6::Prefix` class. A
prefix with shorter length is considered smaller than the one with
longer length. If the prefix lengths are equal, then the prefix bytes
are compared directly to determine the smaller prefix. This commit
then changes `RoutingManager` to use the newly added operator `<`
overload.
Unit test `test_ip6_address.cpp` is updated to cover the behavior of
the new operator.
This commit updates `IndirectSender` to check exit quickly from the
`HandleSentFrameToChild()` callback if the sent frame is an empty
frame. `PrepareFrameForChild()` prepares an empty frame when there is
no indirect message in the send queue for the child. This can happen
in the (not common) situation where the radio platform does not
support the "source address match" feature and always include "frame
pending" flag in acks to data poll frames. The change in this commit
address a potential issue in this situation and ensures that the "send
done" is not incorrectly processed for any newly added indirect
message after preparing the empty frame (which would cause the message
to be assumed sent and removed without actual tx).
For the case when otInstanceReset returns during pseudo reset action
setting here SPINEL_STATUS_RESET_SOFTWARE is useless as line below
the current sNcpInstance is cleared. The new status never gets
a chance to be transmitted to the host.
This commit changes the `RestoreDatasetFromNcp()` to be performed on
single OT instance config and to be skipped when multiple OT instance
config is enabled. This change ensures that the `RadioSpinel` module
can be compiled with `MULTIPLE_INSTANCE_ENABLE` config. Note that the
"restore data set from NCP" mechanism is performed during platform
initialization from `RadioSpinel::Init()` which happens before
any OT instance is allocated or initialized (all platform layer
components/drivers should be initialized before OT instance). So the
"restore dataset from NCP" feature only makes sense under since OT
instance case.
This commit adds a new core header files `common/error.hpp` which
defines `ot::Error` (mirroring `otError`) and `kError{Name}` constants
(mirroring the public `OT_ERROR_{NAME}` definitions). The new (C++
style) definitions are used by core modules. This commit also moves
`otThreadErrorToString()` (from `logging.hpp` to `error.hpp`) and
renames it to `ErrorToString()` which is used as the internal (to
core) function to covert an `Error` to a string.
There is an issue that the SRP host or service are not deregistered by
the Advertising Proxy when the host or service is expired. This is
because we didn't notifies the Advertising Proxy of the host/service
expiration. This commit fixes this issue and adds tests for it.
When using newer versions of mbed TLS, two issues appear when using
`OPENTHREAD_ECDSA`:
- An empty list of configuration hashes is treated as a configuration
error: DTLS fails.
- Identifiers with double underscore are not used anymore: signature
hashes configuration is not included.
This commit addresses both issues.
This commit adds spinel properties for Backbone Router:
- SPINEL_PROP_THREAD_BACKBONE_ROUTER_PRIMARY
- SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_STATE
- SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_CONFIG
- SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_REGISTER
- SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_REGISTRATION_JITTER
Property numbers have been adjusted to match the ones from #6228 and
#6231.
This commit adds `OT_TREL` as a CMake option and 'TREL' as an autoconf
switch option to enable support for TREL radio link for Thread over
Infrastructure feature.
This commit changes the dataset updater implementation to leverage
MeshCoP::DatasetManager, which already provides a mechanism to
communicate Pending Dataset updates with the Leader. The
DatasetManager implementation ensures that only one CoAP transaction
is outstanding at a time.
This commit also ensures that any unspecified values are copied from
the Active Dataset.
On systems where OpenThread share mbedtls configuration with HTTPS and
other TLS based protocols. The TLS max content length can be way larger
than OpenThread requires. Add an OpenThread config macro to reduce stack
consumption under such circumstance.
This commit tests if a host is still reachable after leaving and
rejoining the infrastructure network. This makes sure that the routing
manager handles router solicitations.
This commit defines `otMessage` to be an opaque public `struct`. This
change ensures users of OpenThread APIs can only get `otMessage`
instances through OpenThread public APIs and callbacks. It also hides
the `mNext` field which is not intended for use/access by OT API users
(OT users may assume `mNext` is pointing to the next message when the
message is placed in an `otMessageQueue` which is not correct since
`mNext` is used to chain the fixed-size `Buffer` instances of the same
`Message` instance).
This commit adds `otMessageBuffer` in `platform/messagepool.h` which
is then used when the platform is configured to manage the buffer pool.
The `otMessageBuffer` struct defines `mNext` to ensure the returned
`otMessageBuffer` instances from platform layer are aligned correctly
in memory (i.e., they can be safely cast to `ot::Buffer`).
This commit adds the checking of the OT config options directly in the
header files of the related module, e.g., the check for DUA feature
being used along with Thread 1.2 is now done in `dua_manager.hpp`. The
`openthread-core-config-check.h` is now used to track the list of
removed, renamed, or replaced configs. This change makes it easier to
find and maintain the dependency/relationship between OT configs
(easier to find them in the related header file than within the list
in `openthread-core-config-check.h`).
This commit adds `update-makefiles.py` script which helps update
different make/build files supported by OpenThread project including
`CMakeList.txt`, `BUILD.gn`, `Android.mk`, `Andriod.bp`, and
`Makefile.am` based on the source (`cpp`, `hpp`, and `h`) files in
`./src/core` and `./include/openthread` folders. This script is
intended to make it easier for developer when adding/removing/renaming
source files within OT core to help update all the make/build files.
This commit also updates `Makefile.am` ensuring the list are sorted
alphabetically (this is generated by running the script).
This commit renames *Advertising* to *ServiceUpdate* to keep
consistent with public APIs. For example, change
HandleAdvertisingResult to HandleServiceUpdateResult.
This commit adds a helper method `RemoveMessageIfNoPendingTx()` in
`MeshForwarder` which removes (dequeues from `mSendQueue` and frees
it) if there is no pending direct or indirect transmission.
This commit also changes `UpdateSendMessage()` to exit early when
there are remaining fragments of the message to be sent.
This commit fixes an issue with removal of supervision message
for child when another message is queued for the same child.
This fixes an issue added by PR#5638 (which itself addresses
an issue that if the supervision message was removed while MAC
was busy sending the message, the MAC layer would not be
notified of the removal).
In #6154, the radio.c changes included the removal of a lot of code
wrapped in #if RADIO_CONFIG_915MHZ_OQPSK_SUPPORT macros. The problem
is there was still one section of code which was not removed.
This caused the 2.4GHz sBandConfig to be overwritten with sub-GHz
config, ultimately causing the efr32mg12 BRD4170A to assert somewhere
in radio initialization.
This commit reverts the removal of support for multiple
efr32BandConfigs.
This commit changes `ToString()` methods in MLE module which convert
from a given `enum` value to a string to use string array tables. It
also adds `statci_assert` checks to verify the values of `enum`
maps correctly to the array indexes.
The ECDSA signing of the SRP client requires additional internal heap.
This commit enlarges the internal heap size to 4000 bytes. The last value
I tried but failed is 3800.
This commit includes below changes:
- handles dynamic infrastructure interface status changes. The Routing
Manager will be started if the infra interface status turns to be
RUNNING and a valid link-local address is present. Otherwise, the
Routing Manager will be stopped.
- changes the default status of the Routing Manager from enabled to
disabled and it is initially enabled for the posix platform.
- the posix implementation now doesn't require the presence of the
link-local address at initialization stage. In this case, the
Routing Manager will not be started before a link-local address is
added to the infra interface.
- add CI tests for the new behavior.
This commit adds a new behavior related to MLE attach backoff feature.
It adds a configurable delay wait interval before resetting the attach
backoff interval to its minimum value upon a successful attach.
`OPENTHREAD_CONFIG_MLE_ATTACH_BACKOFF_DELAY_TO_RESET_BACKOFF_INTERVAL`
specifies the delay interval.
If it is set to zero then the device resets its backoff attach
interval immediately after a successful attach. With a non-zero value,
if after a successful attach, the device happens to detach within the
delay interval, the reattach process resumes with the previous backoff
interval (as if the attach did not happen).
This behavior is helpful in the situation where a battery-powered
device has poor link quality to its parent and therefore attaches and
detaches frequently from its parent. Using a non-zero wait interval
ensures that the attach backoff does not reset on each attach and that
the device does not drain its battery quickly trying to re-attach too
frequently.
This commit refactors the code to set frame version, IE present field
in frame control field and to append Header IE.
- Split UpdateFrameControlField into two methods: CalcIePresent and
CalcFrameVersion. Currently UpdateFrameControlField` is not
easy-to-read and hard to extend the method to handle more cases.
- Move this code from Mac to MeshForwarder. I think it should be
MeshForwarder's responsibility (PrepareDataFrame) to prepare the
frame (though Mac sometimes prepare data frames itself). Since when
preparing the frame, most information comes from the Message which
is only in MeshForwarder, we can put this code for preparing frame
in MeshForwarder.
- Enhance the way to append Header IEs to the frame. Currently in
Mac::AppendHeaderIe, it generates a list of HeaderIe first and then
call Frame::AppendHeaderIe. There are two problems here: 1. it uses
another copy (copy HeaderIe to the frame's buffer). 2. it has to
initialize Vendor IE (e.g. TimeSync IE) after Vendor IE header has
been copied to the buffer. Currently it directly finds the first
Vendor IE in the buffer and initialize it as TimeSync IE, which is
not extensible. This commit shifts the responsibility of 'how to
append the IE' to Frame, by providing AppendHeaderIeAt method. And
MeshForwarder can decide which IEs to append and directly call the
method to append IEs to the frame.
spinel.c provides functions to convert spinel values to printable
strings. These functions are written using huge switch case statements.
This patch replaces these statements with simple loops over arrays
containing the strings.
Thus, the new code takes 3 time less code than the previous. In add, the
value and the string are no more repeated so the new is less error
prone.
Note: I have used the following commands for the conversion:
sed -nre 's/case SPINEL_CMD_(.*):/SPINEL_COMMAND_CSTR(\1),/p' spinel.c
sed -nre 's/case SPINEL_PROP_(.*):/SPINEL_PROP_CSTR(\1),/p' spinel.c
...
This commit sets the DIAG_GET response callback every time the
otThreadSendDiagnosticGet is called. This is because the callback may
be changed to other modules (e,g. OTBR_REST, OTBR_UBUS).
The otPlatSettings api isn't necessarily supported on every platform.
Replace with ot::SettingsDriver which supports both the settings and the
flash platform api.
This commit fixes and simplifies the `OptRecord` implementation. The
OPT RR re-purposes the existing TTL field (which is a `uint32_t`) and
uses it for Extended Response Code (`uint8_t`), Version (`uint8_t`),
and flags. The new implementation treats the `mTtl` as a byte array
and directly reads/writes bytes at different indexes corresponding to
different re-purposed data fields. This ensures that the fields are
encoded correctly independent of the endianness of the platform.
UDP buffer size was increased to 10M so as to avoid potential UDP
packet loss. However the buffer size is too large to run thread-cert
tests on macOS.
This commit reduces the UDP buffer size to 2M.
This commit adds a new public `ot` API for parsing an encoded DNS TXT
record data into `TxtEntry` key/value pairs. It also updates the TXT
data iterator model used for going through all TXT entries. The new
iterator definition provides a small buffer to store the key string.
This helps simplify the definition of `otDnsTxtEntry` to use
null-terminated C string for the key. The new parsing APIs are used in
CLI module.
This commit also fixes an issue with `TxtEntry::AppendEntries()` using
incorrect value for the key length.
Finally, this commit adds a test covering the behavior of all
`TxtEntry` related methods (encoding and parsing TXT data) in the unit
test `test_dns`.
This commit adds a new structure `otDnsQueryConfig` which represents a
DNS query configuration defining a set of parameters:
- The DNS server socket address (IPv6 address and port number).
- Response timeout interval (in msec).
- Maximum number of transmit attempts before reporting failure.
- "Recursion desired" flag (if server can resolve recursively).
There is a default query config used by DNS client. When OpenThread
stack starts, the default DNS query config is determined from a set of
OpenThread config options defined in `config/dns_clinet.h` such as
`OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVER_IP6_ADDRESS`, etc. New
APIs `otDnsClient{Get}/{Set}DefaultConfig()` are added to allow user
to get/set the current default config during operation.
When issuing a browse, address, or service resolution query, the user
can choose not to provide a query config in which case the current
default config will be used. The user can also provide a full or
partially specified `otDnsQueryConfig` instance, e.g., some of some of
the fields may be left unspecified (value zero). The corresponding
value from the current default config is then used for any unspecified
field in the given config.
This commit also updates the CLI to add `dns config` sub-command and
update other `dns` commands to follow the new API model.
This commit adds auto-start SRP client feature. Config option
`OPENTHREAD_CONFIG_SRP_CLIENT_AUTO_START_API_ENABLE` adds support for
this feature in SRP client allowing auto-start mode to be enabled or
disabled. When enabled, the SRP client will monitor the Thread Network
Data for SRP Server Service entries and automatically start and stop
the client when an SRP server is detected. If multiple SRP servers are
found, a random one will be selected. If the selected SRP server is no
longer detected (not longer present in the Thread Network Data), the
SRP client will be stopped and then it may switch to another SRP
server (if available).
This commit also adds support for the new feature in CLI and adds a
new test `test_srp_auto_start_mode.py` covering the behavior of this
feature.
This commit enhances the DNS-SD server to handle multiple questions.
Specifically for DNS service resolving query with SRV+TXT questions,
this commit would reply with SRV+TXT+AAAA RRs, so that the service
instance can be fully resolved with one query.
More implementation details:
- This commit enhances NameCompressInfo so that question names can be
compressed together with RR names.
- Full compression is limited to only one instance / service / host
name.
- For any RR type in the question, this commit will exclude it in
additional RRs. For example, if the query contains a AAAA question,
the response won't include any additional AAAA RR, but will only
have AAAA answer(s). The purpose is to avoid duplicate RRs in answer
section and additional section.
This commit adds new CLI command `multiradio` to get the list of
supported radio types by device and `multiradio neighbor` sub-command
to get the radio info (supported radios and the their preference) for
specific neighbor or for all neighbors.
Qorvo has restructured its third_party/Qorvo/repo submodule.
The linkerscripts for the embedded platforms qpg6095 and qpg6100 have
also been moved to this submodule.
This change:
1. Adds new github action to verify posix app for OT 1.2.
2. Only enable compile flag OT_SIMULATION_VIRTUAL_TIME_UART in
script/test for ot-rcp build target.
3. Allow mix use of posix node and ot-cli-mtd node by changing python
test script to accept node type as parameter.
4. Remove CSL test from expect as it is covered by thread-1-2-posix
tests.
This changes the sleepy-demo-mtd app's startup behavior. Prior to the
change, the MTD would go to sleep immediately. Instead, the MTD will
not sleep until the button is pressed.
The echo command of the host system may have slight variations between
shell built-in echo and the echo command provided by the OS.
Especially the Windows OS echo command is different from practical any
other echo command.
This means that the currently used `COMMAND echo -e "<text>"` does not
work universally.
This commit introduces `etc/cmake/print.cmake` which allow to print a
CMake list where each item is printed on a new line, to get the desired
behavior on the `print-ot-config` target.
Using `cmake -E echo <text>` ensures identical behaviour across
different systems.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit updates the trel simulation platform implementation to
include the src/dst IPv6 addresses and port number (as part of new
simulation-specific packet header) in the exchanged message. It also
verifies the port and dest address (against the expected trel
interface unicast or multicast IPv6 addresses) on the received
message. This helps enhance the simulation platform implementation to
cover the behavior if/when the unicast address used by trel changes.
This commiit implements otPlatUartFlush() for EFR32 with a
configurable timeout, defaulting to 500ms. It also allows multiple
buffers to be sent to the UARTDRV transmit FIFO queue.
This commit re-designs the `Dns::Client` module enhancing the address
resolution implementation and also adding support for DNS-Based
Service Discovery (DNS-SD).
With regards to address resolution query the new model relaxes the
requirements of the public OT APIs such that caller does not need to
persist the query info (e.g., the host name string buffer can be a
temporary variable and does not need to persist during the query) and
it is all managed by the `Dns::Client` core implementation itself. The
new model also supports the case where the response contains multiple
IPv6 addresses providing new APIs to allow the user to iterate through
the list of addresses and retrieve them one by one.
The implementation also handles the case where the DNS query response
contains CNAME record mapping the queried host name to a canonical
name for which a list of addresses are then provided.
The core implementation is also simplified, instead of cloning a query
message and saving it for possible retx, the new code saves the query
related info from which it can re-construct the query message for retx
if/when needed.
This commit also adds support for DNS-SD in `Dns::Client`. The config
`OPENTHREAD_CONFIG_DNS_CLIENT_SERVICE_DISCOVERY_ENABLE` can be used to
disable service discovery feature. The implementation supports
"service instance enumeration" which is referred to as "browsing" and
"service instance resolution". Callbacks are used to notify the user
when a response is received. In the callback a pointer to an opaque
response object is given to the user which can then be used with the
new set of APIs to get more info about the response, such as the list
of discovered service instances or more details about a specific
service instance (e.g., port number, host name and its address) or
iterate through address lists. This provides a flexible and scalable
solution to handle larger lists in the response without adding memory
overhead in the implementation.
Issue:
Information regarding a neighbor's Thread version is lost.
Context:
This problem can be observed during playing with Link Metrics - few
methods check whenever chosen neighbor supports Thread 1.2. This
information is preserved when a child is promoted to the router role,
but after the reset and Link Request - Link Accept sequence it is not
stored in the neighbor table.
This commit updates the wrapper for CSL code, updating most
occurrences !OPENTHREAD_MTD to OPENTHREAD_FTD.
We used !OPENTHREAD_MTD because we think both FTD and RCP need that
code. But that actually means host side of RCP (posix) need that code
and posix host is always FTD. The radio part itself don't need those
code. The radio part doesn't even contain most of those source files
that has CSL logic (except for sub_mac.cpp).
This commit also adds missing initialization for data field in Mac.
This commit updates the EFR32 platform-abstraction layer to work with
GSDK 3.1.1.
- memory.c
- Implemented otPlatCAlloc() and otPlatFree() to handle #6123
- GSDK mbedtls was updated and moved to
util/third_party/crypto/mbedtls
- mbedtls_config_autogen.h was regenerated
- system.c
- NVIC initialization is now done via a simple call to
sl_device_init_nvic()
- alarm.c
- Stubs for 1.2 related platform timing functions in alarm.c
- ieee802154mac.h
- Standardization of 802.15.4 header values and constants
- uart.c
- Reduce the number of vulnerable windows where interrupts disabled
by RAIL will cause dropped characters. The OpenThread task now
polls the UART buffer for arrived data and reads it out. The
USART0 IRQ handler takes care of waking up the task when data has
arrived.
- radio.c
- Implementation of Wi-Fi coexistence and antenna diversity
features, and corresponding updates to run-time phy select
configurations.
- Support for enhanced frame pending and early frame pending for
Thread 1.2 low power features (temporarily disabled until 1.2
support is available)
- Implementation of enhanced ACKs with IEs for CSL.
- Remove FIFO queue that was maintaining unique identifiers
(contents of received packet: PHR+MAC header) This was being used
to tell the upper MAC whether the frame pending bit was set in an
ACK for a received packet. Changed the implementation so we save
the state to a reserved bit in the held packet (in the MAC header)
within the receive completion ISR, and retrieve the value in
processNextRxPacket() to pass to where the upper MAC expects it.
This commit implements the DNS-SD server:
- Handle Standard DNS Query from clients
- Supported resource records: PTR, SRV, TXT, AAAA
- Query services from SRP server
- Add tests
- simulation test using DNS client (only test AAAA query)
- OTBR test using dig command to verify all resource records can be
queried successfully
All the settings are written into a local file on the posix platform.
It is easy for others to get the critical information, such as master
key, from the local file. This commit adds new APIs to allow the
vendor to store the critical settings to a secure area.
This commit includes basic service registration & advertising function
verification. More tests including name conflicts and multiple devices
cases will be in future commits.
We changed the border_routing test scripts directory to border_router
as there will be more tests about Thread border router but not only
the routing feature.
The Instance::HeapCAlloc() method can not be used in constructors when
EXTERNAL_HEAP is enabled but works well when internal heap is
used. This is because the external heap methods are set by public
otHeapSetCAllocFree API after the OT instance is constructed.
This commit fixes this issue by having Instance::HeapCAlloc() using
otPlatCAlloc when EXTERNAL_HEAP is enabled. It also fixes build issues
when MULTIPLE_INSTANCE and EXTERNAL_HEAP are used together.
This commit removes the OwnerLocator class since it's actually
useless.
Timer and Tasklet inherited from OwnerLocator to so that they can use
GetOwner<Type>() to find the owner object. However, these two classes
already inherited from InstanceLocator, thus can use Get<Type>() to
get any component of the OT instance.
This commit adds some new methods/APIs in `Srp::Client` class:
`GetServerAddress()` to get the SRP server's socket address that is
being used by the client, `IsRunning()` to check whether the SRP
client is started and running or not, and `SetCallback()` to allow
user to set the callback at any point (before/after call to
`Start()`). It also adds a new `srp client` sub-command to get the
server address and/or its port number.
This commit adds spinel properties for NCP built with
OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE.
Such NCP will have also a new capability
SPINEL_CAP_THREAD_CSL_RECEIVER.
This commit adds a new module `network_data_service` which includes
the "Thread Network Data Service" entry definitions (e.g., service
number and the associated server data format for each service type).
It also adds `NetworkData::Service::Manager` which manages the Network
Data Service entries and provides helper methods to other core modules
to easily add/remove and/or parse/find info about specific services.
For example, this commit adds a method to get info about the
list of SRP servers (their IPv6 address and port number) from the
"SRP Server Service" entries in the Thread Network Data.
This commit updates `AddServcie()` and `RemoveService()` in
`BackboneRouter::Local` class such that the methods themselves
after adding/removing the service entry in local network data
inform `NetworkData::Notifier` to send the update to leader.
This helps simplify their use.
This commit enables expect tests on macOS, also includes the following
required changes:
* Fixed bound to interface issue on macOS.
* Added ability to configure scan period, because macOS environment on
GitHub Actions is much slower.
This commit changes the order of member variable in `Cli` class
ensuring `mInstance` is initialized before other member variables.
This then allows the `mInstance` to be safely used from the
constructor of other `Cli` sub-types.
This commit updates the trel platform posix implementation to use
linux netlink socket (instead of `ioctl()` command) to add/remove
unicast (link-local) address on the netif used by trel . When netlink
socket is used "Duplicate Address Detection" (DAD) is explicitly
disabled when the address is added. This helps speed up the start time
of OpenThread stack when using TREL.
The `OPENTHREAD_CONFIG_POSIX_TREL_USE_NETLINK_SOCKET` config option
can be used to enable/disable the use of netlink socket by trel
platform layer implementation. By default it is enabled on all
linux-based platforms (determined by `__linux__` macro being
defined).
This commit adds a new template helper method in `ResoureRecord` to
search in a given message starting from a given offset and up to a
maximum given number of records, for the i-th occurrence of a specific
record (of given type with a matching record name). If found, it reads
the record from the message into a given record object.
This commit also updates the unit test `test_dns` to cover the behavior of
newly added helper method.
This commit changes these methods to return corresponding entries from
Thread Network Data rather than local network data.
- get_prefixes
- get_routes
- get_services
Added local version to retrieve entries from local network data.
- get_local_prefixes
- get_local_routes
This commit adds:
- a new method Dns::Name::IsSubDomainOf that matches a DNS name with
given domain. This is useful for SRP and DNS-SD server to verify if a
RR is in our authorized domain.
- domain checks for names in a SRP update to the SRP server.
This commit returns parsed TXT entries for service from the SRP
server, it enables prettier CLI output and easier Advertising Proxy
processing. We moved the otSrpTxtEntry to include/openthread/dns.h
because this structure can ( and will) also be used by DNS-SD
client. We also added one more mKeyLength field in otDnsTxtEntry for
saving length of the TXT key so that we can iterate over the encoded
TXT data without dynamically allocating memory for each entry.
This commit allows `Dns::Name` instances to be created which can be
empty or given as a string (a dot '.' separated sequence of labels) or
from a message at a given offset (i.e., name is already encoded in a
message). `CompareName` and `FindRecord()` helper methods are updated
to allow the new `Dns::Name` type to be used when comparing/ searching
for a name.
This commit adds new spinel definitions for SRP client support
(mirroring the public OT APIs of SRP client) and implements get, set,
add, and remove handlers in `Ncp` for the new spinel properties.
This commit makes sure that UDP servers are accessible via all IPv6
addresses when PLAT_UDP is on.
We still need to pass the messages with ALOC/RLOC destinations to the
tun interface when PLAT_UDP is used. Otherwise, UDP servers can not
receive any message when PLAT_UDP is enabled.
Implemented CoAP/-s block-wise transfer according to RFC 7959. The
implementation includes methods and functions available to the
application layer to add Block1 and Block2 option values to a coap
message and an automatic block-wise transfer enabled by the compile
switch "COAP_BLOCK".
This commits refine the FULL_LOGS option (OT_FULL_LOGS for cmake):
- remove configuration of log regions since they should be 1 by
default
- set PLATFORM log region to ON by default
This commit adds new helper methods in `ResourceRecord` class.
`ParseRecords()` parses and skips over a given number of resource
records in a message. `FindRecord()` searches in a given message to
find the first resource record matching a given record name. And
`ReadRecord<RecordType>()` tries to read a matching resource record
(of a given type) from a message. If the record type does not match
the type, it skips over the record. This commit also adds methods in
`PtrRecord`, `SrvRecord`, `SigRecord` and `TxtRecord` to parse and
read the data fields such as PTR name, host name, signer name and
TXT data.
This commit updates the DNS unit test to add a detailed new test
constructing and parsing a DNS message (covering the behavior of
the newly added and some of the existing methods).
This commit adds new helper methods in `Dns::Name` to parse and
compare a single name label `CompareLabel()` or an entire name
`ComapareName()` from a given message with a given string. Another
flavor of `CompareName()` compares the names read from two different
messages (or same message at different offsets). The name checks are
performed in place (without reading/copying the content from the
messages) and the implementation handles compressed names.
Unit test `test_dns` is updated to verify behavior of newly added
methods.
This commit contains two changes in `Dns::Name` class. When reading or
parsing names/labels from a `Message`, we require that the message
offset (i.e., `aMessage.GetOffset()`) to be set by the caller to point
to the start of the DNS header in the message. This is then used to
decode compressed DNS names. This change helps simplify the code and
removes the need to pass `aHeaderOffset` as a separate parameter. The
second change is to the `ParseName()` implementation which now always
goes through and parses the entire compressed name before returning.
This ensures that we correctly detect invalid compressed names when
parsing the name in a message.
This PR includes the initial implementation of the SRP server
defined in https://tools.ietf.org/html/draft-ietf-dnssd-srp-07.
- SRP server Service TLV propagation: Includes only the 2-bytes
dynamic listening port in the Server TLV.
- SRP request processing (parsing & validation)
- LEASE & KEY-LEASE management
- SIG(0) verification
- Interface for advertising proxy
- CLI commands for testing
- Support removing indivitual SRP service
This commit adds support for SRP (Service Registration Protocol)
client in OpenThread. The implementation allows a user to provide host
info (host name and a list of host IPv6 addresses) along with a list
of services to be registered with an SRP server. Services and/or host
addresses can be added or removed during operation of client.
Users can get the list of services and host info and their current
state (indicating, for example, if service is registered with server,
being registered or being removed, etc). Users can also provide a
callback to get notified whenever there is change or an error.
When there is a new request (e.g., a new service is added/removed)
that requires an update, the SRP client will wait for a short delay
before preparing and sending an SRP update message to server. This
allows user to provide more changes that are then all sent in the same
update message. The implementation handles retries in case of
different errors and failures. An exponentially increasing retry wait
interval (with configurable min, max, and growth factor) is
implemented.
The implementation also manages the lease renew time for each service
and refreshes (re-registers) services with server before lease is
expired. It supports "opportunistic early refresh" mechanism such that
when sending an SRP update, the services that are not yet expired but
are close, are allowed to refresh early and are included in the SRP
update. This helps place more services on the same lease refresh
schedule reducing number of messages sent to the SRP server. This
behavior (whether to allow early refresh or not, and its related
parameters) can be controlled through a set of OT config definitions.
When compiling ot-cli and ot-ncp, the Android.mk will compile
the function `property_get` in `src/core/api/instance_api.cpp`.
The function `property_get` is provided by the library `libcutils`.
GitHub Action uses Android NDK to compile Android.mk, Android NDK
only allows adding the shared library `libcutils` for the library
`ot-core`. However, Android requires to add the shared library
`libutils` for the binary `ot-cli` and `ot-ncp`. Therefore, this PR
uses the macro `ANDROID_NDK` to distinguish these two cases.
This commit includes two small enhancements to the posix infra if
module:
- simplify logging of socket errors since the VerifyOrDie macro
already prints the line number and strerror().
- suppress "drop ICMPv6 message" debug logs when there is no input
data to be read on the socket.
This commit includes the enhancement that
1. Adds non-default external route for on-link prefixes.
2. Add external route for OMR prefixes advertised by BRs in other
Thread Networks.
3. A new API to disable/enable the Border Routing manager at run
time. CLI commands are added for testing.
4. A new platform API to get the link-local address of the infra
interface so that we can filter out the ICMPv6 packets from myself
by the Border Routing Manager rather than the platform
implementation.
This commit allows specifying multiple arguments for script/test cert
path/to/script.py.
This is useful for running a selected test case when the test script
contains multiple test cases.
This commit removes QuestionAaaa class.
Since the format of each question type is exactly same, it seems
unnecessary to define a dozen of QuestionXxx classes for different
resource record types just with different kType.
This commit adds new helper `Compare` methods in `Message` class to
compare the bytes from the message (at a given offset) with a byte
array or bytes from a (template) object or bytes read from another
message.
This commit also updates the message unit test to cover the behavior
of the newly added methods.
Currently when a test fails, the core dump uploading action would be
executed. (Even when there's no core dump, the binaries and so libs
would be uploaded, which is a waste.)
This commit uses env variables of github actions to only execute the
uploading action when crash actually happens.
This commit fixes some typos in the documentation/comments and
renames some of methods getting number of RRs in a DNS header
section (`Get{Section}RecordCount` <- `Get{Section}RecordsCount`).
This commit adds a check in `GetBackboneRouterPrimary()` to verify
that the server sub-TLV data length is larger than a expected minimum
before casting it to `BackboneRouterServerData` and parsing/reading the
info.
Many Iterators have the same pattern in our code: they have ++,
deference, equal operators, IsDone method and hold a pointer to the an
object. This commit extracts the common pattern into a template class
ItemPtrIterator and use it as a base class for those similar Iterator
classes.
This commit fixes the assert check on MPI encoded size. Note that
`mbedtls_mpi_write_binary()` would fill the entire given buffer
(adding zero bytes if the MPI encoded size requires less bytes than
the given buffer size).
When obtaining entropy data, trng_get_random checks the status for any
noise, and if so, cleans its queues and keeps the entropy accumulator
of mbedtls running.
In the process, TRNG might not have any new samples available, so a
zero length output is valid, and we should keep running rather than
exit fatally.
Expect sometimes matches the pattern before a line is fully printed to
TTY. As a result, the address returned may not be accurate. This commit
fixes this issue by matching line breaks.
This commit adds new option to skip RCP API version and capability
compatibility check during initialization. The radio URL key
`skip-rcp-compatibility-check` can be used to enable this behavior.
This is only intended for situations where RCP won't be operating as a
radio (e.g., host trying to perform an RCP firmware update).
This commit enables unused-parameter warning for NRF driver code
except for soft-device.
Currently this warning is disabled for all NRF driver code, which
makes OT_UNUSED_VARIABLE in driver code useless. We only need to
suppress the warning for soft-device code because only that part
includes some headers in third_party/NordicSemiconductor that have
unused parameters.
It seems to be unnecessary to install these format dependencies when
setting up OpenThread on a Raspbian (Mostly people don't develop or
submit PR from a Raspberry pi). So by default don't install these
format dependencies on Raspbian to save time.
This commit introduces the Proof of Concept implementation of the
OpenThread Controller Interface (OTCI) which can be used to connect
and manage various kinds of OT devices.
This commit also adds the tests to verify that OTCI works for both
simulation and real OT devices.
- Device Connectors
- CLI Virtual Time Simulation
- CLI Real Time Simulation
- CLI SOC Device
- NCP Virtual Time Simulation (not all APIs work)
- Real device via SSH
- OTCI tests of simulation devices are executed in Github Actions
- OTCI tests of real devices can be executed like below:
# Install otci python library
cd tests/scripts/thread-cert/otci && python3 setup.py install --user
# Test OT CLI SOC device at /dev/ttyACM0
REAL_DEVICE=1 OT_CLI_SERIAL=/dev/ttyACM0 python3 tests/test_otci.py
# Test OTBR device via SSH
REAL_DEVICE=1 OTBR_SSH=172.16.243.151 python3 tests/test_otci.py
When initializing, we should use randomly generated network parameters
instead of default ones, to eliminate the possibility of unintentional
use of default credentials.
CoAP requires that the source address of a response must match the
destination addresses of the request. So, if a device sends a TMF
request using ALOC as destination address, the TMF response SHOULD use
the ALOC as source address. Otherwise, CoAP implementations (beside
OpenThread) may fail to match the request and response.
This is the initial implementation of Thread Border Router
prefix/route management with:
- Create & publish off-mesh routable (OMR) prefix for Thread network
- configure the BR as default route.
- converge to the smallest OMR prefix if multiple prefixes are
present at the same time.
- Create & advertise on-link prefix for infrastructure network
- monitor RA messages on infra link and stops myself if there is
someone else advertising an on-link prefix.
It currently supports single infrastructure link with possibly
multiple BRs. Support for multiple infrastructure links is left for
future.
This commit updates `Sha256` and `HmacSha256` classes adding new
flavors of `Update()` method which inputs bytes from a given buffer,
or from an object, or read from a `Message` for hash calculation.
This commit also updates unit test to add more test-cases (from RFC
4231) for HMAC and adds new set of test-cases for SHA-256. The test
also covers calculating hash over data read directly from a `Message`.
The ECDSA feature needs more heap to run because buffers for signing
and signature verification are dynamically allocated.
The number 2600 is the minimum (not precise) size to pass the
test_ecdsa unittest case. This is not revealed in CI tests because
DTLS is enabled (and thus we have much larger heap) for unittest
check.
Per Sec 4 of RFC 6605:
"ECDSA public keys consist of a single value, called "Q" in FIPS
186-3. In DNSSEC keys, Q is a simple bit string that represents the
uncompressed form of a curve point, "x | y"."
The bit string of the two curve points (X, Y) should have a fixed
length of 64 bytes and the additional `1` byte prefix should not be
included, because only uncompressed form is allowed.
This commit changes the trel platform implementation under posix such
that if the interface name used for trel is empty, the platform layer
would disable trel. This is done by having all `otPlatTrel` functions
returning immediately without performing any action. This commit also
changes the `OPENTHREAD_CONFIG_POSIX_APP_TREL_INTERFACE_NAME` to be
empty string. This is the posix config option specifying the interface
name to be used by the trel platform layer. Note that the trel
interface name can be given using this build-time config, or through
the `-trel-interface` (or `-t`) input arg option. When the input arg
is not used, the interface name is determined from the build-time
config `POSIX_APP_TREL_INTERFACE_NAME`. This commit therefore makes
the default behavior when `-t` is not used to disable trel platform.
An issue is caused by The Challenge TLV and TLV Request TLV MUST be
included if the response is an Accept and Request message in Step 4,
delete these two TLV checks when the response is a Link Accept
message.
src/ncp/BUILD.gn: Added new targets
spinel/BUILD.gn: Added configs to propagate the flags to dependent
targets
BUILD.gn: Updated top level BUILD.gn to include ncp targets
radio_spinel_impl.hpp: Removed compiler error for unused variable
mbedtls/BUILD.gn: Added a missing src file, added compiler flag to
ignore conversion as there is implicit unsigned int to unsigned char
conversion in ctr_drbg.c and ecp.c
This commit adds support for ECDSA using NIST P-256 curve and SHA-256
hash. `KeyPair` type is added which represents a set of public and
private keys. It provides methods for generation a new key-pair and
getting a DER format byte sequence representation of the key-pair.
This commit also adds methods to calculate ECDSA signature and verify
a signature for a hashed message. The underlying implementation uses
`mbedtls` APIs.
It also adds a unit-test `test-ecdsa` to cover behavior of the newly
added types and methods. The unit test also verifies the signature
calculation using the test vector example from RFC 6979.
Currently if OpenThread dies with something like VerifyOrDie, we can't
get any logs from GitHub Actions. This enables full logs and uploads
them when expect tests fail, making it easier to diagnose such errors.
If mError is set to error state before entering the RCP recovery, this
error will be recognized as an error in the recovery process, and
cause it to die, while there is actually no error.
This fixes it by clearing mError when starting the recovery process.
After coex precondition is approved, no action is taken to notify the
core. As a result, the coex precondition is not met when doing the
transmission. Now we move the code before HFCLK handling so that HFCLK
handling would notify the core.
This commit addresses an issue with `LinkRaw` on FTD/MTD builds. In
FTD/MTD builds, we add code to disable/enable MAC layer when link-raw
is being enabled/disabled. This ensures to avoid any conflict in
control of radio and sub-mac between `Mac` and `LinkRaw`. In RADIO
build, we directly enable/disable sub-mac (note that in FTD/MTD build
then `Mac` layer would be enable sub-mac).
Performing MAC frame encryption immediately after each copy results in
copying the already-encrypted frame, rather than the original frame
before encryption.
- Simplify 'GetNextCslTransmissionDelay'. Remove one unneeded function
argument.
- For a CSL transmission using 'nrf_802154_transmit_raw_at' there is
no need for 'nrf_802154_channel_set'.
This commit adds explicit error logs messages for the more common
error situation in trel platform implementation under posix, e.g., if
the trel netif cannot be found, or a unicast address cannot be added
to the netif. The new logs provide is included to provide more details
in addition to log message by `VerifyOrDie()` and/or `DieNow()`
This commit implements Enhanced-ACK Probing (on simulation platform).
- Add a new public API otLinkMetricsConfigEnhAckProbing which sends
Link Metrics Management Request to configure the probing. This is
called on Probing Initiator side.
- Add a new radio platform API otPlatRadioConfigureEnhAckProbing. This
API should be called on Probing Subject side when handling the
requests from Initiators. This API notifies the radio to start/stop
aggregating link metrics info and include the data into Vendor IE in
enhanced-ACK for the specific neighbor. As discussed in #5746, the
code for doing such thing should be put in radio driver.
- Add a util module util/link_metrics, which provides a group of APIs
to implement Probing Subject side logic for Enh-ACK Probing. Any
platform could use this module to implement the feature easily in
radio driver.
- Add new util APIs in util/mac_frame to generate Enh-ACK Probing IE
(Vendor IE with Thread OUI and SubType = 0) and set value for this
IE.
- Update the implementation in simulation/radio.c to support Probing
Subject side logic for Enh-ACK Probing, using APIs in
util/link_metrics and util/mac_frame.
- Add a test
v1_2_LowPower_7_1_01_SingleProbeLinkMetricsWithEnhancedAcks.py for
testing.
Misc:
- Add check for all the public Link Metrics APIs (Initiator side) to
ensure that the Subject is a neighbor of the Initiator. If the
address is not link-local or the neighbor is not found, an error
UNKNOWN_NEIGHBOR would be returned.
- Update PrepareEmptyFrame so that when it's called for reference
device, its frame version would be set to 2015.
This commit adds new builds under "simulation-build-autotools"
to cover multi-radio configurations: TREL only, 15.4+TREL,
15.4+TREL+ToBLE.
It also adds new GitHub action tests covering all `toranj`
test-cases with different configurations:
1) NCP model with TREL radio only,
2) POSIX App and RCP model with TREL radio only (emulated over
a virtual Ethernet netif).
This commit updates `toranj` test framework to support running tests
in posix-app mode over a TREL radio link (a virtual Ethernet netif is
used for TREL). It also updates the build script to easily set up
different configurations, ncp/posix-app with any radio combination:
15.4 only, TREL only, or multi radio (15.4 + TREL).
This commit adds new spinel properties (and their getters) related
to multi radio link feature. `SPINEL_PROP_SUPPORTED_RADIO_LINKS`
allows host to get the list of supported radio links by the device
itself, `SPINEL_PROP_NEIGHBOR_TABLE_MULTI_RADIO_INFO` provides
info about the radio links supported by all neighbors.
This commit adds new public OT definitions and API for radio link
configuration in `openthread/multi_radio.h`. Mainly the function
`otMultiRadioGetNeighborInfo()` is added which allows info about a
neighbor to be retrieved (e.g., which radio links are supported by the
neighbor and their preference value).
This commit allows us to use different MTU on different radio links.
Mesh Header frames are forwarded by routers over multiple hops to
reach a final destination. The forwarding path can have routers
supporting different radio links with varying MTU sizes. Since the
originator of the frame does not know the path and the MTU sizes of
supported radio links by the routers in the path, we limit the max
payload length of a Mesh Header frame to a fixed minimum value
(derived from 15.4 radio) ensuring it can be handled by any radio
link.
This commit implements TREL IPv6/UDP platform under POSIX App. The
implementation uses datagram sockets to exchange packets over a given
network interface (netif). The interface name can hard-coded in the
build using `OPENTHREAD_CONFIG_POSIX_APP_TREL_INTERFACE_NAME` config
or be specified as part of the input program arguments (using
`--trel-interface` or `-t` option).
This commit implements TREL protocol to encapsulate and exchange IEEE
802.15.4 frames over a packet switched network (e.g., a wireless LAN).
This commit also provides a TREL IPv6/UDP interface implementation
(using link-local IPv6 unicast/multicast addresses to communicate over
a subnet). It defines a platform abstraction (`otPlatTrelUdp6*`) for
TREL over IPv6/UDP.
This commit also provides an implementation of the TREL platform under
`examples/posix` focusing on simulating the behavior of the link.
This commit adds support for multi radio links in OpenThread core.
A set of `OPENTHREAD_CONFIG_RADIO_LINK_*` definitions (in header
`config/radio_link.h`) determines the supported radio link types.
This commit adds a new class `RadioSelector` which selects the radio
link for each message transmission. Per neighbor it tracks the
supported radio types and a preference value for each type.
`RadioSelector` updates the preference value based on the history of
rx/tx events with the neighbor, e.g., a successful tx on a radio link
increases the preference, whereas a failed tx attempt decreases it.
A new class `Mac::Links` is added defining a layer between `Mac` and
different radio links (e.g., `SubMac` for 802.15.4 radio type).
Broadcast frames are sent in parallel over all radio links. A unicast
transmission is sent over a single radio link at a time but on a tx
failure it may be retransmitted over other radio links.
This commit also adds the concept of deferred ack, allowing radio
links report status of ack at a later time through a different
callback.
This commit adds a new class `Crypto::HkdfSha256` which implements
HMAC-based Extract-and-Expand Key Derivation Function from RFC-5869
using SHA-256. It also adds a unit test for the new module.
The efr32 platform shows the following behavior:
> txpower -10
Done
>
> txpower
-113 dBm
Done
The bug is caused by the C promotion rules during the division of
int16_t by unsigned in otPlatRadioGetTransmitPower. This commit fixes
the issue.
- This commit fixes some issue in multicast forwarding from Thread to
Backbone.
- It also adds a test to verify that multicast forwarding works across
Thread and Backbone.
- Test script tests/scripts/thread-cert/mcast6.py is added for Host
to subscribe to a multicast address
The ping reply can not reach ROUTER1 since DUA feature is not
complete.
This commit fixes TMF issues related to the Host tun interface.
- Do not pass TMF messages to Host tun interface
- Backbone TMF (also using port 61631) keeps passing TMF messages to
Host tun interface
- Re-enable packet filters for ALOC/RLOC destined and TMF packets for
PLAT_NETIF and PLAT_UDP
This commit adds `Dns::Name` type which provides a set of helper
methods to encode/decode DNS names. `AppendName()` method encodes and
appends a full name (e.g., "test.example.com") to a message. Other
helper methods enable appending labels (or groups of labels) and/or
constructing a compressed name (using pointer labels). `ParseName()`
method parses and skips over a full name in a message. `ReadLabel()`
method reads labels one by one and works independently of whether the
encoded name is compressed or not. `ReadName()` method read an entire
name from message. The new methods are used in `Dns::Client`.
This commit also add a unit test `test-dns` covering the behavior of
the newly added helper methods.
Finally, this commit adds few helper methods in `ResourceRecords` to
get the size and check the type of a DNS record.
We found that it's possible that a Router, in a topology like above,
could send DUA.req so quickly after receiving Data Response from
Leader that the PBBR is not able to process the same Data Response
message and update the network data accordingly. Consequently, PBBR
sends DUA.rsp with kDuaInvalid status because it can't find a valid
Domain Prefix in the Network Data.
This commit help resolve this issue with two fixes:
- Node to delay for up to 1000ms before sending DUA.req when domain
prefix addresses is generated
- PBBR to respond with kDuaGeneralFailure to allow the node to
re-register the same DUA again.
This commit ensures each node create its own profile data, so that they
can be merged after tests to produce more accurate profile data.
This commit also prints the coverage data of message.cpp after all
profile data are merged.
This commit introduces two configurations for Backbone Router to turn
off corresponding features:
- OPENTHREAD_CONFIG_BACKBONE_ROUTER_DUA_NDPROXYING_ENABLE: 1 by
default, set to 0 to disable Backbone Router DUA ND Proxying
- OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE: 1 by
default, set to 0 to disable Backbone Router Multicast Routing
Both configuration requires OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE.
NOTE: At least one of these two configurations must be ON if
OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE=1(otherwise it's meaningless
to turn on OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE).
This commit removes settings storage path from
`include/openthread-config-android.h` to allow users define
the settings storage path on Android platform.
This commit restrict diagnostic mode only when network stack is not up,
which prevents some issues caused by switching to diag mode after the
device was attached. For example, timers may not be triggered properly
after returnning from diagnostic mode.
5.3.3 pktverify fail by small chance when the ping reply is forwarded
from Router3 -> Leader -> Router2 instead of Router3 -> Router2. In
such case, the direct wpan.dst16 is not Router2's RLOC16, but Leader's
RLOC16.
This commit change 5.3.3 to check for both 6lowpan mesh dst16 and
wpan.dst16 against Router2's RLOC16.
Remove -nostartfiles. There's currently no custom __START defined
anywhere.
Remove -D__STARTUP_CLEAR_BSS for silabs. Standard initialization
should already take care of this.
This commit adds action to upload core dumps, so libs and binaries for
1.2 certification. This is intended to solve issues where programs
intermittently crash however hard to reproduce it.
This is added first for thread-1-2 and low-power-packet-verification
first as an experimental work. We can add same actions for other items
when it's necessary.
If user doesn't set the Partition Id using the command
'leaderpartitionid xxx', the current cli command 'leaderpartitionid'
always return 0. This commit renames the command 'leaderpartitionid'
to partitionid and let the command partitionid returns the current
leader Partition Id and add command partitionid preferred to set or
get preferred Partition Id.
This commit adds a new method `CheckRcpApiVersion()` which is used
during `Init()` to get the API version from RCP and verify that it
is within supported range.
This commit adds a new compatibility check model for RCP and host. It
updates the compatibility guideline documentation stating how the
compatibility policy for NCP versus RCP are handled differently. For
NCP, we continue to require new NCP firmware to remain backward
compatible and work with an older host driver.
For RCP and host, this commit introduces the RCP API Version model.
The API version numbers are used to check the compatibility between
host implementation and RCP firmware. Generally, a newer host side
implementation would work with a range of previous or older RCP
firmware versions.
This commit adds `SPINEL_RCP_API_VERSION` definition which specifies
the current spinel RCP API version. This number MUST be incremented
anytime there is a change in any of RCP specific spinel definitions.
`SPINEL_MIN_HOST_SUPPORTED_RCP_API_VERSION` specifies the minimum
spinel RCP API version which is supported by the host-side
implementation.
This commit also reserves a block of spinel properties value ranges
from `0xB0 - 0xFF` for RCP related property definitions. The smaller
property values help decrease the encoded byte stream length,
resulting in shorter spinel frames exchanged between RCP and host.
This commit update Github Actions workflows to use ubuntu 20.04
whenever applicable.
- Change ubuntu-latest to ubuntu-20.04 to cleanup the annotations:
Ubuntu-latest workflows will use Ubuntu-20.04 soon. For more
details, see
https://github.com/actions/virtual-environments/issues/1816
- Change ubuntu-18.04 to ubuntu-20.04 wherever ubuntu-20.04 works.
- Fixed a compile issue in tests/unit/test_link_quality.cpp on
ubuntu-20.04
- Can not get Simulation/expects work on ubuntu 20.04 due to unknown
issue. Leave for further enhancement.
This commit contains a set of smaller enhancements/changes in DNS
modules:
- Adds `Client::QueryInfo` class (mirroring `otDnsQuery`).
- Simplifies iteration over `mPendingQueries`.
- Uses `Ip6::Address` instead of `otIp6Address` (internally).
- Updates documentation style in `dns_headers.hpp` .
- Changes internal constant/enum definitions to be `private`.
- Adds `ResourceRecordAaaa::IsAaaa()` helper to check whether a
given Resource Record is of AAAA type.
- Small style fixes.
This commit updates `Dataset::Info::GenerateRandom()` to set the Key
Rotation Time in Security Policy component on a Dataset using the
default value (from `KeyManager`). This addresses the issue where the
generated Operational Dataset could potentially use zero for Key
Rotation time.
This commit also changes Security Policy Flags to use default value
from `KeyManager`.
This commit enables the feature IPV6_MULTICAST_LOOP into OpenThread IPv6
stack. The default-enabled feature allows a node receives a multicast
message sent by its own.
Software aes was using tables from RAM instead of ROM. It caused firsit
call to take longer than expected due to the need to fill the data.
Had to move to the most recent nrf security vestion as the one used did
not support this feature.
Oberon backend is software crypto implementation faster than mbedtls.
Since now AES can not be handled by cc310 switched to using Oberon
instead of vanilla mbedtls.
Also updated doc as some files were renamed.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
This commit avoid unnecessary rebuilds. The issue is caused by the
openthread-mbedtls-config target added by add_custom_target will always
be run, so the generated openthread-mbedtls-config.h is always
re-generated. This commit changes to use add_custom_command to generate
the header file.
MAC command frame has its command ID encrypted in frame version
802.15.4-2015. Radio driver cannot decrypt this frame payload without
extended address. So the frame pending bit is not correctly set in the
ACK in response to data request command with version 2015. This commit
adds a special handling for frame version 2015 and only checks the
frame type when deciding if it needs to set the frame pending bit.
This commit:
- Fixes the issue in CSL scheduler dealing with multiple SSEDs.
- Fixes the issue when CSL tx attempts reach max, CSL transmission to
this child cannot resume.
- Reset CSL sync status after child mode change to RxOnWhenIdle.
- Adds MLE version, CSL synchronization status and queued message
count to child table.
This commit simplifies the CLI module by adding new flavors of helper
methods `OutputLine/Format(aIndentSize, ...)` which prepend a given
number of indentation space characters before the format string.
It also harmonizes the other `Output{Item}()` methods which output an
item with a given indentation to use `aIndentSize` as the parameter
name and as the first parameter of the method.
It also simplifies the implementation of `OutputSpaces()`.
This commit adds a new module `DatasetUpdater` which provides
easy-to-use APIs for user to request an update to any component (a
subset of components) in Operational Dataset of the Thread network.
The change can be requested from any node in the network. The
implementation uses `MGMT_PENDING_SET` command and takes care of
preparing the Pending Dataset and updating timestamps and monitoring
for the Dataset to be updated and possibly retrying. It reports the
outcome (success or failure status) back to the user in a callback.
This commit also updates the `ChannelManager` module is to use the
`DatasetUpdater` to change the channel.
This commit contains small style changes in CLI module
- Not using `a{VariableName}` style for local variables
- Harmonize the use `char *aArgs[]` as the parameter type in command
handlers.
This commit addresses an issue in `RadioSpinel::Init()` to correctly
verify that device is connected to an RCP (i.e., capability list
includes `SPINEL_CAP_CONFIG_RADIO`) and if not then exit (`DieNow()`)
with `OT_EXIT_RADIO_SPINEL_INCOMPATIBLE` code.
It also simplifies the checking of capabilities for log stream support
(`SPINEL_CAP_OPENTHREAD_LOG_METADATA`) by changing the code to get and
process the `SPINEL_PROP_RADIO_CAPS` list only once from `IsRcp()`.
This commit adds missing error check during parsing of the input
parameters in property handlers for `NETWORK_NAME`, `THREAD_MODE`,
`STREAM_NET_INSECURE`, and `MAC_FIXED_RSS`.
It also changes the encoding of dataset and the msg buffer counter
to ensure to check for error.
Currently, processNextRxPacket fills in the received frame's mRxInfo
only for non-ack packets. When a SED polls its parent, the ACK frame
is passed up to the OT core in efr32RadioProcess, but the rx info is
incorrect (it is actually the rx info for the last received non-ack
packet).
OT core uses the RSSI and LQI internally, and for applications that
don't transmit/receive data frequenty, the rx info is stale. This
commit changes this behavior, so the radio driver populates the rx
info also for ACK packets.
This commit adds an option to allow share heap memory with message
buffer pool.
For MTD, there is usually no border agent or commissioner service. This
change allows the heap for meshcop to be used by application or network
management data after the device is attached. Thus the total memory
usage can be reduced.
On nRF platform, otPlatRadioGetNow always gets the LSB part of an
uint64_t time. However, on simulation platform, this is not the
case. So in
if (otPlatRadioGetNow(&GetInstance()) <
mTransmitFrame.mInfo.mTxInfo.mTxDelayBaseTime +
mTransmitFrame.mInfo.mTxInfo.mTxDelay)
we don't get the result expected. otPlatRadioGetNow(&GetInstance()) is
a very big number on simulation platform, and mTxDelayBaseTime is the
LSB part of the rx time.
When users add a FEM after the radio chip, the actual output power is
determined by both the radio chip and FEM. The radio driver only
provide a function to set the radio output power. This commit adds
macros and functions to allow users to implement the power setting
functions by themselves.
This commit allows bootstrap not to fail but print warning if
installing llvm@9 or clang-format-9 or clang-tidy-9 failed. This has
been the best practice for installing other pretty tools.
This commit adds an overload version for LinkedList::FindMatching
which doesn't require prev as parameter. In many cases we don't need
to get the previous item's pointer when finding in a list. This
version would help in these cases.
This commits adds a common helper method to read Link and/or MLE Frame
Counters from a message. The Link Frame Counter TLV is expected to be
present in the message. The MLE Frame Counter TLV, however, is optional
and when not present the Link Frame Counter is also used as MLE Frame
Counter value.
This commit adds template flavors of `Append<Tlv>()`, `Find<Tlv>()`,
and `Read<Tlv>()` in the common base `Tlv` class. This helps simplify
the processing and generating of TLVs in other modules and also adds
build-time type check for the value of simple TLVs (build error when
incorrect TLV Value type is used).
All `Tlv` sub-classes now inherit from `TlvInfo<kTlvType>` which
provides a constant `kType` specifying the TLV Type value. Simple TLVs
which contain a single value also track their TLV Value type by
inheriting from either `UintTlvInfo` (when their value is an integral
(unsigned int) type) or `SimpleTlvInfo` (when their value is
non-integral).
This commit also add `IsSame<A,B>()` to `TypeTraits` to check whether
two given types are the same. It also adds template flavors of
`HostSwap<IntType>()` in `Encoding` module.
This commit:
- Add callback for Domain Prefix events
- Add callback for ND Proxy events
- Add corresponding test to verify ND Proxy works
- Some misc enhancements to the Backbone tests
- Run sudo modprobe ip6table_filter in Docker host so that ip6tables
works in ubuntu docker instances.
- Use -DOTBR_REST=OFF -DOTBR_WEB=OFF for building OTBR Docker image
since these features are not used in tests.
- Setup radvd on Host to send Router Advertisements for the Domain
Prefix using configuration: AdvOnLink on; AdvAutonomous off;
AdvRouterAddr off;
- Set sysctl net.ipv6.conf.eth0.accept_ra=2 for BBR and Host
This commit implements DUA features of Thread 1.2 DUA that involves
sending and processing Backbone query and answer:
- Extend address query to the Backbone Link
- Send BB.qry for Thread address query
- Send ADDR_ANS.ntf for BB.ans
- DAD process
- PBBR to send BB.qry on the Backbone link (3 times if not answered)
- PBBR to receive and handle BB.qry and sends BB.ans
- PBBR to receive BB.ans and sends ADDR_ERR.ntf if duplicated
- PRO_BB.ntf
- Send PRO_BB.ntf when DUA registration is updated
- Handle PRO_BB.ntf
- Add test_dua_dad.py to test the DAD process when it was successful
or duplicated
- Verify the normal DAD process
- Verify Address Query can be extended to the Backbone link
- Verify DAD duplicate is handled correctly
- Verify PRO_BB.ntf for duplicated DUA is handled correctly
This commit adds `Dataset::Info` and `Dataset::Components` types
mirroring `otOperationalDataset` & `otOperationalDatasetComponents`
definitions and providing helper methods to get/set different fields
in the dataset.
This commit implements the Forward Tracking Series feature in Link Metrics.
- Two new apis are added:
- otLinkMetricsSendMgmtRequestForwardTrackingSeries, which is used
to send an MLE Link Metrics Management Request
- otLinkMetricsSendLinkProbe, which is used to send an MLE Link Probe
- A new class LinkMetricsSeriesInfo is used to maintain the data of
one Series configured by a neighbor. This class inherits
LinkedListEntry and each Neighbor has a list of
LinkMetricsSeriesInfo. All LinkedListEntrys are allocated and freed
by a Pool in LinkMetrics.
- To specify SeriesFlags in cli command for Forward Tracking Series, a
similar approach with LinkMetricsFlags is used. Another character
flags is used to represent SeriesFlags.
- Whenever the node receives a frame (including ACK) from a neighbor,
it would call Neighbor::AggregateLinkMetrics which goes through each
LinkMetricsSeriesInfo entry in the neighbor's list and aggregate the
data if the frame type matches the entry.
- Two test scripts are added to test this function:
- v1_2_LowPower_7_2_01_ForwardTrackingSeries.py
- v1_2_LowPower_test_forward_tracking_series.py
This commit adds a new header `common/type_traits.hpp` which provides
`IsPointer<Type>` to check whether a template `Type` is a pointer type
or not. This is then used in `Message` and `Dataset` methods where we
append/set a generic object to check (as an `static_assert`) that the
object type is not a pointer. This adds protection (causing a compile
time error) against potential incorrect use of these methods (i.e.,
passing a pointer instead of a reference to an object by mistake).
This commit fixes the bug that the Network Diagnostic callback is not
called when we failed to get the response (e.g. the request
timeouted). This results in no command output in the CLI.
This adds support for efr32mg21 BRD4180B.
It also removes BSP_SERIAL_APP_PORT and
gecko_sdk_suite/v3.0/hardware/kit/common/drivers/retargetserial.c from
efr32mg13.
This commit adds a new platform function `otPlatLogLine()`. This
function is optional and if not implemented by platform layer, a
default weak implementation is provided and used by the OpenThread
core using `otPlatLog()`.The new function is used by OpenThread core
when the feature `OPENTHREAD_CONFIG_LOG_DEFINE_AS_MACRO_ONLY` is not
enabled (which is the default behavior). In this case, the OT core
itself will prepare a full log line.
This commit also adds implementations of the new platform function for
the NCP and CLI modules.
This commit also adds two specializations of the `SetTlv()` for
`uint16_t` and `uint32_t` value types where the given integral value
is `BigEndian::HostSwap()`-ed before written as the TLV value (these
specializations replace `SetUint16Tlv()` and `SetUint32Tlv()`).
This commit simplifies `DatasetManager::SendSetRequest()` by adding a
method to `AppendDatasetToMessage()` which uses `Dataset::SetFrom()`
method to convert a given `otOperationalDataset` to a TLV sequence
before appending it to a given message. The conversion is performed in
a new method to ensure that the stack/temporary variable `Dataset` is
released before the call to process/send the prepared message.
When the SPI is transmitting a frame, the ncp_spi sets the SPI to
transmit the second frame. After the current frame is transmitted,
the SPI generates the END and ACQUIRED event at the same time. The
SPI driver processes the ACQUIRED event first and then the END event.
The ACQUIRED event notifies the up layer to set the SPI GPIO interrupt
pin. The END event notifies the up layer that the transmission has
completed. Because the SPI tx/rx buffer variables in the `spi_slave.c`
has been updated to the second frame buffer. The ncp_spi thinks that
the second frame has been transmitted in the END event. Then the second
frame is lost.
This CL processes the END event first then ACQUIRED event. To avoid
the cached frame buffer variables are passed to the ncp_spi, the SPI
driver gets the frame buffers directly from the SPI buffer registers.
- backbone/test_mlr_multicast_routing.py verifies the basic features
of Backbone multicast routing
- backbone/test_mlr_multicast_routing_timeout.py verifies that MLR
timeout works
- backbone/test_mlr_multicast_routing_commissioner_timeout.py verifies
that Commissioner MLR timeout works
Fixes the following error:
utils/parse_cmdline.cpp:230:28: runtime error: negation of -2147483648
cannot be represented in type 'int32_t' (aka 'int'); cast to an
unsigned type to negate this value to itself
If the RAIL interrupt fires late (for example, when the MCU is heavily
loaded), then RAIL_IEEE802154_GetAddress and
RAIL_IEEE802154_SetFramePending return RAIL_STATUS_INVALID_STATE
because it is too late to modify the outgoing Immediate ACK. The
proposed solution is to avoid asserting and print a warning to make
the user aware of such problems.
This commit enhances Backbone TMF:
- Subscribe Backbone TMF on multicast addresses on the Backbone
interface
- All Network BBRs Multicast Address
- All Domain BBRs Multicast Address
- Thread Netif no longer subscribe these two addresses, because BBR
Multicast Addresses are only defined for the Backbone Link in Thread
Spec 9.4.8.1
- Make sure backbone messages are using link local src addresses
- Verify src addr for b/bmr messages
Adds `OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE`
config option which specifies the rx frame buffer size used by
`SpinelInterface` in RCP host (posix) code. This is applicable/used when
`RadioSpinel` platform is used.
This commit updates and enhances OT logging by implementing some of
more common operations as functions (instead of macros) and preparing
the entire log line (appending log level and/or log region to the log
string if the corresponding OT config options are enabled) before
passing it to platform layer.
The OT logging previously used macro definitions all the way to
platform layer call to `otPlatLog` (which itself can be defined as a
macro through an OT config). This model was adopted to address a
restriction/requirement on certain platforms (e.g., platforms that
required to enable/use log tokenization). However, using macros adds
an overhead on all other platforms that do not have such a
requirement.
This commit adds `OPENTHREAD_CONFIG_LOG_DEFINE_AS_MACRO_ONLY` which
when enabled (set to 1) keeps the implementation as before (i.e.,
macros are used in the logging module). By default this is disabled
which enables the new implementation added from this commit.
This commit also adds `OPENTHREAD_CONFIG_PLAT_LOG_MACRO_NAME` which
replaces the previous `OPENTHREAD_CONFIG_PLAT_LOG_FUNCTION_NAME`. This
config is used to override the `otPlatLog` and define it as a macro. A
build-time check is added in the `config-check.h` to help any project
that is integrating OT and may be using the macro name override
behavior to detect the change from this commit and update its config
definitions.
Finally, this commit updates `check-simulation-build-autotools` script
to add a build with `OPENTHREAD_CONFIG_LOG_DEFINE_AS_MACRO_ONLY`
enabled.
This commit contains smaller enhancements in `BorderAgent` module
- define `ForwardContext` as a private sub-type of BorderAgent
- change `ForwardContext` to be `InstanceLocatorInit` and avoid
`new` (use `Init()`)
- add `HandleCoapResponse()` method which is called from `static`
method `HandleCoapResponse()`.
- convert file `static` functions `SendErrorMessage()` to `BorderAgent`
methods
- Add `State` enum and inline/remove `SetState()`.
- Smaller style/documentation fixes (e.g., remove unnecessary `{ }`).
This change ensures the cc2538 cmake build uses the release build type
and the compile option `-Os` (optimize for size). This harmonizes the
cmake build with automake version. It also helps address an issue with
recent PRs failing on cc2538 cmake build with arm-gcc-5 due to
reaching flash size limit (without `-Os` option).
This commit changes `EventToString()` to use an array instead of
`switch`. This helps with code size due to enumerator cases being
`uint32_t` bitmask values and therefore compliers may not be able to
optimize the `switch` statement as a table.
This commit adds a new helper method to set the token on a CoAP
`Message` by copying it from another `Message`. It also renames the
method which generates a random token of a given length to
`GenerateRandomToken()`.
This commit contains miscellaneous smaller enhancements in
`DataseManager` module:
- keep `public`, `protected` `private` definitions in this order
- add helper `GetType()`, `IsActiveDataset()`, `IsPendingDataset()`
- use `Read()` helper instead of `mLocal.Read()`
- remove unused definitions of `HandleUdpReceive()`
- remove `mUriGet`, `mUriSet`, and determine them based on the
dataset type (active/pending).
- re-order member variables to help with packing
- update method documentations
Currently, the WELLKNOWN_NODE_ID = 34 is not properly defined.
- In virtual time simulation, WELLKNOWN_NODE_ID limits the number of
ports each PORT_OFFSET can occupy. The virtual time simulator
listens at the nodeid=0 port rather than nodeid=34 port. So, there
is no such thing as wellknown node ID in virtual time simulation.
- In real time simulation, the sniffer listens at the nodeid=34
port. This PR changes it to nodeid=0 port to be consistent with
other parts.
- In posix virtual time, the simulator listens at the nodeid=0
port. So, there is no such thing as wellknown node ID in Posix
virtual time.
This commit changes it to MAX_NETWORK_SIZE = 33 and make it
(configuration OPENTHREAD_SIMULATION_MAX_NETWORK_SIZE) configurable in
simulation by:
- Makefile configuration: MAX_NETWORK_SIZE
- Cmake configuration: OT_SIMULATION_MAX_NETWORK_SIZE
The `url.cpp` can use core header files (e.g. `common/core_utils.hpp`)
This change ensure the core header files should be able to see each
other (e.g., `code_utils.hpp` including `arg_macros.hpp`).
The `configure` script runs with `#!/bin/sh`, but actually required
bash. POSIX sh does not have either the `function` keyword or pattern
replacement in variable subsititutions.
This commit adds three macros in a new header `arg_macros.hpp`
`OT_GET_FIRST()`, `OT_GET_RESET(...)`, and `OT_GET_SECOND()`. These
macros help with parsing variadic arguments passed to a function/macro
and can handle the case where variadic macro arguments is empty
without requiring toolchain specific behavior/support. This commit
also adds a unit test `test_macros` for the newly added macros.
This commit fixes random fails in Thread 1.2 Backbone tests that uses
OTBR Docker.
The fails are caused by failing to start tayga service when there are
many OTBR Dockers running. This commit turns off NAT64 feature of
OTBR in 1.2 Backbone tests to avoid this issue since NAT64 is not
useful for Backbone tests.
On the transmitter side, only maintain a single frame counter, and
never reuse it.
On the receiver side, maintain a second incoming frame counter eFC
alongside FC for each device, where eFC >= FC >= 0. When an Enh-ACK is
received, verify it against eFC. Update eFC to be equal to the
received frame counter. Do not touch FC. When a frame other than
Enh-ACK is received, verify it against FC. Update both eFC and FC to
be equal to the received frame counter.
Check the global state in the radio when an ack frame is found before
reporting a transmit was completed. This change avoids the case where
an acknowledgment frame from another transmission is mistaken for our
acknowledgment frame.
- Check source address of packets from users
- Determine anycast address by MLE API for accuracy
- Replace anycast address with a valid unicast address when sending
with platform UDP in UDP layer
- Replace anycast address with a valid unicast address in IP layer
Fixing a few formatting things I should've caught when reviewing the
update to the BBB guide:
- The callouts should only have a single > on the first line
- The ### within a code block was causing issues with my import
script... easier to just change them to a single #
For 8.x.x, there is validation that joiner has the same keys as the
commissioner after commissioning, it should be configured with a
different master key before start commissioning.
This command allows an Rx-Off-When-Idle device to send an empty mac
data frame or mac datarequest to its parent. This command is only used
for certification.
This commit adds new helper functions under `Utils::CmdLineParser` to
parse a given ASCII string as different simple types, namely signed or
unsigned integers of different bit lengths (`uint8/16/32/64`, and
`int8/16/32`). The new functions validate that the parsed value fits
within the supported range of the expected int type. This commit also
adds different flavors of `ParseAsHexString()` to parse a hex string
into sequence of bytes (with fixed/known size or unknown size allowing
or disallowing truncation). It also moves the parse related methods
(like `ParseAsIp6Prefix`) from CLI modules in `CmdLineParser`.
The CLI modules are then updated to use the new `ParseAs{Type}`
functions simplifying the code and adding extra checks when parsing
the CLI input.
Finally, this commit adds a unit test `test_cmd_line_parser` verifying
the behavior of new `ParseAs{Type}()` functions.
Added language to show how to replace Connman with Network Manager to
enable the default setup scripts.
Added pointers on setting up a WiLink 8 module for Wi-Fi AP
development.
Removed explanation of downloading and flashing the BeagleBone image
in favor of linking to the public BeagleBone documentation.
Removed explanation of expanding and truncating the filesystem in
favor of using the helper tool from BeagleBone.
This commit adds new helper methods in `Message` class. It adds new
template methods to allow an object (of any type) to be read from or
written/appended/prepended to the message. The `Read<ObjectType>()`
method returns a parse `otError` if there are not enough bytes
remaining in the message to read the entire object.
The template methods are used in other core modules which help
simplify the code (there is no need to specify the template type since
it can be deduced by the complier from the passed-in argument). Also
since the template methods directly use the `sizeof` the object type,
they help reduce the chance of incorrect use (using incorrect
read/write length when calling the method).
This commit also updates and renames the methods which read/write raw
bytes from/to the message to `ReadBytes()`/`WriteBytes()`. The order
of parameters in these methods are changed to follow the common
pattern used by other modules and the OT public APIs (i.e., the
pointer to the buffer is given first, followed by its length).
This commit adds `LookupTable` module which provides helper methods to
perform binary search in a generic sorted lookup table for specific
entry matching a given name string. It also provides `constexpr`
methods to check (at build-time) whether a lookup table array is
sorted. This commit also updates CLI modules to use the `LookupTable`
methods for command lookup. It also adds a unit test for the lookup
table.
The end formatting on openthread.io will be different (many step lists
removed and some text shifted around).
Also updated the Style Guide to add a Contributor tag section.
This commit enhances Backbone Router to send BMLR.ntf on the backbone
link for Multicast Listeners.
- Send BMLR.ntf to the Backbone link
- Add Backbone test with packet verification
- Includes some revision to the Thread 1.2 Backbone CI scripts to make
it more stable
This commit also adds a template version of `OutputBytes()` which
accepts a reference array of a specific length. This helps simplify
the calls to this helper method where the array length can be
inferred. It also changes the code to use `OutputBytes()` for
outputting master key, pskc, xpanid, etc.
This commit contains a group of style fixes and smaller enhancements
in CLI modules:
- Remove unnecessary `struct` when declaring variable.
- Remove use of single `"%s"` in `Output` methods.
- Fix order of `#include` headers.
- Remove unnecessary use of `OT_UNUSED_VARIABLE`.
- Remove unnecessary temp variables and casts.
- Add comments to `#endif` directives than are more than than 20
lines away from the corresponding `#if` they are associated with.
- Configure next response to 5.00 for Reference Device
- Handle 5.00 (and other COAP error codes) in DUA.rsp (required by 1.2
Test Spec)
- Update DUA test to handle COAP code 5.00
This commit allows running packet verification on a test info (.json)
directly without running the test procedure, which can be helpful for
developing and debugging packet verification code.
This commit is the first part in link metrics. It implements single
probe function.
An overview of major changes:
- Add link metrics apis which allow apps to send a single probe and
set report callback.
- Add cli commands for calling link metrics api and related README
doc.
- Add a new module link_metrics to implement the query process and
handle the report.
- Add related tlv types.
- Add simple script test to run single probe process.
Thread 1.2 CI with OTBR and Backbone link:
- Run OTBR in Dockers with Backbone link
- Enhance node.py to work with OTBR Docker
- Add Packet Verification for 5.11.1
- incomplete, some steps can not pass yet, just to make sure
Backbone traffic verification works
- Support running multiple tests simultaneously (default: each test
run 3 instances)
- Build OTBR Docker using OpenThread PR code
- Upload code coverage in Docker
Some implementation details:
- Most existing code of node.py is shared by OTBR Docker
- Backbone related test scripts are found in
tests/scripts/thread-cert/backbone
- A new script tests/scripts/thread-cert/run_bbr_tests.py is added to
manage multiple running tests
- Test configuration differs according to PORT_OFFSET
- Backbone interface name: Backbone{PORT_OFFSET}
- Backbone network prefix: 91{PORT_OFFSET:02x}::/64
- Docker instance name: otbr_{PORT_OFFSET}_{nodeid}
- Output Files:
- Pcap:
- Thread: {test_name}_{PORT_OFFSET}.pcap
- Backbone: {test_name}_{PORT_OFFSET}_backbone.pcap
- Merged: {test_name}_{PORT_OFFSET}_merged.pcap
- Log: {test_name}_{PORT_OFFSET}.log
This commit runs Thread 1.1 certification tests with packet
verification for 1.2 build because Thread 1.2 certified devices are
supposed to be able to pass Thread 1.1 certification first.
Note: changes to test TOPOLOGY:
- Original: nodes use version=1.1 by default
- Now: nodes use version according to ENV, except explicitly specified
This commit adds macros `FreeMessage()`, 'FreeMessageOnError()' and
`FreeAndNullMessageOnError()` which would free a given `Message`
pointer if not `nullptr` (conditionally on an `otError`).
These macros implement small yet common code patterns used in many of
the core modules. They are intentionally defined as macros instead of
inline methods/functions to ensure that they are fully inlined. Note
that an `inline` method/function is not necessarily always inlined by
the toolchain, and not inlining such small implementations could add a
rather large code-size overhead.
Now that we have a process in place where openthread.io can source
documentation from GitHub, we need a documentation style guide to
ensure that the format of docs here on GitHub meet the format
requirements for hosting on openthread.io.
When no arguments are provided to script/test, the script prints $1:
unbound variable and exits without printing the usage
information. This is due to the set -u at the top.
This commit has a small fix so that this usage is presented with the
usage information. Also, it prints an error when it detect an unknown
command.
LogError() uses otLogWarnMeshCoP(), which was included by
thread/thread_netif.hpp -> meshcop/joiner.hpp -> common/logging.hpp.
thread_netif.hpp includes joiner.hpp only if OT_JOINER=ON, so the
build would fail if OT_JOINER=OFF.
This commit fixes the above.
A compile error can occur in the absence of LIBREADLINE. However the
error I got is confusing and doesn't indicate that because the options
dependencies are not good. I think the options' dependency and
relationship here should be:
- When DEAMON=0 (ot-cli, ot-ncp will be built and ot-cli depends on
console), CLI_TRANSPORT=CONSOLE MUST be used. And otherwise
(DEAMON=1), CLI_TRANSPORT=UART MUST be used. So when users build
posix, they don't need to consider the option CLI_TRANSPORT. It's
reasonable to add the evaluation for CLI_TRANSPORT in
Makefile-posix.
- When CLI_TRANSPORT=CONSOLE, (HAVE_LIBEDIT || HAVE_LIBREADLINE) MUST
be defined and DAEMON=0 MUST be satisfied. I think (HAVE_LIBEDIT ||
HAVE_LIBREADLINE) is a result of CLI_TRANSPORT instead of the
reason. The reason for CLI_TRANSPORT should be DEAMON. Now I set
CLI_TRANSPORT option based on DAEMON and make (HAVE_LIBEDIT ||
HAVE_LIBREADLINE) as a check for CLI_TRANSPORT=CONSOLE.
If READLINE lib is not found, in this implementation, there will be an
error indicating that it's not found.
This commit changes the CLI `Process{Cmd}()` handler methods to return
an `otError` (instead of outputting the result). This helps harmonize
the `Process{Cmd}()` handlers in different CLI modules. It also
enables the result of CLI command to be outputted from `ProcessLine()`
after the command is looked up in the table and the corresponding
`Process{Cmd}()` handler is invoked.
This commit also adds a new error code `OT_ERROR_PENDING`. This
special error code indicates the success or error status of an
operation is not yet known and is pending. This is then used by some
of the CLI `Process{Cmd}()` methods which perform an async operation,
e.g., `ProcessDiscover()` returns `OT_ERROR_PENDING` if the discover
scan starts successfully, and later the final result is outputted from
scan callback. The `OutputResult(aError)` method is changed to output
nothing if the error is `OT_ERROR_PENDING`.
This commit changes the unit tests `CMakeLists.txt` file to list
the targets in `set_target_properties()` call one per line. This
helps make it easier to read, also reduces the chance of merge
conflicts when new unit tests are added.
This commit includes a relatively minimal set of changes that are
required to allow the efr32 platforms to function with the newly
released Silabs Gecko SDK v3.0.
Change Log:
- Pull in definitions for halInitChipSpecific() and all child
functions from GSDK v2.7.
- These will be replaced with a more elegant solution in a future
commit.
- Switch to the mbedtls that is packaged with GSDK v3.0.
- Allow for mixed casing when specifying BOARD environment variable
If CSL Channel is never specified, the actual CSL channel should
always be the phy channel that the device is using. If CSL Channel
hasn't been specified and radio channel changes, the actual CSL
channel should also change. In current implementation, CSL Channel is
by default a valid value (not specified by upper layer) and wouldn't
change when radio channel changes even if it's never specified.
This commit fixes this issue. On CSL receiver, a bit is extracted from
mCslChannel to be used as a flag mIsCslChannelSpecified. If it is
false, mCslChannel would keep synchronized to the value of
mRadioChannel in Mac and Csl Channel TLV wouldn't be appended in Child
Update Request to its parent. On CSL transmitter, CSL channel info in
child is allowed to be 0. If it's 0, the channel info in frame would
be set using Mac::GetPanChannel.
This makes kill commands in pty checks run with sudo. Otherwise
ot-daemon won't be killed and has to exit by itself, which makes
posix-pty-daemon fail sometimes.
This commit contains a group of smaller enhancements in Cli modules:
- Add and use OutputLine() helper method which outputs a formatted
string line (appends newline \r\n).
- Use binary search when finding the command in sCommands array (also
adds static_assert check to ensure sCommands array is sorted).
- Define Command struct as a private nested type.
- Use enum constants (replacing #define).
- Rename method to OutputResult() (from AppendResult) to harmonize
with rest of a Output{Something}() methods.
- Remove comments at #endif when within 20 lines of #if
This commit simplifies the generation/processing of CoAP Options in a
CoAP message. It adds helper methods `ReadExtendedOptionField()`,
`WriteExtendedOptionField` to decode/encode extended Option Header
fields (Option Number Delta or Option Length). It simplifies
`Option::Iterator` (using `Init()`/`Advance()` to parse and iterate
through all CoAP Options in a message). Note that the public OT
`otCoap` APIs and their behavior remain as before and unchanged.
Fix test_router_attach.py failing by a small chance.
Root cause: routerdowngradethreshold restored back to default (23)
after node reset, so the test had 5/120 chance to downgrade. We should
set it back to 32 before starting it.
This commit also enhances the test for a little bit:
- Make sure the node reattached as Router within 1 second
- Make sure the node does not downgrade after Router Selection Jitter
(3s)
This commit updates the logging in `Mle` modules by adding two
enumerations `MessageAction` and `MessageType` to indicate the action
(send, receive, delay, etc.) and the message type in the updated
`Log()` methods.
In current Mac::Frame implementation, when the frame is a Mac command,
the CommandId is always not included as its private payload, which
means we won't encrypt the CommandId.
In most cases the Private Payload(things we need to encrypt) shall be
set to the MAC Payload field(For Mac cmd, this field includes
CommandId, shown in Figure 7-17) and the Open Payload shall be
empty. The only 2 exception cases are listed in Table 9-1.
So for Mac command with version >= 2, its CommandId should be included
in Private Payload and should be encrypted when necessary. For Mac
command with version < 2, CommandId should be in included in Open
Payload and shouldn't be encrypted.
This commit fixes this problem and adds unit tests for this.
Consider such a case:
- The CSL transmitter has a buffered message for a CSL receiver and
has scheduled that tx.
- Before the CSL transmitter actually sends it, the receiver sends a
data request.
- The CSL transmitter immediately sends the buffered message to the
receiver.
- The scheduled time comes.
In current CSL implementation, though the buffered message has been
sent through indirect tx, when the origin CSL tx time comes, it would
send another 'empty frame' due to the missing of check and the
implementation of IndirectSender::PrepareFrameForChild. This commit
adds the check for this case and avoid to send the meaningless empty
frame.
This commit add support for a custom PDM (Persistent Data Manager)
which is also used inside Project CHIP.
Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
This commit declares MLE `Header` as a `private` nested type of `Mle`
class. It also moves the `Command` enumeration definition into the
`Mle` class (from `Header`).
This replaces the usage of std::numeric_limits with C macro
UINT32_MAX. Removes the dependency of C++ header limits, which isn't
available on some platforms.
This commit contains a group of smaller changes/renames in `Coap`
modules:
- Add enumeration (c++ style) constants for CoAP `Type` and `Code`
and `OptionType`.
- Add helpers `Message::Is{Method}Request()` e.g., `IsPostRequest()`
- Define Thread URI Paths (in `uri_paths.hpp/cpp`) as char array.
- Add helper method in `Coap::Message` for common initializations
e.g., `InitAsConfirmablePost()`.
- Add helper methods for common `Coap:Message` type and code checks
e.g., `IsConfirmablePost()`.
- Re-define `OT_COAP_TYPE` values to use 2-bit unsigned int values
(per RFC-7252).
This commit adds `Checksum` class which implements IP checksum
calculation and verification (all related code from other modules is
now moved to `Checksum` class). The new checksum calculation allows
any message chunk size (removes a limitation with previous model
of requiring even sized chunks). This commit also adds a unit test
`test_checksum` covering the behavior of `Checksum` methods.
This commit relaxes the assert checks when parsing raw-link frame from
the radio tx-done callback to update the security frame counter. In an
FTD/MTD build, if/when raw-link is enabled, the `TxFrame` is prepared
and given by user and may not necessarily follow 15.4 frame format
(raw-link can be used with vendor-specific format), so we allow
failure when parsing the frame. In other cases (in an RCP build or in
an FTD/MTD build without raw-link) since the `TxFrame` should be
prepared by OpenThread core, we expect no error and therefore assert
if parsing fails.
This commit changes TimeMicro::kMaxDuration to Time::kMaxDuration
because in posix OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE is not
set and TimeMicro is not defined.
And in this context, the intent is just to set the variable to a
maximum value.
This commit simplifies the logging in `Mle` modules. It renames and
simplifies the existing MLE logging methods. They are now defined as
`static` methods and the main implementation uses `#if` guards
checking the proper log level (when logs are not enabled they are
defined as empty inline methods).
This commit also adds new helper methods to log failure of sending or
processing of an MLE message, namely `Mle::LogSendError()` and
`Mle::LogProcessError()`. These are then used to simplify logging in
many methods in `Mle` and other related modules.
This commit adds a new parameter to `Ip6::ProcessReceiveCallback()`
allowing caller to indicate whether the method can take custody of the
passed-in message or whether it needs to make a copy of it (to use in
receive callback). This is indicated by a new `enum` definition
`Message::Ownership`. In case of `kTakeCustody` value, the caller
transfers custody of message to the called method (i.e. the method can
`Enqueue()` the message and would need to `Free()` the message when no
longer needed).
The `Ip6::HandleDatagram()` uses this to avoid copying the message in
cases where it is not needed (e.g. for a message that is passed to
host through callback but does not need to be processed by Thread
core).
This commit includes several enhancements to pktverify
- Add more fields of thread_meshcop and thread_address layers
- Remove COAP TLV manual parsing for now since it's not correctly
implemented
- Fix 5.5.2 which had already been using p.coap.tlv.status,
p.coap.tlv.rloc16, ...
Currently script/test can only build 1.2 together with 1.1. This
commit adds support to build 1.2 alone. And when THREAD_VERSION=1.2
and INTER_OP=1 are both set, both versions would be built. Sometimes
we only want to build 1.2. This would save some time for us.
This commit adds a option to debug CSL feature. When the option is
turned on, a CSL receiver wouldn't actually sleep so that it could
receive all packets from its parent and know the tx time.
This change allows `CopyTo()` method to be used to copy bytes backwards
within the same message (i.e., src and dest messages are the same and
the dest offset is before src offset). Unit test `test_message` is
updated in this commit to cover such a use.
However, the `CopyTo()` implementing can still potentially overwrite
the data when bytes are being copied forward within the same message.
This commit adds an assert not allowing such a use and updates the
method documentation mentioning this restriction.
This commit updates `Message::CopyTo()` method to use data chunks
(this copies data directly from the source message to the destination
avoiding the need for an extra buffer copy). It also addresses an
issue where if the requested copy length is more than the available
bytes in the source message, incorrect bytes may be copied into the
destination message, and the returned value (i.e. number of bytes
copied) can be invalid.
This commit also updates the unit test `test_message` covering
behavior of `CopyTo()` for different offsets and copy lengths. It also
checks the behavior of `Read()` when the read length goes beyond the
end of the message (trying to read more bytes than available in the
message).
This commit changes `Message::Write()` to return `void` instead of
returning the number of bytes written. The `Write()` method does not
resize the message and requires that the given data can be fully
written into the message within its existing length. The `Write()`
already contains an `OT_ASSERT()` to verify this.
This commit also removes the redundant `OT_ASSERT()` checks in few
places where `Write()` method's returned value was being used.
This commit adds the Multicast Listener Table for BBR:
- Implements Multicast Listener Table on BBR
- Adds registered MAs to MulticastListenerTable
- Reject when the table is full or the multicast address is invalid
and return failed status
- Respond with unsuccessful status along with failed addresses
- Expire Listeners from MulticastListenerTable per second (using
MinHeap for better performance)
- MLR enhancement
- Re-register only failed multicast addresses (used to register all
registering multicast addresses)
- Reference Device only APIs
- Some APIs are defined for reference devices and tests.
- Add tests
- Add unit test: test_multicast_listener_table.cpp (runs for 1.2-bbr
only)
- Add functional tests
This commit adds one test to verify that if a node subscribed MAs when
there is no PBBR in the network, it should still be able to send
MLR.req after PBBR is enabled.
This is a case that wasn't tested in existing tests.
With Thread 1.2, it is possible to receive an Enh-ACK with security
enabled. This commit:
- Move receive AES CCM related code to Frame class.
- Verify received Enh-ACK in Mac layer. If MIC check failed, the
transmitted frame will be marked as OT_ERROR_NO_ACK.
To enable CSL, it is necessary to get received Enh-ACK timestamp so
that the next sample time could be calculated with this timestamp and
CSL phase in CSL IE.
This commit removes the config setting
OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE automatically when it's 1.2
and MTD. The reason is that it's in core config and it's also used in
platform (radio) which cannot access core config.
If CSL_RECEIVER is not set in options in cmake and it's 1.2, then in
core config, OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE would be turned
on if it's MTD. While in platform, it's not turned on. And then there
would be a link issue.
A SSED uses the Child Update Request to start CSL synchronization. If
the CSL Channel TLV is not present in the message, the parent assigns
the Thread Network channel as the CSL channel for this child during
the attachment.
However, it may happen that a child changes its CSL channel to a
different one with a Child Update Request and decides to keep using
it. In a subsequent Child Update Request it could omit the CSL Channel
TLV (no changes) but the parent would change its CSL channel to the
Thread Network channel. This commit avoids that.
The `Message` data is stored in a sequence of linked-listed `Buffer`
instances. When reading or writing data in the `Message`, the internal
implementation iterates over the `Buffer` list and updates the data in
chunks. This commit adds two helper methods `GetFirstChunk()` and
`GetNextChunk()` to get first/next data chunk (contiguous buffer)
corresponding to a given offset and length into the message. These
helper methods are then used to simplify `Read()`, `Write()`, and
`UpdateChecksum()` methods. The unit test `test_message` is also
updated to verify reading and writing data at different offsets and
lengths.
This commit adds `TimeTicker` class which emits periodic ticks (with
one second period interval) to a set of registered tick receiver
modules. The `TimeTicker` would invoke `HandleTimeTick()` method
periodically on the registered receiver objects.
The `TimeTicker` model helps simplify the implementation of many
modules (such as `MeshForwarder`, `MleRoutuer`, `AddressResolver`,
`Ip6`, `DuaManager`, etc) which require periodic update/check of some
state (avoid each class using its own timer).
OT_CONFIG was used to specify a customized OpenThread core config file
which is only included by OpenThread core library. This commit changes
the behavior so that it specifies the OPENTHREAD_CONFIG_FILE which is
used by all components of OpenThread including the core library.
This commit contain a list of smaller enhancements in `Ip6` modules:
- Simplify `Ip6::Header` removing the PoD definition and providing
`enum` constants for the byte offset to different fields in the header
(replacing/removing static methods).
- Declare some of the `Ip6` methods as `private`.
- Remove error logs (not used/applicable anymore).
- Simplify checking of `destPort` in `ProcessReceiveCallback()`.
- Specify `int` size of `enum` definitions (declare internally-used
`enum`s a `private`).
- Add unit test `TestIp6Header()`.
This commit implements the CSL feature in Thread 1.2.
- Add macro definitions for low power to control the compiling of
source code.
- Add data and methods for running CSL in Mac and SubMac. This mainly
includes setting CSL parameters, starting/stopping CSL, and the
timer handling process.
- Add otPlatTimeGetAPI and implementation.
- Add CSL transmission implementation. CSL transmission is a new kind
of transmission, the related definition and implementaion for the
whole transmitting process is added.
- Add calling of start/stop CSL in certain cases.
- Implement CSL synchronization maintainence. If a CSL cordinator
didn't get a frame containing CSL IE for CSLTimeout, the CSL
receiver is regarded as de-synchronized.
- Add Cli interface for using CSL.
- Implement enhanced Ack with IE. The original code can only generate
auto ack for Imm-Ack. As CSL requires CSL IE included in enhanced
ack. This PR implements it.
- Add basic functional test for CSL transmission. More tests
corresponding to test plan would be added later.
It is possible that log is printed before the Interpreter (UART or
CONSOLE) object is created when FULL LOGS is enabled. In such case, OT
crashes. This commit fixes this bug.
In 802.15.4-2015 spec Table 7-2, it is possible to receive frame with
destination address but without destination PAN ID. This commit
changes the address filter function to avoid dropping such frames.
Use the config specified on the command line, so that overriding this
with a project specific config doesn't cause preprocessor macro
redefinition errors.
The `ThreadLinkInfo` mirrors the `otThreadLinkInfo` definition.
It is mostly used in `MeshForwarder` and `Mle` class. Here are
some related helper methods:
- New helper methods in `Ip6::MessageInfo` to get and set the
link info as `ThreadLinkInfo`.
- Helper method `ThreadLinkInfo::SetFrom()` allows it to be set
from a given `Mac::RxFrame`.
- Helper method `Message::SetLinkInfo()` allows message link info
related fields (in message metadata) to be set/updated from a
given `ThreadLinkInfo`.
This commit adds a group of `Init` methods in `NetifUnciastAddress`
for common initializations of a unicast address with different
parameters (origin, scope, prefix length, and preferred/valid flags).
This commit makes packet verification to run for multiple times.
Since now we are developing many packet verification scripts, this
commit can help us reduce the chance of merging a verification code
that could fail by chance, which is very often for packet verification
code.
This commit addresses an issue where the MLE Link Accept message may
be too large to fit within a single IEEE 802.15.4 frame. Thread
requires any MLE message transported using 6LoWPAN fragmentation to
also enable IEEE 802.15.4 MAC frame security. However, the purpose of
MLE Link Accept messages is to establish a secure link and cannot
itself be transported with IEEE 802.15.4 MAC frame security enabled.
An MLE Link Accept message may carry a Route64 TLV that has a length
dependent on the number of active routers in the network. When there
are many active routers, the Route64 TLV is large and the MLE Link
Accept message can no longer fit within a single IEEE 802.15.4
frame. The side effect is that a router coming out of reset will not
be able to diretly restore its router role and must first attach as an
end device.
This commit limits the size of a Route64 TLV when included in MLE Link
Accept messages. When the number of active routers is above a
threshold, some routers will be elided from the Route64 TLV and the
Router ID Sequence value is decremented. This allows the device coming
out of reset to restore its router role and retrieve the current
Route64 TLV in a subsequent message exchange.
This commit allows notifying the application a discovery request is
received, which is useful if the application wants to be more active
when a joiner comes.
This commit simplifies management of "Fragment Priority Entries"
defining a new class `FragmentPriorityList` with helper method to
allocate/find entries in/from the list. The `Entry` types is also
moved/defined as a nested type of `FragmentPriorityList`.
This commit introduces the packet verification (PV) framework for
certification tests.
- Add packet verification framework code
- Implement packet verification for cert 5.1.7 as a minimal
example. There will be more 1.1/1.2 tests with PV submitted in the
future.
- Download pre-built thread-wireshark binaries from
openthread/wireshark/releases for packet dissecting (used by
pyshark)
- Added a Github Action job for Packet Verification
This commit changes the way the `Notifier` class emits events to other
OpenThread core/internal modules by having `Notifier` directly invoke
their callbacks, i.e., `Notifier::EmitEvents()` uses a hard-coded list
of all core modules/objects that want to receive events and it then
directly calls `HandleNotifierEvents()` on each object.
This change replaces/removes the `Notifier::Receiver` model and
simplifies the approach (reduces code-size and memory/RAM use).
For external modules (or in case the new model cannot be used by an
internal module), `Notifier` still provides the `RegisterCallback()`
model.
Seems the strong otPlatOtnsStatus is not used, but the weak
otPlatOtnsStatus was used in the original code if built by cmake.
This commit fixes this issue. Now both cmake and make builds
correctly.
This commit adds a `NeighborTable` class which provides helper methods
dealing with neighbor, e.g., finding a `Neighbor` (i.e., a `Child`
from `ChildTable`, a `Router` from `RouterTable`, or parent or parent
candidate entries), or iterating through all neighbors. These methods
use the newly added `Neighbor::AddressMacther` to simplify the
implementation. The `NeighborTable` methods replace the similar ones
in `Mle` and `MleRouter`.
This commit adds new a type `Neighbor::AddressMactehr` which is used
to filter and find a neighbor (child/router) with a given MAC address
matching a given `Neighbor::StateFilter`. This new type helps simplify
related code in `ChildTable`/`RouterTbale`.
This commit changes `MacFrame::FindPayloadIndex()`:
- Ensure that at least one Header IE is included when FCF indicates
that Header IE is present.
- Detect error case where Header IE(s) are partially included.
- Handle the case where frame contains Header IE(s) but no data
payload (spec does not require Header IE termination in this
case).
This commit adds a build test without OT_ASSERT to catch compile issues.
- Add cmake option: OT_ASSERT=ON
- Add build test with OT_ASSERT=OFF
- Fixes 2 compile errors.
This option allows to pass Spinel Encrypter library to predefined
Makefiles for different platforms.
Example usage:
make -f examples/Makefile-nrf52840 SPINEL_ENCRYPTER_LIBS=my_encrypter_lib.a
This commit moves `GetChildInfoById()`, `GetChildInfoByIndex()`, and
`HasSleepyChildWithAddress()`, along with methods for saving/restoring
child entries in/from non-volatile settings (e.g., `Restore()`,
`RemoveStoredChild()`, etc.) from `Mle` module to `ChildTable`. It also
removes/inlines the `MleRouter::IsSleepyChildSubscribed()` method.
This commit adds `ReadUint24()`, `WriteUint24()` in `encoding.hpp`
for both little and big endian formats. These methods are then used
for reading/writing OUI in `MechCop::Tlv` sub-classes. This commit
also adds a check in `DiscoverScanner` to ensure the given OUI in
`SetJoinerAdvertisement` is within the valid range.
This commit adds new flavors of methods `Bind()` and `Connect()` in
`Udp6::Socket` allowing user to only specify a port number or provide
no input (address and/or port are determined by the UDP module itself
when not provided). The new methods help simplify `Socket` use in
different modules. This commit also enhances `SockAddr` class adding
new constructors to allow a `SockAddr` instance to be initialized with
a given port number or a given IPv6 address and port number.
This commit implements Thread based Joiner Advertisement from Joiner
side, including:
- A new MeshCop TLV: Joiner Advertisement TLV which includes IEEE OUI
and the Advertisement Data.
- New APIs to set Joiner Advertisement which will be sent along with
Discovery Request messages.
This commit updates `OnMeshPrefixConfig` and `ExternalRouteConfig` to
be `Equatable`. It also adds a `ServerConfig` and adds overloads of
operator `==` to `Service/Server` configs. It also adds new method
`SetFrom()` to all configuration types to set them from a given set of
related TLVs.
- registration workflow framework
- registration and reregistration
- registration and reregistration on behalf of children
- add pseudo response status for test/certification purpose
- add unit test
This commit adds `Ip6::Prefix` class as a sub-class of `otIp6Prefix`
representing an IPv6 Prefix. Helper methods are provided in `Prefix`
and `Address` to perform prefix matching.
Different core modules such as `network-data`, `lowpan`, `dhcp6`,
`slaac`, and, `backbone-router` are updated to use the new `Prefix`
and its helper methods.
This commit also updates the unit test `test_ip6_address` to verify
behavior of `Prefix` and its helper methods.
This commit enhances ot-ctl to process only after a full line is read
in non-interactive mode.
This eliminates the complex and error-prone states handling, which
still has potential issues (despite of small chance):
- If Done\r\n is received in two chunks: Done\r and \n, the original
implementation won't output \n
- If Error 7: InvalidArgs is received in two chunks: Error and 7:
InvalidArgs, the original implementation won't output 7: InvalidArgs
This fixes some expect test failures caused by the following scenario:
Sometimes the command prompt > can be put after the echo of the input
command when inputs come too fast, because we are sending the next
command as soon as we see Done, we don't wait for the next > .
This commit adds expect "> " before sending the command to fix this.
I think openthread-ncp-ftd is added to unit tests' link libraries by
mistake. It's not required and as it depends on OT_PLATFORM, it would
cause openthread-simulation linked in unit test executables, which
would lead to a redefinition as some methods are defined in
test-platform.cpp.
This commit contains a bunch of smaller changes and enhancements
in dhcp6 modules:
- Add and use `TransactionId` class.
- Rename header to `Dhcp6::Header` and update `Dhcp6::Type`.
- Rename server/client to `Dhcp6::Server` and `Dhcp6::Client`.
- Rename/update `DuidType` constants.
- Use `Mac::ExtAddress` as link address in `Server/ClinetIndentifer`.
- Use `Ip6::Address` instead of `otIp6Address`.
- Add `enum` constants for default values (remove `#define`)
- Define `IdentityAssociation` as nested type of `Client`.
- Update documentation.
This commit implements parents sending MLR.req on behave of Children.
- Parent sends MLR.req for Children after delaying for a random time <
PARENT_AGGREGATE_DELAY (5s).
- Update test script to check for proxied MLR.req
- Parent proxy MLR.req for Children after a delay t in [0, 5]
This commit adds support joiner discerner in CLI. The format of joiner
discerner is `number/length`. For example `0xabc/12` means the discerner
value is `0xabc` and the length is `12`.
When the child reboot, only register the mesh local address to avoid
possible large Child Update Response which would be fragmented, thus
avoiding reattach process.
This commit updates `Mle` class to use the newly added `Netif`
iterator for external multicast addresses. It also adds a helper
method in `Netif` to indicate if it is subscribed to any external
multicast address.
This commit simplifies the `GetFramePriority()` implementation
mainly avoiding copying of ICMP6/UDP header when possible.
It also updates unit test `test-toolchain` to verify alignment
behavior of packed structure.
This commit enhances the iterator `Child::AddressIterator` which is
used to iterate over IPv6 address list of a `Child`. The new model
enables range-based `for` loops to be used. It also enables filtering
addresses based on type (e.g., iterate over multicast addresses only).
The unit test `test_child.cpp` is also updated to verify the newly
added functionalities of `AddressIterator`.
The openthread/environment and openthread/codelab_sim images are
currently built and updated via the Docker Hub service. Docker Hub
only allows a single runner at a time and is generally slower than
GitHub Actions.
This commit moves the Docker image build and update to GitHub Actions.
Added include directories to enable including .hpp ncp files
outside src directory, what is needed for vendor hooks concept.
Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
This commit includes:
- Adding compile configurations necessary for MLR features
- Adding source/header files necessary for MLR features
- Send MLR.req for local MAs on ThreadNetif
- At most one MLR.req is outstanding
- Reregistration according to PBBR configuration
- Renewing periods according to PBBR configuration
- BBRs receive MLR.req with minimal processing and send MLR.rsp
- Add a test to verify that MLR.req is sent for local MAs.
This commit introduces the mHasRestored flag and a common
HasRestored() method as devices may decide to introduce some
jitter/randomization to avoid the burst of traffic in cases a bunch of
devices nearby resets/reboots together.
This commit adds `Ip6::NetworkPrefix` mirroring `otIp6NetworkPrefix`
which represents the Network Prefix (most significant 64 bits) of an
IPv6 address. Methods in `Ip6::Address` are updated to use the new
type. The `otMeshLocalPrefix` and `Mle::MeshLocalPrefix` are also
updated use the `NetworkPrefix` type.
Many existing IEEE 802.15.4 radios do not support both promiscuous
mode and auto generation of immediate ACKs. This commit prevents
promiscuous mode when the interface is up.
This commit increases the maximum allowed length of DTLS application
data from 512 bytes to 1152 bytes.
The maximum possible length of application data is just around 512
bytes, and we observed that a Client Hello with cookie encoded in
RLY_RX.ntf message could be 520 bytes.
This commit moves the URL parser to src/lib.
Also includes the following changes:
- Split URL on initialization.
- Make a GetValue() const method.
- Check aLastValue.
- Add some negative tests.
This commit updates `ChildTable` class. It mainly adds support for
using range-based `for` loops to iterate over all child entries
(matching a given state filter). It also simplifies the `Iterator`
implementation (removing the now unused behavior to start the
iteration from a specific child in the table). The unit test
`test_child_table` is also updated to add tests for the newly added
behavior.
This moves all settings of timeout to one place. Also changes the
default timeout to 10 seconds, can probably solve the occasional
timeout when dataset commit active.
This fixes an issue with Channel Monitoring for the EFR32 platform
(MG1, MG12, MG13), where in, turning the radio to a new channel and
immediately gathering background RSSI information was returning
invalid results.
A further investigation with the RAIL team indicated that this issue
was occurring because the usage of `RAIL_GetRssi()` is
incorrect. While the Rail_GetRssi API functions as documented, the
problem is that the current implementation of this API returns valid
results only in certain specified radio states and does not fit the
use case for the OpenThread Channel Monitoring feature. (i.e computing
RSSI value in the RxWarm radio state).
To fix the issue, I am switching the affected platforms to the
efr32mg21 implementation for `otPlatRadioGetRssi()`, which uses
`RAIL_StartAverageRssi()` instead of
`RAIL_GetRssi()`. `RAIL_StartAverageRssi()` uses hardware to trigger
an interrupt once the RSSI is valid and should provide valid results.
This approach was added by Marven when testing DMP support with
OpenThread (https://github.com/openthread/openthread/pull/4321)
This commit ignores unknown TLVs when parsing a message and continues
to parse the rest parts of the message.
An unknown TLV can cause the simulator to drop the whole packet, which
could lead to packet parsing issues. For example, if a Child ID
Response message is dropped, the dissector will fail to add the Short
Address and Extended Address to the Device Descriptors, causing
subsequent secure packets unable to be decrypted.
This commit updates the public OT `otUdp{}` (like `otUdpConnect`, or
`otUpdSend()`) functions to requires a pointer the OpenThread instance
to be passed as their first parameter (this harmonizes the definitions
with other public APIs and removes the need for `otUdpSocket` to track
the instance).
The core implementation in `udp6` module is updated to define
`SocketHandle` as an internal mirror of `otUdpSocket` structure. The
socket related methods `Open`(), `Bind()`, `Connect()`, etc., are
moved to `Udp` class itself (with a `SocketHandle` passed as a
parameter). For core internal use `Socket` class is defined as a
sub-class of `SocketHandle` and `InstanceLocator` providing same
helper methods. The separation between `SocketHandle` and `Socket`
type addresses the problem that can be caused by the treating/casting
publicly provided `otUdpSockt` objects as `InstanceLocator`.
This commit contains few small enhancements in `Dtls`:
- It renames the `GetPeerAddress()` to `GetMessageInof()` (to indicate
that it returns `Ip6::MessageInfo` and not just peer socket address).
(it also renames the variable to `mMessageInfo` from `mPeerAddress`).
- Declares `Ip6::MessageInfo` to be `Clearable` and uses the `Clear()
method instead of `new` operator to clear the `mMessageInfo`.
- Uses helper methods to set the peer socket address (remove `memcpy`).
This commit removes unused simple `NetworkDiagnosticTlv` sub-types.
For simple TLVs we use helper method to directly parse/append the TLV
from/to a message, so the TLV sub-type class is not needed or used.
This method appends a given array of bytes in hex representation
(`%02x` style) to a `String` object. This method helps simplify the
`ToString()` methods in simpler types (e.g., `Mac::ExtAddress`).
When analyzing the energy mode transitions for a sleepy node, running
the sleepy-demo-mtd app, it was observed that, the current
implementation of the platform radio driver (efr32RadioProcess())
although correct, can be optimized by processing the next received
packet (processNextRxPacket()) before other actions being carried out
in this routine. For example, in a situation where a 802.15.4 MAC Ack
needs to be processed in response to a sent packet, adding this call
towards the end of this routine then delays stack notification (that a
Tx was done) until the next call to efr32RadioProcess().
This commit contains two main changes in `Ip6` modules: `Udp`, `Tcp`,
and `Icmp`. First, it simplifies the `Header` types defining constant
`enum` for byte offset of different fields in the header (these
replace the static methods and avoid use of `offsetof` macro). Second
change is it declare related types in each module as nested types of
the the main class (place them under the namespace of the main type).
For example `Icmp::Header`, `Udp::Socket` respectively replace
`IcmpHeader`, `UdpSocket` types.
This commit:
- Uses the mbedtls API to explicitly fix the number of used curves to
one when using ECJPAKE, as required by Section 3 of
draft-cragie-tls-ecjpake-01.
- Uses the mbedtls API to explicitly remove the Signature Hash
Algorithms when using ECJPAKE.
This commit updates `Ip6::InterfaceIdentifier` class adding new helper
methods to it (e.g., generate random IID, or convert IID to/from a MAC
Extended Address). It also updates the `Ip6::Address` methods (related
to getting/setting/checking IID) to use the `Ip6::InterfaceIdentifier`
type.
The larger change in this commit is to update other core classes and
modules (`Lowpan`, `Mle`, `Settings`, 'AddressResolver', `Child`,
etc.) to use the `Ip6::InterfaceIdentifier`/`Ip6::Address` type and
their new/changed methods.
This commit also adds a new `struct` type `otIp6AddressComponents` to
the public OT API header `ip6.h`. This type represents the components
of a (unicast) IPv6 address, i.e. a network prefix and an IID. The
`otIp6Address` uses the new type as one of its `union` representations
of an IPv6 address.
This commit adds a template `Pool<Type, kPoolSize>` class representing
an object pool. `Message`, `Netif`, and `AddressResolver` classes are
respectively updated to use `Pool` for managing their buffer pool,
external unicast/multicast address pool, and address cache entry pool.
This commit also adds a unit test for the `Pool` class.
The existing Joiner Entrust process is as follows:
- The Joiner sends JOIN_FIN.req and receives JOIN_FIN.rsp from the
Joiner Router.
- The Joiner sets up a 4000 ms timer to receive the JOIN_ENT.ntf.
- The Joiner Router generates the JOIN_ENT.ntf and enqueues it,
setting up a 50 ms timer to send it.
- When the Joiner Router timer triggers it sends the heading message
from the queue ONLY if the previous transaction already
completed. This is done like this because whenever a new
JOIN_ENT.ntf is sent the KEK in the KeyManager is changed, and it's
required to keep it in order to decrypt the CoAP ACK.
This approach presents a couple of issues:
- It blocks the message queue up to the maximum CoAP transaction time,
which can be much longer than the Joiner 4 seconds timeout.
- Even worse, if the CoAP ACK never arrives, no more messages would be
released from the queue, even future enqueued ones.
This commit removes this queue blocking, assuming the risk of an
enqueued JOIN_ENT.ntf being sent before the previous ACK has
arrived. In that case there are two options:
- The previous JOIN_ENT.ntf was not delivered and the previous Joiner
would need to start over the whole Commissioning process again.
- The previous JOIN_ENT.ntf was delivered but the ACK was not
received. This has impact only in the Joiner Router logs.
But even for the first case the chances are very low (a JOIN_ENT.ntf
enqueued to be triggered just a few milliseconds after the first one)
and situation is much better than the previously existing one.
This adds platform support for Silabs EFR32MG1 (series1 Mighty Gecko
with 32K RAM + 64K flash).
A few notes on this commit:
- MG1 cannot fit FTD builds with certain options enabled (like
diagnostics). In testing, I simply removed FTD from build
options. We may want to add this to README
- Most platform files are directly duplicated from MG12
- Only created BRD4151A reference. Suspect Silabs team will want to
add other reference platforms like Thunderboard 1
- Should include latest crypto acceleration changes made by Silabs
team
- This has been tested using RCP and CLI builds both on BRD4151A WSTK
and a custom design based on MG1.
This commit adds code in base radio implementation to emit radio
events to logs, when OTNS is turned on. This is for Silk-OTNS
integration's message visualizations.
This commit adds `UdpSocket::Matches()` to match a UDP socket with a
given `MessageInfo`. This is then used alongw with the newly added
linked-list `FindMatching()` method to find a matching socket from the
list of UDP sockets in `Udp::HandlePayload()`.
This commit simplifies the `Netif` implementation by using newly added
`LinkedList::FindMatching()` methods to search in unicast/multicast
address list for an entry matching a given IPv6 address.
This removes unnecessary open/close calls that were being made when
handling nvm operations.
In a normal mode of operation, the nvm open call should be made only
once during initialization.
The only way these changes could be verified was by building a binary,
flashing it on a node and making sure that the node's network operations
(like forming a network) were okay.
This commit contains the following:
- Remove unused `SendHandler` type and `mSendHandler` variable.
- Follow style guide for `#endif` comments.
- Define `Dtls::State` as private.
- Define DTLS module constant enums as private.
- Ensure `mReceiveHandler` is not null before invoking.
- Inline simple setter `SetSslAuthMode()`.
- Follow style guide for param names in `HandleMbedtlsDebug()`.
This commit adds new methods in `LinkedList` to search in the list for
an entry matching a given entry indicator (specified with a template
`Indicator` type). To use these methods, users are expected to provide
method `bool Matches(const Indicator &aIndicator) const` on the entry
`Type` itself (which is then used to match each entry in the list with
the indicator). This commit also changes the linked-list methods to
use `Find()` internally. Finally it updates the linked-list unit test
to cover behavior of the newly added methods.
This commit contains some smaller enhancements in netif:
- Add method to check if unicast/multicast address is external or
internal (e.g., `IsUnicastAddressExternal`)
- Simplify iteration over (external) multicast addresses and remove
`GetNextExternalMulticast()`.
- Use range-based `for` loop for iteration over external address
arrays.
- Rename `IsUnicastAddress()` to `HasUnicastAddress()`.
- Clarify method documentation specially between internal and
external addresses (how the passed-in address parameter is used,
i.e., copied into another entry from an address pool for external
vs. directly used for internal addresses).
This commit adds a default implementation for otPlatOtnsStatus, which
emits OTNS status messages to log, so that OTNS=1 could be used with
real devices. This is required for the Silk-OTNS integration work, as
Silk will pick up these messages and reroute them to OTNS for
visualization purposes.
This commit tries to reduce expects fails in GitHub actions:
- wait_for only sends command when it's not empty
- increases the default expect timeout from 1s to 3s.
This commit fixes the `LinkedList::Find()` implementation when list is
empty. It also updates the unit test for linked-list to verify the
`Find()` (particularly when it is expected to fail and not find the
entry in the list).
This makes expect run all cli-*.exp and posix-*.exp tests in RCP mode.
New scripts should use the function spawn_node in _common.exp to spawn
new processes. This is compatible with both simulation mode and RCP
mode.
This commit adds a `toranj` test-case covering the commissioning
behavior using a Joiner Discerner:
- Verifies setting and clearing discriminator with different values
and bit-lengths (on a Joiner).
- Verifies commissioning using discerner (and EUI64).
- Verifies that commissioner would prefer a Joiner entry with the
longest matching discerner length.
This commit contains some smaller enhancements in `Mac::Filter`:
- Use C++11 range-based `for` loop when iterating over filter entries
- Define `Filter:Mode` enum (mirror of `otMacFilterAddressMode`)
- Change `Filter::SetMode()` and `otLinkFilterSetAddressMode()` to
return `void`.
- Simplify `Filter::Apply()` implementation.
- Add new separate public OT and internal APIs to set/clear default
RSS-In (e.g., `SetDefaultRssIn()`/`ClearDefaultRssIn()`).
- Return no error (instead of `ALREADY`) from `Filter::AddAddress()`
and its corresponding public `otLinkFilter` API when entry is already
present in the list.
- Do not return `NOT_FOUND` error from `Filter::Remove{Address/RssIn}()`.
- Update public `otLinkFilter{API}` documentation.
- Update NCP and CLI code to adopt new `otLinkFilter` APIs.
This commit introduces one extra parent response rule:
REED doesn't respond parent request if there are already
`kMaxRouters` active routers in the Thread network as it's
for sure that Leader will reject its address solicit.
This commit adds/updates spinel properties to add Joiner Discerner
support on joiner and commissioner side. It also adds support for
getting the list of joiners on commissioner by implementing property
get handler for spinel property `MESHCOP_COMMISSIONER_JOINERS`.
The `otJoinerDiscerner` enables new a mechanism for Thread
commissioning. The traditional Thread commissioning process uses
factory assigned EUI-64 of the device to derive the Joiner ID and
identify/filter a joiner (through steering data bloom filter). The
Joiner Discerner (which is an unsigned value along with a
user-specified bit length up to 64 bits) allows users to have more
control and do not rely on factory-assigned EUI-64.
On joiner side, when a a Joiner Discerner value is provided, the
Joiner code uses the discerner value to derive Joiner ID (appending a
random prefix to extend the value to 64 bits) and bloom filter.
On commissioner side, users can add different joiners providing either
an EUI-64 or an associated Joiner Discerner and the code accordingly
match the Joiner IDs and compute steering data bloom filter.
`spinel.h` and `spinel.c` are soruce files that may be used by host
side drivers and therefore the souurce code itself should not use any
of OT header files. Spienl file provide `SPINEL_PLATFORM_HEADER` to
allow platform to add their own includes if they want to.
This commit adds transmit security support for simulation radio so
that security Enh-ACK could be handled at radio layer. This commit
also fixes issue #5041.
This commit fixes the entry for getter in `ncp_dispacther` for spinel
`SPINEL_PROP_MESHCOP_JOINER_STATE` ensuring it is available in MTD
build as well as FTD when joiner feature is enabled.
This commit uses C++11 `static_assert()` replacing the existing
`OT_STATIC_ASSERT()` macro definitions (intended to support build-time
assertion in C++003 (oder) tool-chains).
This commit adds `OPENTHREAD_CONFIG_LOG_MESHCOP` which enable
MeshCoP modules logging. This replaces the use of MLE log config
`OPENTHREAD_CONFIG_LOG_MLE` for controlling MeshCop logging.
The makefiles are also updated to include the new config when
"FULL_LOGS" option is used.
This commit includes a group of smaller enhancements in commissioner
module:
It adds `FindBestMatchingJoinerEntry()` which finds the best matching
joiner entry preferring an entry with full Joiner ID match over an
entry accepting any joiner.
`AddJoiner()` is changed to first try to find and update an existing
entry matching the given EUI64 before allocating a new entry. This
change in turn removes the need to call `RemoveJoiner()` from
`AddJoiner()` and the use of `JoinerOpFlag` to skip notifying the
leader from the unnecessary remove.
This commit also simplifies updating of joiner expiration timer,
changes the `SendCommissionerSet()` to be `void` (to avoid
`IgnoreError()`), adopts the use of `Ip6::InterfaceIdentifier` type to
store Joiner IID, and adds method `LogJoinerEntry()` to help with
logging of Joiner List updates.
This commit enhances the filtering behavior of Discover Scan. When
filtering is enabled, MLE Discovery Responses with steering data
(bloom filter) not containing a set of bloom filter indexes are
filtered. This commit updates the `DiscoverScanner::Discover()` to
allow filter indexes used for filtering to be optionally specified by
the caller. It can be set to NULL (for default behavior) where the
hash of factory-assigned EUI64 of the device would be used to derive
the bloom filter indexes
This commit enhances `test-005-discover-scan` to cover discover
scan over subset of channels, PAN ID filtering, and joiner only,
bloom filter scan behavior.
This commit adds new class `DiscoverScanner` which implements the MLE
Discover Scan process (moving and simplifying all the code related to
this from `Mle` and `MeshForwarder` into same file/class).
To support CSL on RCP mode, POSIX host needs to know current time on
RCP. This commit adds function to periodically calculate the time
offset between host and RCP so that host can get an estimated RCP time
by adding its current time with this offset.
Add a origin flag to addresses so that applications are able to behave
differently on the type of address (System, SLAAC, DHCPv6, Manual).
Bumping OpenThread API version number.
Signed-off-by: Markus Becker <markus.becker@tridonic.com>
Detected on EFR32MG21 with hardware acceleration turned on, all inside
mbedTLS' library/ecdsa.c:
* Turning on ECDSA signing acceleration (MBEDTLS_ECDSA_SIGN_ALT)
triggers an unused parameter on rs_ctx in
mbedtls_ecdsa_write_signature_restartable
* Turning on ECDSA verification acceleration
(MBEDTLS_ECDSA_VERIFY_ALT) triggers an unused parameter on rs_ctx in
mbedtls_ecdsa_read_signature_restartable
* Turning on both ECDSA signing & verification acceleration
(MBEDTLS_ECDSA_SIGN_ALT + MBEDTLS_ECDSA_VERIFY_ALT) triggers an
unused function error on static function derive_mpi
Looking at the latest mbed TLS development branch, it seems this issue
will not be resolved soon. Therefore, we're turning off warnings for
unused parameters and unused functions inside mbedTLS for the platform
which uses this configuration (EFR32MG21).
Turns on the following:
* SHA256 acceleration on all EFR32 devices (used for SHA256,
HMAC-SHA256, ECDSA and DRBG)
* ECDSA/ECDH acceleration on EFR32MG21 (used in DTLS and exposed to
application through otCryptoEcdsaSign)
* AES-CCM acceleration on EFR32MG21 (in case OT is updated to take
advantage of mbedTLS' AES-CCM API)
* AES-CMAC acceleration on EFR32MG21 (used for PBKDF2)
Awaiting new GSDK release:
* end-to-end EC-JPAKE acceleration on EFR32MG21 (used in DTLS)
An issue occurs when ot-ctl reads the CLI output in multiple chunks in
which the last line of a chunk does not ends with a '\r\n'. The last
line is then dropped incorrectly.
This commit fixes this issue:
- Output the last line (without \r\n) if it's not ">" (have to drop
'>' because we can not determine whether or not to output '>')
- Output ">" if the first char is not ' ' but the previous promptState
is 1 (meaning '>' was dropped previous but should have been
printed).
According to PEP8, constants should be written in all capital letters.
This commit capitalizes these constants:
- thread_cert.TestCase.topology
- thread_cert.TestCase.support_ncp
This commit adds additional mechanism in `toranj` to enable verbose
mode on all nodes by setting the env variable `TORANJ_VERBOSE` (this is
in addition to existing mechanism where verbose mode can be enabled
per node from a test script). When `TORANJ_VERBOSE` env is used to
enable verbose mode, it also enables OT logging on all nodes (OT logs
are collected in the `wpantund-logs<node_index>.log` files along with
`wpantund` logs). This commit also updates the `toranj/README.md` to
describe the new mechanism.
- rename "none" to NO, which computes to false in if()
- sort platform names
- add "posix" into the platform list so that it can be selected from cmake-gui
In options.cmake OPENTHREAD_CONFIG_*EXTERNAL_HEAP*_ENABLE is used,
while in common-switches.mk and the source code the slightly different
OPENTHREAD_CONFIG_*HEAP_EXTERNAL*_ENABLE is used.
Signed-off-by: Markus Becker <markus.becker@tridonic.com>
This commit adds `Notifier::Receiver` class which is inherited by
OpenThread core types/classes to register themselves as a receiver
of `Notifier` events. This change helps simplify and replace the
previous `Notifier` callback model.
This commit adds `Event` enumeration type representing `Notifier`
events (mirroring `OT_CHANGED_{EVENT}` constants). It also adds
`Events` class which represents a collection of events. The `Events`
class provides helper methods to check whether a specific event has
happened, or whether any or all of a given subset of events are
present in the `Events` collection.
This commit also renames the `Notifier` handler method in different
core classes to `HandleNotifierEvents()`.
This `struct` is defined in a C header file and therefore it is not
scoped in a `namespae`. The rename is to avoid name conflicts with
OpenThread core definitions (allowing `ot::Event` to be defined).
- parse TopologyConfig file in Thread Certification Test Harness
- list multi-vendor device numbers by case
- list needed vendor device numbers for the whole certification testbed
This puts the scripts setting up Thread networks into separate files
so that they can be reused by multiple test scripts. After this we can
split the tests in cli-2-nodes.exp into multiple files without having
to repeat codes in each file.
This commit adds a new class `MeshCoP::SteeringData` which manages
the Steering Data and bloom filter generating and filtering. This
commit also adds a unit test `test-steering-data` for the newly
added `SteeringData` class.
This adds expect tests for testing the pcap receiving function of
promiscuous mode. Also makes otLinkSetPromiscuous be called before
otLinkSetPcapCallback so that the callback won't be set when
promiscuous mode fails to start.
In Thread 1.2, it is possible to receive an IEEE 802.15.4-2015
packet. Per specification, receiver should acknowledge this packet
with an IEEE 802.15.4-2015 ACK(Enh-ACK). This Enh-ACK can include
header IE with it and requires security enabled bit in FCF be set to
true. It is impractical for the host to generate the Enh-ACK and send
to RCP for transmission within AIFS time(192us). So RCP should prepare
the Enh-ACK by itself, which requires it to fill in the frame counter
and do the encryption/authentication.
This commit tries to address the need of filling auxiliary frame
counter in RCP by including the following changes:
- Move frame counter related functions from MAC layer to SubMac layer,
which is mirrored in RCP.
- Set mMacFrameCounter to RCP using newly added spinel properties.
- RCP reports last used frame counter to host in TxDone and RxDone.
- Add a simulation test for reset verification.
This adds test cases for child command. Also moves ping tests with 2
nodes to cli-2-nodes.exp, future tests requiring 2 nodes will be
placed in this file.
The leader is authoritative in the operational datasets that it
distributes. This commit ensures that a device becoming a leader
restores the operational dataset from non-volatile. This ensures that
the operational datasets that the leader attempts to distribute are
the same as in its non-volatile storage.
This commit adds new class `Clearable` (inherited by other types)
providing simple implementation of `Clear()` which sets all the
instance bytes to zero (using `memset()`).
This commit adds new class `Equatable` (inherited by other types)
providing overloads of operators `==` and `!=`. The implementation
simply compares all the bytes of two instances of same type to be
equal (using `memcmp`).
OpenThread currently implements a TIME_SYNC IE. The presence of IEs
also affects the frame version and IE present field. This commit
encapsulates the process to update these things so that it could be
easily extended to support other IEs that are introduced later.
Existing implementation only looks at addresses configured on the
network interface to determine what prefixes are on-link (on-mesh for
Thread). When the network interface does not have an assigned address
for a given on-mesh prefix, any packet with that on-mesh prefix will
not be forwarded to the Thread network.
This commit also checks the destination address against Thread's set
of on-mesh prefixes, independent of whether addresses out are assigned
out of the on-mesh prefix.
The leader is the authoritative source when propagating active/pending
operational datasets. When the leader reboots, it is possible for the
leader to become out-of-sync. In particular, after the leader resets,
it restores its network data and active/pending operational datasets
using MLE Data Request/Response to retrieve them from a neighboring
device. If the neighboring device has an older active/pending
operational dataset, the leader will retrieve the older datasets and
never attempt to propagate the newer datasets that it may have stored
locally.
This commit makes the following changes:
- The leader does not accept any changes to the active/pending
operational datasets.
- After retrieving the latest network data from a neighboring device
(as part of resynchronizing after reset), the leader will increment
the full and stable network data versions to ensure that the leader
propagates the latest active/pending operational datasets.
This commit adds a bash script to compile the platform that supports
cmake.
Usage examples:
./script/cmake-build cc1352
./script/cmake-build posix -DOT_MAC_FILTER=ON
- add a new enumeration type `Mode` to indicate the encryption vs.
decryption mode in `AesCcm::Payload()` method.
- add `GetTagLength()` method and simplify `Finalize()`.
- change `AesCcm::Init()` to assert on bad tag length input param
instead of returning `OT_ERROR_INVALID_ARGS`.
- reorder AesCcm member variable to help with alignments
- use CHAR_BIT
- remove check of tag length from Finalize
- use `memcpy`/`memset` to copy/clear buffers
This commit adds new helper static methods in `Tlv` class to read a
(simple) TLV in a `Message` at a given offset. The TLV's value can be
an `uint` type or a fixed length data blob. These methods are used
in ML and network-diagnostics modules, and also internally by other
`Tlv` class methods.
This commit changes the `Tlv::AppendTlv()` value parameter to use
`void *` as its type. This helps simplify its used in different
modules (we can simply pass a pointer to the object that is to be
appended as the TLV's value and avoid casting or conversion to
`uint8_t *`).
This commit renames the helper `static` methods in `Tlv` class. It
harmonizes the naming model to use `FindTlv()` for different flavors
of methods that search within a given `Message` (or buffer) to find a
TLV with a given type. This commit also removes the re-definition of
same `static` methods in sub-classes of `Tlv` class. This helps
simplify the use of such methods and avoids the shadowing of some
flavors of methods due to their re-definition in the sub-class (the
sub-class re-definition allows a more specific TLV `Type` enumeration
parameter to be used, however the base case version will continue to
work due to implicit conversion of `enum` value to an integer).
This commit fixes existing issues in address filters.
- Fix misuse of address filter modes
- disabled should be disable
- Whitelist should be whitelist
- Blacklist should be blacklist
- Fix errors in removing macfilter entries
Impact on 1.1 certification:
This commit does not impact 1.1 certification because only
OpenThread_WpanCtl.py is changed. In 1.1 certification, all golden
devices are controlled by OpenThread.py. OpenThread_WpanCtl.py is used
to control OTBR DUT, and mac filter feature is not useful for a
DUT.
On platforms that have SO_NOSIGPIPE, use that to achieve the same result.
On platforms that have neither, emit a compile-time warning -- you may
still receive the signal on those systems.
This fixes the argument parsing for counters command. The lines
calling otLinkResetCounters and otThreadResetMleCounters are
unreachable and this fixes it.
* add a CLI command for getting the network interface name and index
On some platform (mostly BSDs), we do not have the option to specify
the tunnel name, although most of those platforms do have a way to dynamically
obtain a unique interface name if desired. Add a CLI command -- only enabled
on platforms that have PLATFORM_NETIF enabled -- that will return the
name of the tunnel interface, as well as it's index. Both are useful in doing
automated tests on non-Linux systems.
* remove OPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE from the "check" scripts
This option really only applies to the POSIX "management" applications
(ot-daemon, ot-ctl), and not to the core radio or simulation component
builds (ot-cli, etc).
My other change adds a command ("netif") that is only useful when the
netif code is enabled, and that only happens when the netif code is linked,
which is only in those "management" utilities. Turning this setting off
allows the tests to pass, with no impact to the functionality previously
tested. But if this setting remains on, then my new code creates a
dependency that cannot be resolved outside the management applications.
Chances are that the ot-ctl client exits between read error check and
write. This will lead to a SIGPIPE crash. We can ignore this signal and
check the error code instead.
This commit simplifies the implementation of `GetNextDiagTlv()` by
skipping unrecognized TLVs from `default` case and jumping to top of
the loop for a next TLV, and adding a common `ExitNow()` at the end of
`switch()` statement to handle when a TLV is found and successfully
parsed. This change helps remove the need for `OT_UNREACHABLE_CODE()`
use.
- Existing code assumes security is always enabled in enhanced ack,
however that's not always the case. So add security part only when
it's required.
- FindHeaderIeIndex would return kInvalidIndex when IE is not
present. It's possible that no IE is in an enh ack, so use
SkipSecurityHeaderIndex instead.
This commit helps ensure the following:
- At most one MGMT_ACTIVE_SET.req message is outstanding.
- At most one MGMT_PENDING_SET.req message is outstanding.
In order to enable automated testing of mac OS, we're likely to need
the ability to build for utun instead of tun, so make that option
configurable via external options, and make the default utun, which
will be easier for most developers to use (the caveats are documented
in netif.cpp).
This commit fixes the problem that `whitelist` is not enabled in
commissioning test cases which results in false pass of `Cert_8_2_01`
and `Cert_8_2_02`.
Without this commit, `Cert_8_2_01` and `Cert_8_2_02` will fail if we
turn on `whitelist`, because we now use random extaddress for
discovery requests.
First, deal with the C++ crankiness about a structure defined inside
another structure, but make sure we don't get tripped up if the SDK
ever changes.
Second, macOS should not be using the IN6_IFF_NODAD, as rather than
avoiding DAD, it actually makes addresses remain in the "tentative"
state indefinitely.
This commit adds a new type `otMacKey` which represents a MAC security
key (used by AES-CCM to perform frame security) and core subclass of
this as `Mac::Key`. The same type is used as `Mle::Key`. The
`KeyManager`, `Mac`, `Mle`, and other modules are updated to use the
new `Key` types. The public OT API `otLinkRawSetMacKey` and radio
platform `otPlatRadioSetMacKey()` are also updated to use `otMacKey`.
When Border Router is built with `OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE`
flag and receives the message to its Mesh-Local EID, for a small range of IPv6
lengths, NCP may forward both IPv6 fragments and reassembled packet. This commit
ensures the latter situation does not happen.
After adding and removing addresses, sendmsg call will return EINVAL for
a short period of time. Return INVALID_STATE to inform callers to try
again later.
When the macro `SPIS_AS_SERIAL_TRANSPORT` is enabled,
`UART_AS_SERIAL_TRANSPORT` and `USB_CDC_AS_SERIAL_TRANSPORT`
are disabled, no one uses the argument `aPseudoReset`. The
compiler generates a warning.
In Thread 1.2, it is possible to receive an IEEE 802.15.4-2015
packet. Per specification, receiver should acknowledge this packet
with an IEEE 802.15.4-2015 ACK(Enh-ACK). This Enh-ACK can include
header IE with it and requires security enabled bit in FCF be set to
true. It is impractical for the host to generate the Enh-ACK and send
to RCP for transmission within AIFS time(192us). So RCP should prepare
the Enh-ACK by itself, which requires it to fill in the frame counter
and do the encryption/authentication. This commit tries to address the
need of transmission security/authentication by including the
following changes,
- Move Key ID mode 1 AES-CCM* related functions from MAC layer to
SubMac layer, which is mirrored in RCP.
- Distribute the MAC key and MAC key ID to RCP in posix app using
newly added spinel properties.
- Make it possible for radio(either in radio driver or hardware) to do
transmission AES-CCM* if the platform supports by adding radio
capability OT_RADIO_CAPS_TRANSMIT_SEC.
- Enable this for RCP mode on simulation platform.
This commit adds mac frame util functions to generate acks (both Imm
and Enh acks) from a received frame. These funtions are utils APIs for
platforms which don't provide ack generation.
This commit also introduces compile options for CSL to control the CSL
IE related part.
The arguments of the funtion `otPlatDiagProcess` in posix radio driver
is different from the one defined in the `diag.h`. It causes the diag
module uses the weak definition of the function `otPlatDiagProcess`.
This commit fixes this issue.
This commit relaxes the length check for the last 6LoWPAN fragment of
a message. The length of a 6LoWPAN fragment is truncated to be a
multiple of eight bytes (since fragment offset can be only expressed
as multiples of eight). However this requirement does not apply to the
last fragment. This change helps avoid an unnecessary extra fragment
for messages of certain length.
This commit introduces a few enhancements:
- In NCP architecture forward the IPv6 fragments instead of the full
reassembled IPv6 packet (which in the default configuration can't be
forwarder due to SPINEL limitations). Without this fix the
fragmentation does not work if Thread device wants to send more than
MTU data through the Border Router (to the IPv6 address of NCP).
- Use OPENTHREAD_CONFIG_IP6_MAX_ASSEMBLED_DATAGRAM only for the
receiving path. For transmitting path, relay on the message buffers
pool. This is especially important for some of the use-cases we
have, and also reduce a need for regenerating OpenThread libraries.
- In case receiving IPv6 packet is bigger than supported
OPENTHREAD_CONFIG_IP6_MAX_ASSEMBLED_DATAGRAM, exit before trying to
allocate the next message buffer.
This commit fixes the serious bug when IPv6 fragmentation is
enabled. It is possible that HandleDatagram which is called on
complete reassembly, returns the error (e.g. because ICMPv6 Echo
Response can't be generated due to lack of buffers). In such case both
HandleDatagram method and HandleFragment tries to free the same
message which finally ends up in a crash of the system.
With the current code, it is possible that NCP tries to send IPv6
packet larger than the maximum size of SPINEL command payload.
This commit adds additional defines to spinel.h and proper checks in
NCP codebase.
This commit changes the `Tasklet::Post()` method to return `void`
instead of `otError`. This helps simplify its use. The error indicated
whether the tasklet was already posted and was always ignored
(required `IgnoreError()` when posting tasklets). `IsPosted()` method
can be used to determine this when/if needed.
The code coverage data generated by ./script/test build expect will be
erased by VIRTUAL_TIME=0 NODE_MODE=rcp ./script/test clean build
expect's clean step, causing coverage less than actual value. This
adds an upload step after the first run to avoid the data loss.
This commit fixes key_id_mode handling and added exception handling
when key_id_mode is 0.
According to IEEE Std 802.15.4-2015, when Key Id Mode is 0x00:
Key is determined implicitly from the originator and recipient(s)
of the frame, as indicated in the frame header.
Our test scripts cannot handle such packets. If we leave key_id_mode =
0 case unhandled, we would get some exceptions that may cause
developers to think that something is wrong. However dropping packets
in this case is a normal behavior.
With clang older than 3.9, the warn_unused_result feature works only
with functions and classes, not enums. This disables it if the clang
version is too old.
* use an older version for better compatibility
* add version to project
* only use cpack when OpenThread is the top-level project
* exclude posix apps when BUILD_EXECUTABLES is OFF
* exclude all third_party
Thread 1.2 spec requires prioritizing DUA in Address Registration TLV
to ensure DUA could be stored in the limited addresses space for Child
on the parent.
Another PDU Controller used to power cycle between tests. Based by
SNMP protocol. To use EATON_PDU_CONTROLLER is needed PySNMP module
(added to requirements.txt). Also extend settings_sample.py by
comments with needed parameters to create EATON_PDU_CONTROLLER.
Thread specification requires the source address of Discovery Request
to be random value. While for subsequent messages, the joiner should
use hash of EUI-64 (joiner ID) value.
This commit adds a max power table for POSIX platform, which can
customize the max allowed transmit power of each channel with the
command line argument --max-power-table.
This commit includes
[Y] add `OPENTHREAD_CONFIG_DUA_ENABLE` option for DUA feature
[Y] generate DUA via SLAAC
[Y] update test script to verify communication via DUA
- Remove the unnecessary MGMT_COMMISSISONER_SET.req sent by
Commissioner to Leader when a Joiner is removed only to be added
back.
- Use proper error codes for MleRouter::HandleDiscoveryRequest
This commit adds a check in `Mac::ProcessReceiveSecurity()` to verify
that the Security Level in the received frame is properly set to
`kSecEncMic32` before trying to decrypt and validate the frame. This
helps avoid performing AES-CCM when frame is invalid and also avoid
potentially reading beyond the frame length when checking MIC/footer.
When OT is initialized after boot, finalized, and initialized again
without reboot, assertion in SubMac::Enable is triggered. The reason
is that SubMac::Disable is never called during finalization and
platform radio is in unexpected state.
- Update all test cases to inherit thread_cert.TestCase and update
topologies accordingly. The topologies should all be correct because
they are automatically generated, not hand written.
- Use default Thread version: 1.1
- Cleanup node tmp files in tmp directory according to the current
PORT_OFFSET in setUp. This is required by
test_reed_address_solicit_rejected.py and test_coap_observe.py since
they define multiple test functions in one TestCase.
- Removed call to set_extaddr64 because it's not necessary and causing
failures.
This code does the following:
- provides an implementation to manage networking notices from a PF_ROUTE socket,
instead of (the Linux-specific) PF_NETLINK
- breaks out some of the platform-specific mechanisms for configuring a tunnel
device (Linux, mac OS, and NetBSD are all different in some ways)
- provides handling of I/O to the tun drivers on BSDs (where there's a 4-byte
header prepended to identify the IP version)
- adds some debugging info and more deliberate error handling (I suspect
there are some more OpenThread-friendly ways to do some of the
debugging, but I didn't try to figure them out)
This change is to address some warninings present on the ti-cgt
toolchain. Code after a while(true) loop or an unconditional jump
results in a dead code warning.
An out-dated EID-to-RLOC map cache may lead a device to send an IPv6
datagram to a device that does not have the IPv6 Destination Address
assigned to its interface. However, the existing implementation would
not send back an ICMPv6 Destination Unreachable message necessary to
invalidate the originator's EID-to-RLOC cache entry.
This implementation adds reachability checks on the mesh destination
receive path to ensure that reachability checks are performed in the
above situation.
This commit allows users to specify the mbedtls target by a
OT_EXTERNAL_MBEDTLS option.
The native cmake build system of mbedtls is not so "modern" (for
backward compatibility, it maybe hard to change it soon) and
applications using mbedtls are likely to write wrapper cmake files and
targets by themselves.
This commit adds new helper methods in `Mac::Frame` to calculate the
size (number of bytes) of headers or security MIC. These are used by
different methods to simplify the code and avoid repeated patterns:
- `CalculateAddrFieldSize(aFcf)` to calculate the size of Address
Fields given a Frame Control value.
- `CalculateSecurityHeaderSize(aSecurityControl)` to calculate size
of Security Header given a Security Control value.
- `CalculateMicSize(aSecurityControl)` to get the size of MIC given
a Security Control value.
This commit contains a group of smaller enhancements/simplifications
in `Dataset` modules:
- Add helper `GetTlvsStart()` and `GetTlvsEnd()` to get start/end
of Dataset TLVs sequence.
- Use `for` loop when iterating over TLVs.
- Simplify `RemoveTlv()` to get a pointer to TLV as input
- Remove single-use local TLV variables (in switch statements).
- Simplify `DatasetLocal::Compare()`.
This commit directly updates the `mLength` from `InitMacHeader()` as
it prepares the frame header (instead of setting it at the end).
This ensures that `InitMacHeader()` can safely call other `Frame`
helper methods (e.g. `GetFooterLength()` which itself does check
the frame length).
This commit updates the nvm3 support implementation to use the nvm3
default instance instead of creating a separate nvm3 instance. This
approach enables us to share the nvm3 system using a single default
instance between OpenThread and any other stack or application used
along with OpenThread.
This commit also adds the otPlatFlash* APIs back in flash.c that were
incorrectly removed in a prior commit. These APIs are required when
using the default NV system.
This commit changes the way to define RCP bus type. It now defines two
enumerations for UART and SPI. This ensures only a single bus type is
enabled, and helps keep compatible with projects using UART bus.
This commit adds helper method `MeshCoP::Tlv::FindTlv()` to search
within a given sequence of TLVs for a specific TLV type. This is used
to simplify `Dataset::GetTlv()` and provide a template version
`GetTlv<TlvType>()`. This commit also adds new flavors of `SetTlv()`
for simple TLVs, i.e, TLVs with a single value which is either an
`uint16_t` or `uint32_t` value or can be treated a data blob.
The nRF52811 is designed to work in RCP architecture where DTLS is
established on the host level. The nRF52811 doesn't support Joiner or
Border Agent roles. This commit enables nRF52811 to use default heap
size to save RAM.
This change refactors radio-spinel into a platform independent
header-only library so that other platforms (baremetal/RTOS) can
enable Thread with RCP mode as well.
Currently, a REED which expects to become Router soon does not send
any SVR_DATA.ntf. This commit handles rejecting ADDR_SOL.rsp to allow
REED to send SVR_DATA.ntf after it is rejected.
This commit contains multiple enhancements in `Dataset` modules. It
adds a new enumeration `Type` to specify the type of a Dataset
(active or pending). It also renames the methods that get or a set a
TLV within the dataset to `GetTlv()` and `SetTlv()`. It also renames
methods converting the TLV format to/from an `otOperationalDataset`
structure. With the renames, we can remove the re-definition of
`Get<Type>()` method (since no longer being shadowed by other
definitions). Finally this commit updates some of the method
documentation.
This commit enhances some utility functions in mac frame for frame
parsing and adds some basic testing.
- Currently the mac frame parsing only doesn't include the rule for
version 2015. This commit adds the parsing of dstPanId for 2015
frames.
- This commit adds some helper function dealing with Security Header
so that later commit of CSL and setting security header in enhanced
ACK would be easier.
This commit adds and uses a new method `SetToLinkLocalAddress()` in
`Ip6::Address` class which sets the address to a Link-Local IPv6
address with a given Interface Identifier (either given directly or
generated from a MAC Extended Address).
It also adds methods to set the address to a Routing/Anycast Locator
and updates methods checking RLOC/ALOC addresses. It adds a common
`IsIidLocator()` to check if the IID matches the `0000:00ff:fe00:xxxx`
pattern. More specific checks for RLOC or ALOC can be done by
`IsIidRoutingLocator()` or `IsIidAnycastLocator()`. The `Mle` and
other modules are updated to use the new/updated methods.
This commit adds methods to set an `Ip6::Address` to common multicast
addresses, link-local all-nodes/all-routers, realm-local all-nodes/
all-routers, or realm-local all MPL forwarders. The implementation
uses the constant addresses defined in `Netif` class.
This commit adds a common private `Iterate()` method which is used by
other methods iterating over different types of entries:
`GetNextOnMeshPrefix()`, `GetNextExternalRoute()`, `GetNextService()`,
and `GetNextServer()`. It also adds methods to help advancing the
iterator to next TLV or sub-TLV or entry index.
This commit adds a new test-case to `toranj` which verifies Network
Data update and version changes (stable only vs. full version).
The test creates a simple network of a leader with 3 children where
one of the children is SED and is configured to request only stable
Network Data. The test covers the following:
- Adding/removing prefixes (stable or temporary) on the first child.
- Verifying that Network Data is updated on all nodes accordingly.
- Ensuring correct update to Network Data version and stable version.
The above steps are then repeated over many different situations:
- Where the same prefixes are also added by other nodes.
- Or the same prefixes are added as off-mesh routes by other nodes.
This commit changes the model for updating Network Data on a leader.
It adds `ChangedFlags` type which is used to track whether full or
stable version of Network Data gets changed as TLVs/sub-TLVs are being
added or removed. This is then used to update version and stable
version accordingly.
When registering new received Network Data on the leader, the new
model updates the Network Data in place. First, newly added
`Validate()` method is called to verify that the received Network Data
contains well-formed TLVs and sub-TLVs (e.g., no duplicate
Prefix/Service TLVs) and all sub-TLVs/entries match the sender's
RLOC16. Then, all entries in the current Network Data associated with
the sender's RLOC16 which are not present in the newly received data
are removed. Afterwards, any new entry in the received Network Data is
added. This approach helps simplify the code and ensures existing
TLVs/sub-TLVs remain as before (e.g., no need to keep a copy of
previous data to ensure same Service IDs are used when adding/removing
Service TLVs).
This commit also adds `UpdatePrefix()` and `UpdateService()` methods
which ensure a Prefix or Service TLV is marked correctly as stable or
not depending on its sub-TLVs (e.g., if all stable sub-TLVs are
removed the enclosing TLV is marked as not stable).
This commit includes:
- cache domain prefix in the Thread Network
- subscribe/unsubscribe AllDomainBBRs Multicast address
- update test to cover AllNetworkBBRs and AllDomainBBRs subscription
If this feature is enabled, OpenThread will automatically disable
link-level security for packets sent with unsecure source ports. Once
a secure packet is received on the unsecure port, this port will be
removed from the unsecure port list.
This commit updates the `ServiceTlv` implementation and its use.
- Set the `ServiceTlv` fields through a new `Init()`
- Use union for managing presence of Enterprise Number fields
- Add static helper `GetSize()` to get the size of a Service TLV
with a given Enterprise number and Service Data length.
- Add `ServiceTlv::kThreadEnterpriseNumber` constant replacing the
`THREAD_ENTERPRISE_NUMBER` definition.
This commit fixes situation when Commissioner can't be turned on or off,
due to incorrect state of the Border Agent.
In order to fix it:
- a new COMMISSIONER state in the notifier module has been introduced
- Border Agent API is not colled from the commissioner_api.cpp file
This commit declares methods, input parameters, and local variables as
`const` whenever possible in `NetworkData` modules. `const` versions
of methods (returning `const` pointer) are also added, e.g.,
`NetworkDataTlv::GetNext()`, `HasRouteTlv::GetFirstEntry()`,
`NetworkData::FindTlv()`, etc. For simpler (inline) methods, the
`const` version is directly implemented but for more complex methods,
the const version is the main implementation (defined in `cpp` file)
and non-`const` version is implemented using `const_cast` conversions
from the `const` method.
This commit also declares methods not using any member variable/info
as 'static' (e.g. `FindHasRoute()` or `FindContext()`). It also
declares `RemoveTemporaryData()` flavors removing internal sub-TLVs as
`private` (instead of `protected`) and fixes the logging in
`RemoveTemporaryData()` using input `aTlvs` now instead of `mTlvs`.
elem.txt might be null when the required reference devices could not
be met (either due to the quantity or the type) for specific test.
perform() will throw exceptions if elem.text is null since Chrome and
chromedriver 80. If elem is not shown in current case list window,
move_to_element() will not work either.
This commit defines a new enum type `Mle::DeviceRole` mirroring the
public `otDeviceRole` enumeration. The enumerator in the new type
follow `kRole{Value}` style and intended for use in the core modules.
It also adds helper method in `Mle`, `IsChild()`, `IsRouter()`,
`IsLeader()`, etc to check the current device role.
This commit centralizes the timing logic for transmitting SVR_DATA.ntf
messages that are used to update network data at the leader.
This component helps ensure the following:
- At most one SVR_DATA.ntf message is outstanding at any given time.
- A timer to rety sending SVR_DATA.ntf messages if sending fails due
to lack of memory buffers.
- A timer to rate limit SVR_DATA.ntf messages that are acknowledged
but no corresponding change in the Thread Network Data was observed.
- Utilizes ot::Notifier to trigger logic on role, child state, and
network data changes.
This commit changes the `test-039` to add delay between the initial
message tx to stagger the address query send times. This helps verify
the query timeout behavior.
This commit simplifies the model for iterating through a linked
list by using a `prev` pointer as the iterator variable. This helps
fix an issue with the `prev` pointer not staying valid when entry
is removed from the list during iteration.
This commit contains the following changes in `NetworkData::Leader`:
- Simplify methods (`RemoveContext()`, `UpdateContextsAfterReset(),
`FindServiceById()`, `RemoveRloc()`, etc) to use `FindTlv` when
searching for TLVs of a given type.
- Removes redundant checks in `RlocLookup()`.
- Uses pointer to iterate through `BoderRouterTlv` or `HasRouteTlv`
entries.
- Move simple getter/setter methods to header file (to be inline).
- Move variable decelerations into inner scopes when possible.
The existing MeshForwarder::RemoveMessage() implementation is specific
to evicting messages from mSendQueue. This commit generalizes the
method by retrieving the queue from the message itself.
This commit replaces `IncrementStableVersion()` with a new method
`IncrementVersionAndStableVersion()` which increments both version and
stable version. It helps simplify its use by other modules and also
ensures stable version is not updated without version. This commit
also adds a common private `IncrementVersions()` used by other methods
in `NetworkData::Leader`.
Currently there are four similar copies regarding Router Id set
separately in 1) RouteTlv in mle_tlvs.hpp; 2) ThreadRouterMaskTlv in
thread_tlvs.hpp; 3) RouterIdSet in router_table.hpp; 4) RouteTlv in
network_diagnostic_tlvs.hpp.
This commit extracts the common RouterIdSet class and apply it in the
four components, meanwhile keep one copy for RouteTlv and
ThreadRouterMaskTlv process in route_table.
A parent is responsible for removing stale child entries from the
network data. The existing implementation only triggered a
SVR_DATA.ntf message when new network data is received. In some cases,
the SVR_DATA.ntf message may not be sent due to rate limiting or lack
of message buffers.
This commit turns this process into a periodic check to ensure that
stale child entires are removed even if a failure in sending the
SVR_DATA.ntf occurs.
The existing implementation only considered the forwarding queue when
looking for a message to evict. This ignores message buffers that may
be buffered in other message queues.
This commit adds the ability to evict messages in the address resolver
queue. The lowest priority message from either the forwarding or
address resolver queue is selected for eviction.
This commit changes the `test-602-channel-manager-channel-select` to
wait for sample count to reach a limit (within a wait interval). This
should help make the test more robust (e.g., in RCP/POSIX mode) when
the simulation processing time may require more time (note that this
test is run with very high speed-up).
This commit is to support OTNS by:
- raising the max number of simulating nodes to 999 if OTNS=1
- implementing the status-push mechanism
To build:
$ make -f examples/Makefile-simulation OTNS=1
This commit should have no change of OpenThread behaviors on platforms
except simulation.
This commit expands the `SPINEL_PROP_THREAD_ADDRESS_CACHE_TABLE`
property format to include more info about address cache table. This
change keeps the definition backward compatible by not changing
existing format and only adding new (optional) fields.
This commit updates the public OpenThread APIs to get the address
cache table. The new APIs allows to iterate through all entries
(including in query or retry mode) and provides more info about the
entries, e.g., current timeout, retry delay (if entry is in
query/retry state), or the mesh-local EID, last transaction time (if
entry is in cached state).
This commit adds a new helper method `LogCacheEntryChange()` which
logs any change (entry added/removed/updated) and its reason in
address cache table.
This commit contains multiple enhancements in `AddressResolver`:
Cache entries are stored in different lists: Cached list (entries in
use), query list (entries actively querying and waiting for address
notification response), query-retry list (entries in delay wait mode
due to prior query failing to get a response), and snooped list
(entries discovered through received message inspection aka snoop
optimization). Singly linked list is used which helps keep the entries
sorted based on the order of use (whenever a cache entry is used to
resolve an address, it is moved to the head of the list). This
replaces and simplifies the aging model.
This commit updates the cache entry class definition to use `union`
for member variables (like timeout or transaction time) that are tied
to entry being in different lists. This help reduce the memory
requirement for cache table.
This commit also adds a new mechanism to manage snooped entries. When
a new snooped entry is added, we do not allow it to be evicted for a
short timeout. This allows some delay for a response message to use
the entry (if entry is used it will be moved to the cached list). If a
snooped entry is not used after the timeout, we allow it to be
evicted. To ensure snooped entries do not overwrite other cached
entries, we limit the number of snooped entries that are in timeout
mode and cannot be evicted by a (build-time configurable) threshold.
This commit changes `LinkedList::PopAfter()` method to accept a
pointer to a previous entry as a parameter. If the previous entry
pointer is NULL the entry at the head of the list is popped.
Thread 1.2 test harness requires the ability to set the number of IP
address the parent could store per child to test the reaction of the
Child DUT. The value intentionally may not conform to the Conformance
Specification. Since it is only used for reference device, this commit
wraps relevant APIs in the OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
macro.
Listen for mld reports sent by kernel to capture user multicast group
join and forward the addresses to OpenThread interface.
See openthread/wpantund#444 for more background.
This commit changes the `start.sh` script to remove the check for the
environment variable (which is specific to travis) before allowing
retry of failed tests. This should help with robustness of the tests
on GitHub Actions.
This commit contains the following changes in `NetworkData` modules:
- Add helper `FindTlv()` and template version `FindTlv<TlvType>()`
methods to search within a sequence of TLVs to find a TLV with a
given type (and/or stable status).
- Add methods to help with iterating over Network Data content
(`FindTlv`, `IterateToNextTlv()`, etc).
- Add `AppendTlv()` and `RemoveTlv()` helper methods to simplify
adding and removing of entire TLV from Network Data.
- Change `PrefixMatch()` to use `Ip6::Address` method.
- Simplify and fix `RemoveTemporaryData()` (use cast to get the
sub-TLV during iteration).
- Simplify `GetNextServer()` implementation to use other methods to
iterate over all on-mesh prefix, external route, and service
entries in Network Data.
- Simplify the `Local::UpdateRloc()` implementation.
- Add `Local::AddPrefix()` and `Local::RemovePrefix()` methods to
share common code for adding on-mesh or external route entries.
- Add helper `GetTlvsStart()`/`GetTlvsEnd()` to get the start/end
of Network Data TLV sequence.
A router coming out of reset sends a Link Request to re-establish its
router role and links to neighboring routers. The existing
implementation only responds to such Link Requests when a valid
neighbor entry is found. This check is too strict and can cause
partitions to remain for a couple minutes. The Thread Specification
only requires a router to check that the Router ID is currently
allocated.
This commit updates the implementation to be conformant with the
Thread Specification and allows routers coming out of reset to
resynchronize even when a neighboring router has detect a link
failure.
This commit improves usability of Network Diagnostic API by:
- Define native structures to represent various Network Diagnostic TLV
values.
- Add facility function otThreadGetNextDiagnosticTlv to parse plain
otMessage into structured data.
- Dump parsed DIAG_GET.ans/.rsp message in readable format for
networkdiagnostic CLI command.
- Introduce BACKBONE_ROUTER option for Backbone Router function.
- Implement Backbone Router service registration.
- Add basic Backbone Router service.
- Primary Backbone Router restores its Dataset when reattached after
short reset, increases sequence number and re-register to Leader.
- Add configurable jitter for Backbone Router service registration.
- Add Backbone Router service test.
This commit moves the OpenThread core config definitions (like
`OPENTHREAD_CONFIG_LOG_OUTPUT`) from the `CMakeLists.txt` file into
the `openthread-core-posix-config.h`. This help allow a project/user
specific config header file to override the default config definition
(e.g., toranj config for posix).
This commit improves the flash implementation robustness to power
failure. The idea is the following:
The Init method now checks if a record has been partially written by
seeing if the kFlagAddBegin flag is set, but the kFlagComplete flag is
not. In this case, Init stops incrementing mSwapUsed. The new
SanitizeFreeSpace method checks the (supposedly) free space, to see if
it is writeable. If it isn't, it triggers a Swap, which sanitizes the
flash area.
Commissioner should not call SetState(OT_COMMISSIONER_STATE_DISABLED)
directly, rather it should call Stop() so that joiners and resources
are cleaned up.
This commit:
- Fixes the above issue.
- Adds argument name /* aResign */ to Stop() calls.
- Ignores petition/keep-alive response if commissioner is not in
PETITION/ACTIVE state.
- Calls CoapSecure::Stop when Start fails (suggested by @bukepo).
- Responds to Leader Petition Response (accept) by sending
KeepAlive(reject) if commissioner is in disabled state.
This commit changes the return value of subscribing a pre-defined
address when it's already subscribed. Now returns OT_ERROR_ALREADY
instead of OT_ERROR_INVALID_ARGS.
This commit adds platform specific config header for simulation
and posix platforms for toranj. The common configuration definition
stay in the `openthread-core-toranj-config.h` and are shared for all
platforms. The `build.sh` script is also updated to pick the correct
platform-specific config header for both cmake or autoconf builds.
- Fully erase the swap region (not only the first page in swap).
- Remove waiting loop after MSC_ErasePage. The SDK MSC functions
already wait for the operation to finish.
- Avoid unlocking the flash before the actual write/erase
operation. The SDK MSC functions already do the unlock/re-lock when
needed.
This commit adds `Coap::MessageQueue` class as a subclass of generic
`ot::MessageQueue` as a queue of `Coap::Message` only. This type is
used in `coap.cpp` helping simplify the code (by removing the type
casting).
`mbedcrypto` target is only available when `OT_BUILTIN_MBEDTLS` is set,
therefore linking it unconditionally when external mbed TLS instance is
used results in a linking error.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit changes the handling of timer for CoAP response queue to
ensure that correct dequeue time is used. The existing code assumed
that entries in the queue would be in order of their dequeue time (due
to exchange lifetime being fixed). With the addition of configurable
CoAP tx parameters feature, this is no longer valid. This commit
changes the code to restart the timer with the earliest dequeue time.
Also when evicting a message from the queue (due to the number of
entries reaching the max limit of `kMaxCachedResponses`) we now search
and find the message with earliest dequeue time to remove (instead of
removing the entry at the head of queue).
This commit initializes _initialized of Node before doing
initialization. Otherwise, we will have an AttributeError in
desctructor when initialization fails.
This commit adds `LeaderData` (subclass of `otLeaderData`) to store
the info from Leader Data TLV. It also adds `ReadLeaderData()` to
read Leader Data TLV from a message.
This commit contains all the new files required by the JN5189 platform as well as
the implementation of the platform files required by OpenThread.
Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
This commit adds a new method `SetPrefix()` in `Ip6::Address` class to
allow the prefix in an IPv6 address to be updated. Unit test
`test_ip6_address` is updated to verify behavior of new method. The
`Mle` and `Lowpan` classes are updated to use the new `SetPrefix()`
method.
- Use cmake to build.
- Use rcp instead of transceiver simplicity.
- Add virtual time options for cmake.
- Enable readline support for posix apps.
- Use ninja instead of make.
This commit adds a new OpenThread specific `OT_ASSERT()` macro along
with a new config OPENTHREAD_CONFIG_ASSERT_ENABLE option which allows
the assert to be enabled or disabled. This allows a release build to
consider disabling the assert reducing code size. This commit also
adds a new travis (simulation platform) build with asserts disabled.
This commit simplifies the `JoinerRouter` implementation. It moves
`JoinerEntrustMetadata` as a private inner type of `JoinerRouter`. It
also changes how the tx of Joiner Entrust is delayed. Instead of
preparing the message (and appending metadata to it) and enqueuing it
to be sent later after a delay, only the metadata is saved and the
Joiner Entrust message is prepared after the delay (when it is being
sent).
This commit improves MultiFrameBuffer so that MultiFrameBuffer can
reserve a space in front of the frame. SPI interface uses
MultiFrameBuffer to store received frame directly, which avoids
copying data from receive buffer to MultiFrameBuffer.
By default, Ubuntu or Debian based "apt" or "apt-get" system installs
recommended but not required packages.
By passing "--no-install-recommends" option, the user lets apt-get
know not to consider recommended packages as a dependency to install.
This results in smaller downloads and installation of packages.
Signed-off-by: Pratik Raj <rajpratik71@gmail.com>
This commit changes the test to wait till network data is updated
on `r1`, `r2`, and `sed2` nodes and they all see all the added
off-mesh routes (instead of waiting for fixed 0.5 seconds).
This commit changes the processing of the following TLVs: RLOC16,
Thread Status, Thread Last Transaction Time, Thread Extended MAC
Address, Thread Target, and Mesh Local EID.
This commit changes the processing of the following MLE TLVs:
SourceAddess, Mode, Timeout, LinkFrameCounter, MleFrameCounter,
Address16, LinkMargin, Status, Version, PanId, XtalAccuracy, ScanMask,
NetworkData, Challenge, Response, and TlvRequest.
This commit adds helper static methods in `Tlv` class to directly read
the value of simple TLVs from a `Message`, or append a simple TLV to a
message. The simple TLVs are the ones with single unsigned integer
value (e.g., MLE Frame Counter TLV, MeshCop Scan Duration TLV, etc),
or a value that can be treated as an array of bytes (e.g., MeshCop
PSKc TLV, etc).
This commit adds enhanced frame pending feature of Thread 1.2. This
requires the platform radio driver to correctly set frame pending bit
for Data frames and MAC Data Request frames.
In MleRouter::RestoreChildren() there is an iteration over all
ChildInfo items. This iterator uses mIndex which is uint8_t and in our
case its value wraps causing infinite loop. Changing mIndex to
uint16_t fixes this issue.
This commit changes the `CMakeLists.txt` for posix host platform to
allow the OpenThread config header file to be specified through the
`OT_CONFIG` option. Similar to other platforms, if no config header is
provided the platform can choose to provide a default one (in the
posix host case we use "openthread-core-posix-config.h" as the
default).
- Removed OpenThread's default CoAP configuration macro, because they
are fixed values by Thread spec.
- Use 32bit multiple only to detect overflow of application CoAP
transmission parameters.
- Added documentation describing conditions of valid CoAP transmission
parameters.
This commit increases readability of RouteTlv APIs, such as uint8_t
GetRouteCost(...). The argument of GetRouteCost is the index of route
in mRouteData, but not the Router ID.
This commit contains no logic changes.
* [coap] Add option scanning functions
In a few places in the OpenThread code-base, the following construct is
seen:
```
otCoapOptionIterator iterator;
otCoapOptionIteratorInit(&iterator, message);
for (const otCoapOption *opt = otCoapOptionIteratorGetFirstOption(&iterator);
opt != NULL;
opt = otCoapOptionIteratorGetNextOption(&iterator))
{
if (opt->mNumber == OT_COAP_OPTION_DESIREDOPTION)
{
doSomethingWith(opt);
break;
}
}
```
or its equivalent. In cases where multiple options are sought, the
above is still the better approach (using a `switch` statement), but
otherwise this seems repetitive.
`otCoapOptionIteratorGetFirstOptionMatching` basically implements the
above loop, returning the first option that matches. This same code can
also be used for testing for presence too by comparing the resultant
pointer to the `NULL` singleton.
For completeness in cases where a software developer may want to
*resume* looking for further matching options,
`otCoapOptionIteratorGetNextOptionMatching` is also provided.
* [coap] Add function for decoding Uint options
To properly implement features such as RFC7641 and RFC7959, one must be
able to decode unsigned integer options. It seems silly to have an
encoder but not a decoder, so here is the missing piece.
Future considerations may be a `uint32_t` version since the majority of
use cases do not call for a `uint64_t`; the type was chosen since it was
the most general case.
* [coap] Reference the RFC for the Observe option.
For the sake of completeness, reference the relevant RFC in the
documentation so that developers can read up more on how it should work.
* [coap] Add mObserve flag to metadata.
When we're implementing observations, a few exceptions to the usual CoAP
conventions apply, notably:
- when we receive the initial reply, the request is _not_ finished, we
will receive subsequent requests until we tell the server to stop.
- when we send a confirmable notification, the observing client will
reply with an `ACK` with no further traffic: we need to differentiate
this from an empty `ACK` to a request meaning we should expect a reply
later.
While we could just repeatedly scan for the `Observe` option on the
request, that is wasteful in terms of processing time. This allows us
to scan the request just once, and set a single-bit flag to save
processing later.
* [coap] Don't expect traffic after ACK to notification
If the client sends an empty `ACK` in reply to a confirmable RFC7641
notification, we will _NOT_ see further replies with additional
information. Consider the notification as acknowledged and pass the
details back to the application.
* [coap] Pass through notifications to handler
Ensure that all notifications sent by the CoAP server are passed back to
the application's CoAP request handler. When we receive the first one,
the request continues -- it does not finish until the server drops the
`Observe` flag or we tell the server to stop.
* [coap] Disable expiry timer once subscribed
If a request carries `Observe=0` and we receive the first reply, ignore
future time-out events as the transaction will finish only when
explicitly terminated.
* [coap] Support eager subscription cancellation
A CoAP client may signal its intention to unsubscribe from a resource by
sending a `GET` request with a token matching that of the original
request and setting the `Observe` option to the value 1.
In the event the application does this, we should pick this up and
cancel the pending transaction locally. The handler will be notified of
this by a final call where `aError=OT_ERROR_NONE` and no message given.
* [cli] Add RFC7641 support to CLI example
As an aide to those developing code that uses RFC7641, implement an
example client and server that supports this feature.
When SPI is already interrupted before select(), the wait timeout will
be set to 0, and select() will return 0 immediately if there are no
new events. As a result, cause an incorrect OT_ERROR_RESPONSE_TIMEOUT
error.
This commit fixes this issue by check if data is ready before checking
the select() result.
This commit enables building OpenThread deb packages:
* openthread-simulation: simulation of OpenThread
* openthread-daemon: daemon of OpenThread Host
* openthread-standalone: standalone binaries of OpenThread Host
This commit updates parent selection rules according to Thread 1.2
Specification section 4.5.2.1, which supplements serveral Child Impacting
rules to existing rules defined in Thread 1.1 Specification.
These additional rules are not wrapped by `OT_THREAD_VERSION_1_2'
macro as Thread 1.1 has no restrictions regarding introducing extra rules.
This commits contains the following changes:
- Declare `Metadata` as a private inner class of `CoapBase`. Also
replace constructors with `Init()` method and removes the default
empty constructor (since it is not needed).
- Add `ResponseMetadata` as private inner struct in `ResposeQueue`.
- Simplify `ResponsesQueue::FindMatchedResponse()`.
- Declare `CoapBase::Sender` as a protected type.
- Use initializer list in `CoapBase` constructor.
- Use `for` loop for iterating over messages in a message queue.
- Define `ResponseHandler` and `RequestHandler` types.
- Update `TxParameters` class. Add helper method for common
calculation of span window, and remove unused constant definitions.
- Move more complex method implementation from header file into
`cpp` file (helps reduce code size).
- Update comments and documentations.
This commit introduces the first Thread 1.2 feature - enhanced keep
alive.
This commit also introduces the build config
OPENTHREAD_CONFIG_THREAD_VERSION to include/exclude Thread 1.2 code.
When RCP fails to respond in time, it usually means RCP is stuck or in
some bad situations that can only recover by hardware resetting. This
commit changes the behavior on RCP timeout so that RCP can be reset
during the host daemon restarting.
This commit moves openthread-system.h to a directory named openthread
so that projects depends on OpenThread can use it without installing
OpenThread project.
This commit assists the previous commit to help to remove invalid
server entry in some extreme scenario, for example if child server
switches parent in a Thread Network with packet loss, and
a) SRV_DATA.ntf from the old parent to deregister fails
b) the first attempt of SRV_DATA.ntf from the child fails
When the child tries to resend SRV_DATA.ntf due to network data inconsistence,
there will be no old rloc16, that is, the network data may have invalid server entry.
Though previous commit introduces the invalid child server detection when there is
new network data, however if the deregister there fails and there is no new
network data further, there is chance there invalid server entry would
stick there.
Here provides one invalid child server detection and recover mechanism
according to the ALOC destined traffic.
`UpdateRloc()`, which happens before checking network data consistence,
should not `ClearResubmitDelayTimer()` to guarantee the DATA_RESUBMIT_DELAY
before resending when there is inconsistence.
This commit helps to reduce unnecessary CoAP retransmission when rloc
changes. When comes to SRV_DATA.ntf, it also helps to avoid invalid
network data registration. Take the issue reported in #4472 as example,
in a Thread Network with packet loss, the child server may switch parents
frequently, there might be cached SRV_DATA.ntf including old rloc16,
both the cached one and new one might be sent after switched, causing
Leader improperly contain two server entries in the Network Data.
Per RFC 7252:
- Treat invalid token length as a message format error.
- Rejecting a Confirmable message is effected by sending a matching
Reset message and otherwise ignoring it.
There may be some bug in automake when computing dependencies,
causing output error messages as following when installing:
```bash
/bin/bash: t: command not found
```
This issue is introduced in #4558.
This commit changes the `Neighbor` class (and therefore its sub-classes
`Child` and `Router`) to inherit from `InstanceLoatorInit`. It adds
`Init()` method to them as well and ensures that they are initialized
before use from `ChildTable`, `RouterTable` and `Mle` classes.
This commits adds a new class `InstanceLocatorInit` which is
similar to `InstanceLoator` but provides a default constructor
(instead of a parameterized one) and allows an inheriting class to
initialize the object (set the OpenThread Instance) post constructor
call using the `Init()` method. This class is intended for types that
require a default constructor and cannot use a parameterized one. An
example of such a class is one that is used as type of a C array
element (e.g., `Neighbor`/`Child`/`Router` classes which are used as
array in `ChildTable`/`RouterTable`).
Commit a8638d7 added logic to invalidate the parent upon a role
change. However, when upgrading from child to router, the existing
implementation updates the role before copying the parent into into
the router table. As a result, a router may not have any connectivity
with the rest of the partition until after additional MLE exchanges.
This commit marks the newly created router entry as valid so that the
router retains connectivity.
When platform netif is enabled, the TUN device's name should be able to
set from command. This PR use the existing `-I` to allow user provide a
wanted name.
Always output command result, i.e. "Done" on success, error message
otherwise.
Factory commands also follow the same pattern. Their existing error
messages are not removed for backward compatibility consideration.
Current Thread certification needs Parent information even after the
node already become a router or leader. This commit sets parent state
to invalid to indicate information in mParent should not be used in
normal cases.
- [build] Added --with-platform configure option to enable building
the platform libraries without building the example applications or
any supporting libraries used solely by the examples.
- [nrf528xx] Modified the nrf528xx-specific makefiles such that Nordic
SDK code located in third_party/NordicSemiconductor is only
built/referenced when building the example applications. When
building just the platform libraries, the caller of configure is
expected to provide the correct arguments to use an external copy of
the Nordic nRF5 SDK. An exception to this is the 802.15.4 radio
driver, which is always built using the sources in
third_party/NordicSemiconductor/drivers/radio.
- [nrf528xx] Made various minor edits to #include statements in the
nrf528xx platform code. This was necessary because of the difference
in directory structure between the code in
third_party/NordicSemiconductor and that in the formally published
Nordic nRF5 SDK.
The macro OPENTHREAD_POSIX_RCP_UART_ENABLE should be defined for all
builds, not only for CI tests.
This commit also sorts the definitions removed duplicate definitions.
It is posisble for a leader to receive SVR_DATA.ntf messages
attempting to register with a router ID that is not valid on the
leader.
This commit does not allow registering network data with invalid
router IDs to avoid having stale network data that persists.
Newer versions may add additional fields to the end of the settings
structure. However, there may be situations where an older version may
nead to read the structure.
This commit allows the stored settings value size to be smaller than
expected.
This commit initializes the settings structures before reading. This
helps prepare for a following commit that allows reading stored values
that are shorter than expected.
This commit also renames the Clear() methods to Init().
This fixes the implementation of Energy Scanning in case the platform
does not support it, but uses timer with microsecond resolution. This
is not the case with nRF528xx but found it during code inspection.
I've verified that after removing OT_RADIO_CAPS_ENERGY_SCAN
capability, the Energy Scan now works correctly.
This commit aligns otPlatRadioGetRssi implementation with the latest
changes to radio driver.
Without this change, for example, Channel Monitor and Energy Scanning
with duration of 0 (energy scan 0 command) does not work.
This commit updates/enhances the CLI `ping` command. It adds the
feature to track and match the ICMPv6 echo requests and responses
using an identifier. Each `ping` command will use a new value as the
identifier. A received ICMPv6 echo response not matching the current
identifier is ignored. This commit also makes the following (smaller)
changes:
- renames the ping related member variables as `mPing{Name}`,
- defines constants for default ping parameters,
- changes `ping` to use public OT APIs/definition (instead of core
methods).
This commit updates how posix-app source files include the config
header file to follow a similar policy as for core modules. All header
files and `cpp` files that do not have a corresponding `hpp` file
should include "openthread-posix-config.h" first (which itself will
include the core config header). The "cpp" files which have a related
"hpp" should include the related hpp file first. This way we ensure
all config macro definitions are correctly included in all modules.
This commit updates how the `otMessagePriority` enumeration variable
is updated in `otMessageSettings` structure. This addresses an issue
where the enum variable was being treated as an `uint8_t` which may
not necessarily be correct (since complier can choose any integral
type which covers all the enumerator values as the underlying storage
for an unscoped enumeration type).
This commit changes methods in `Ip6::Address` class to use larger
fields (`m16` or `m32`) for comparing portions of address sequence
against constant values when possible.
This commit updates tornaj `test-012-multi-hop-traffic` to make it
more robust by waiting for entire chain topology to be discovered
(router table to be fully updated) before starting message exchange.
This should help with rare failures of this test, which happen when an
address query response is received before the "next hop" for the
destination router is discovered (through Link Advertisement
exchanges) on the first router `r1`.
This commit changes the energy and active scan callback handlers in
`Mac` class to make them follow the model used by external OpenThread
scan APIs. This in turn simplifies their use, allowing us to remove
the code that saved energy/active scan callbacks and contexts in the
`Instance` object. This commit also adds some missing `const` methods
to Beacon class which allows us to declare the received beacon frame
(from scan operation) as a `const`.
Gcov sometimes cannot correctly find source files when the code is
configured with relative path. This commit enables using absolute path
to run toranj tests.
4cbe14a4 Update version to 1.6.16.
7adbffbc Merge pull request #30 from bukepo/pretty/support-abs
2ac7f5da Add absolute path support for pretty
git-subtree-dir: third_party/nlbuild-autotools/repo
git-subtree-split: 4cbe14a4adb8702d81a63fd663bf046407908def
Add a new OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT flag to
configure builtin mbedtls buffer/debug management separately from the
existing flag which configures the inclusion of the builtin mbedtls
library in the build.
This commit renames the static `Mle` method which derives RLOC16
from a given Router ID to `Rloc16FromRouterId()` from `GetRloc16()`.
This helps distinguish this method from other `GetRloc16()` methods.
This commit updates the route table log message to include if link
is established with router or not (router is a neighbor). Also the
`0xffff` is printed as next hop if it is invalid and we indicate
if the entry is for the device itself.
This commit fixes a bug that the finalize message will be prematurely
freed if the joiner is started at the second time without waiting for
the finish of the first initiation.
- Set OPENTHREAD_CONFIG_SOFTWARE_CSMA_BACKOFF_ENABLE=0 and
OPENTHREAD_CONFIG_SOFTWARE_ENERGY_SCAN_ENABLE=0 according to the implemented
hardware capabilities.
- Undefine RADIO_CONFIG_SRC_MATCH_*_ENTRY_NUM to let the soft source match table
implementation define them as OPENTHREAD_CONFIG_MLE_MAX_CHILDREN
This change adds an information about the timestamp to the log
metadata that is calculated with the formula: <timestamp_base> +
<time_from_start_in_ms>. The <timestamp_base> value is set to 0 by
default and can be changed with a new SPINEL property:
SPINEL_PROP_DEBUG_LOG_TIMESTAMP_BASE formatted as X (uint64_t).
This commit updates `HandleMesh()` method to skip the mesh header in
the frame immediately after parsing it. This in turn removes the need
for other methods (`CheckReachability` or `UpdateRoutes()` calling
through `GetIp6Header()` to `DecompressIp6Header()`) to redo the
parsing to skip the mesh header. With this change we can also remove
the now unused `SkipMeshHeader()`.
This commit updates the `Lowpan::MeshHeader` class to provide methods
to parse/write the Mesh Header from/to a given frame or message. The
`MeshHeader` no longer provides a direct representation of the header
(instead, it contains all fields required to generate the header).
This is mainly due to fact the header format itself may vary depending
on the "hops left" value. This change also removes the need for the
`MeshHeader` to be a packed `OT_TOOL_PACKED` structure.
Before passing the frame to `GetForwardFramePriority()` the mesh
header is skipped (to avoid re-reading the mesh header). Also the
src/dest parameters are renamed to indicate they are mesh source and
mesh destination (also the order of parameters changed to start with
source and then dest). With this change we can remove
`GetMeshHeader()` (since no longer used/needed).
b1b93c9de Merge pull request #29 from robszewczyk/bug/redundant-libtool-libraries
92cda4133 Remove inconsistent libtool libraries and automake-distributed files
9e610e1e0 Merge pull request #27 from nestlabs/feature/github-issue-26
17b0d3033 Attempt to use HTTP rather than FTP to address random Travis CI fetch failures.
83c3fbd6e Ensure that package retrievals have at least four (4) retries.
330ea5628 Update the manifest to ensure 'make dist' works.
10c35016c Add a Travis CI build status badge.
8e08dc7e6 Initial revision.
e05a00c3b Merge pull request #25 from robszewczyk/bug/update-coreutils
e0c75cf3e Update coreutils s.t. the tools can be built on newer Linux systems
4db93dd94 Merge pull request #24 from robszewczyk/feature/header-depend-on-built-sources
244f42204 Bookkeeping: default version and changelogs
6dd233313 install-headers target should depend on BUILT_SOURCES
650b05690 Merge pull request #23 from nestlabs/bug/address-bootstrap-bashism
git-subtree-dir: third_party/nlbuild-autotools/repo
git-subtree-split: b1b93c9de7121dcd6099fb3b651b8a6ed5b42d22
This commit adds a otCoapOptionIterator structure which the user can
use to iterate over the CoAP options of a ot::Coap::Message object
without influencing any of the properties of that object.
Multiple otCoapOptionIterator structures may operate on the same
ot::Coap::Message object without interference.
There are cases when NCP platform was used at first. Then need to
change to use RCP platform later. The PAN active and pending dataset
needs to be retrieved from NCP firmware to avoid repairing again.
This change,
1. Add one parameter to posix host (--ncp-dataset).
2. Avoid some radio spinel command and check so that posix app can start
otInstance and talk to NCP firmware.
3. Utilize spinel property SPINEL_PROP_THREAD_ACTIVE_DATASET and
SPINEL_PROP_THREAD_PENDING_DATASET to retrieve dataset from NCP.
This commit adds a header file `settings.h` to include all the
default configuration definitions related to `settings` platform
utility. It also adds `OPENTHREAD_SETTINGS_RAM` to this file.
This helps address the undefined macro warnings.
There is chance for below scenario:
1) Device newly becomes router and sends multicast Link Request
(challenge1),
2) Device receives MLE advertisement from one neighbor, and sends
unicast Link Request (challenge2),
3) The neighbor ignores the unicast link Request in 2) and sends
out Link Accept and Request message as response for 1)
4) Device would drop the Link Accept adn Request message
in 3) as it compares the Response TLV value with challenge2, which
in fact matches challenge1.
The link between Device and the neighbor could not be established until
Device receives next MLE advertisement from the neighbor.
This commit suppresses unicast Link Request in 2) if there is multicast
Link Request ongoing. Thus the three-handshakes link sync could go well.
This commit ensures that TX Power returned via
otPlatRadioGetTransmitPower is one that is actually set in the
register. E.g. even if TX power is set to 100 via
otPlatRadioSetTransmitPower, the maximum power is 8 for nRF52840.
otDatasetIsCommissioned API first reads out the Active Dataset from
settings (i.e. non-volatile storage). However, the existing
implementation does not check if the Active Dataset is actually
present, as indicated by OT_ERROR_NOT_FOUND.
This commit adds a necessary check and returns false if the Active
Dataset is not present.
A device's request to register network data information is triggered
by a call to NetworkData::Local::SendServerDataNotification().
However, the call was only made by devices operating in the router
or leader roles.
This commit moves the call so that network data registration is
triggered in the child role, in addition to the router and leader
roles.
This commit changes the `Mle::GetParentCandidate()` to return a
reference to the parent candidate and moves the selection logic
between parent or parent candidate when sending data polls to
`DataPollSender` from the newly added `GetParent()` method.
This commit abstracts the API between radio_spinel and hdlc_interface
into a common interface spinel_interface. Users can use this interface
to add new transport layers to send/receive spinel frames.
C++11 constexpr doesn't support local variables and loop. This commit
uses recursive way to assert handlers are sorted.
C++11 static_assert requires a message. This commit adds the missing
messages to static_assert calls.
The big `switch` generates a lot of code on some compilers. This
commit drops the switch way to find getters and setters, instead a
binary search is used to find property handlers. This requires all
handlers are defined in a sorted array.
This commit defines `spinel_prop_key_t` and `spinel_status_t` as
`uint32_t` instead of `enum` value. This allows these types to
take values not included in `enum` (e.g., vendor or experimental
values) and addresses "out-of-range enumeration value" compiler
warnings.
mWaitingKey != SPINEL_PROP_LAST_STATUS means the NCP is waiting for a
spinel response from RCP. When mWaitingKey is set to
SPINEL_PROP_LAST_STATUS and HdlcInterface receives a ChildIdResponse
message from RCP,HdlcInterface calls the function Decode() to decode
the received HDLC frame. Then the decoded spinel frame is sent to
RadioSpinel module. Because the function IsSafeToHandleNow() returns
true now, the RadioSpinel sends the received ChildIdResponse frame to
up layer immediately. Then the MLE layer calls the function
otPlatRadioSetShortAddress() to set short address. The function
otPlatRadioSetShortAddress() sends spinel frame MAC_15_4_SADDR to RCP
and waits for the spinel response. When the response frame is
received, the HdlcInterface calls the function Decode() again, the
function Decode() uses previous calculated FCS value to calculate the
current received HDLC frame. The wrong FCS value caused the parsing
error for the received response frame.
This commit parses all parameters to a structure and puts all
parameters parsing code in the function ParseArg(). It makes us easier
to add new parameters to posix host.
This commit updates the Netif's handling of multicast addresses to
allow user to subscribe to (or unsubscribe from) an external multicast
address in any state. This aligns the behavior of external multicast
addresses with how external unicast addresses are handled (user can
already add/remove unicast addresses in any state).
This commit also adds checks to ensure user cannot subscribe to fixed
multicast addresses (e.g., link-local all nodes, realm-local all
routers, etc.) using `SubscribeExternalMulticast()`.
This commit also updates the implementation of methods dealing with
fixed multicast addresses to use the newly added `LinkedList` methods.
The `LinkedList::Find()` method searches for a given entry in the
linked list and if found returns a pointer to the previous entry
behind it. The `LinkedList::GetTail()` returns the tail of the list
(last entry in the list). This commit also updates the unit test
`test_linked_list` to verify the behavior of newly added methods.
This commit adds new parameter `OT_CONFIG` to main `CMakeLists.txt`
file. This parameter allows users to specify a project-specific core
config header file (mapped to `OPENTHREAD_PROJECT_CORE_CONFIG_FILE`)
during build configuration.
The default value for this parameter is "none". When not specified
(value is "none"), a platform cmake file may choose to change
`OT_COFNIG` variable to provide its own core config header file. This
commit updates platform 'posix' and 'cc2548' cmake files to provide
platform specific header files when `OT_CONFIG` is not specified by
user.
This commit removes the hard-coded `OPENTHREAD_CONFIG_LOG_PLATFORM=0`
configuration in the unit test makefile. This allows the project build
to specify whether the platform logging should be enabled in unit
tests or not (and removes the complier warning for possible re-definition
of this configuration option).
This commit updates `test_utils.hpp/cpp` to include a common helper
function `DumpBuffer` to print the content of a buffer (as hex and char string)
to screen. It also removes unused helper functions and use of STL header
files and types.
This commit removes the extra `\n` at the end of error message strings
used in `VerifyOrQuit()` or `SuccessOrQuit()` macros in different unit
test modules. This help make the style (usage of macros) consistent
across all unit tests.
- RF-shield needed cases 6.3.2, 5.6.7, 9.2.9, 9.2.10 automation both
on CV and IV testbed
- Added DUT2_DEVICE and SHIELD_GOLDEN_DEVICES in settings file which
list the second DUT and golden devices in RF-box. The emulation of
the required shielding/unshielding test environment is achieved by
controlling the programmable RF-switch (example: Agilent 3499B + HP
44476A microwave switch module) via scripts (configure
SHIELD_CONTROLLER_TYPE and SHIELD_CONTROLLER_PARAMS in settings
file) and final impacting the IN/OUT signal of the devices in the
box.
- Added case_need_shield and device_order parameters in RF-shield
needed case scripts for checking if test case needs to use RF-shield
box and its device order on the Test Harness Testbed page.
This method simplifies `Mac::ProcessReceiveSecurity()` method, by
initializing `error` as `OT_ERROR_SECURITY` and only setting it to
`OT_ERROR_NONE` after all checks are passed (allowing checks to use
`VerifyOrExit()` without updating of `error` variable).
Wpanctl THCI might return the wrong RLOC address when RLOC16 == 0 due
to incorrect call to .lstrip('0x'). We use .lstrip('0x') to strip
'0x' at the beginning of a hex string, however this is not correct
when the hex string is '0x0', because '0x0'.lstrip('0x') == ''
This commit fixes all incorrect calls to .lstrip('0x'). There are 3
different kinds of fix:
- s.lstrip('0x') replaced by self.__lstrip0x(s) (lstrip_0x is a
correct implementation of stripping '0x' at the beginning of a
string)
- hex(v).rstrip('L').lstrip('0x') replaced by '%x' % v
- hex(v).lstrip('0x').zfill(4) replaced by '%04x' % v
This commit adds a linked list module which provides a template
implementation of a singly linked list. The new class is then used in
different core modules (netif (unicast/multicast addresses), UDP6
sockets/receiver, coap resources, etc). This commit also adds a
unit test `test_linked_list` for the linked list module.
RFC 6724 Section 2.2 states:
We define the common prefix length CommonPrefixLen(S, D) of a source
address S and a destination address D as the length of the longest
prefix (looking at the most significant, or leftmost, bits) that the
two addresses have in common, up to the length of S's prefix (i.e.,
the portion of the address not including the interface ID). For
example, CommonPrefixLen(fe80::1, fe80::2) is 64.
This commit ensures that the important ML-EID would be the
first one in Address Registration TLV so that the parent
would always be able to store it.
(SPEC-899: A recipient MUST process address entries in an
Address Registration TLV sequentially from first entry to
last entry)
This commit simplifies the API between RadioSpinel and HdlcInterface
to improve extensibility of the API so that we can easily add other
low layer interfaces to send/receive spinel frames later.
RadioSpinel is only responsible for encoding/decoding spinel
frames. Lower layer interface is only responsible for
sending/receiving spinel frames. Some lower layer interfaces can't
provide a file descriptor for RadioSpinel to wait for the file
descriptor to become writable, so this commit removes the
kStateTransmitPending state from RadioSpinel.c and directly calls the
function Request() to send frames in method RadioSpinel::Transmit().
The existing code did not keep the State Update timer running if the
device was not router-eligible. However, a Full End Device (FED) needs
to keep the State Update timer running to maintain its links to
neighboring routers.
This commit ensures that the State Update timer continues to run on
FTD devices, even if the device is operating as a FED. This commit
also removes some unncessary code to start the State Update timer if
the device switches from a FED to a REED.
A Leader should always be able to process service registration.
This commit:
- removes the OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE feature
flag around code for handling service registrations by the leader.
- support service ALOC forwarding by all router-capable devices.
- adds ability for any device to read service information from the
network data.
- Ensure there are no side effects if MLE frame counters have not yet
been syncrhonzied.
- Do not remove stale neighbor until end of processing
Advertisement. This allows for complete processing of Advertisement
if frame counters have already been established.
This allows the device to retain the neighbor entry and validate
incoming messages before a proper MLE Link Request/Accept exchange has
been completed.
This causes source match implementation in both utils and platform
code, which may lead to erroneous behaviour if the wrong one is
included by the linker.
This commit changes the Joiner::HandleJoinerEntrust implementation
to store Thread network configuration parameters in the Active
Operational Dataset. Using the operational dataset stores
configuration parameters in non-volatile memory.
This commit only utilizes Thread network parameters that are useful in
the Thread attach process. For example, parameters such as Extended
PAN ID, Mesh Local Prefix, and Active Timestamp are not useful during
the attach process.
In order to use external mbedTLS correctly we need to translate CMake
OT_BUILTIN_MBEDTLS into OpenThread's
OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This is important for allowing cmake to properly configure itself,
knowing what cflags will be passed. Also I removed all of the
public modifications of CMAKE_CXX_FLAGS, to better control where
the flags are actually applied.
The linker file is an exception to the toolchain file, as it
depends on symbols that are declared in the startup file
(startup-gcc.c for cc2538). Therefore it has been added as a
PUBLIC requirement for the cc2538 platform layer.
Otherwise rebuilding will cause sporadic issues when the environment
variables don't match the initial values. CMake variables are
cached in the CMakeCache file in the build directory, and can be
modified using ccmake. Also this improves cross-platform behaviour
as windows doesn't handle environment variables in the same way
as a posix system does.
platform-utils has a dependency on the core ot library, which was
causing the build to fail. I have resolved this by making
platform-utils an 'object library', which means the object files
will always be used by the linker, preventing the 'smart linker'
errors that occur with ld and cyclic dependencies.
I also provided a static (.a) implementation of the library in case
any non-cmake project wanted to consume the results (at which point
that project can deal with the dependency as it wishes).
So now it is up to the 'platform layer' to include the 'platform utils'
objects inside its own library if it requires them. I have implemented
this for the current cmake example platforms.
The function "RadioSpinel::IsSafeToHandleNow()" is finally called by the
function "HdlcInterface::Decode()". However, the variable "mIsDecoding"
is set to TRUE before calling "RadioSpinel::IsSafeToHandleNow()" in
function "HdlcInterface::Decode()". So the function "IsDecoding()"
always return TURE in function "RadioSpinel::IsSafeToHandleNow()". This
commit removes the function "IsDecoding()" to simplify the code.
This commit ensures the entire struct size is used when comparing
two `OnMeshPrefixConfig` (`otBorderRouterConfig`) instances from
`NetworkData::ContainsOnMeshPrefixes()` method.
This commit contains t changes the methods in `NetworkData` class used
for iterating over on-mesh prefix, external router, etc (e.g.,
`GetNextOnMeshPrefix`()) to use reference input variables instead of
pointer type variables.
This commit compares data version properly according to the device
mode (whether or not requiring full network data), thus avoiding
unexpected data request when receiving MLE advertisement.
`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).
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
OpenThread GitHub Discussions is the recommended place for users to discuss OpenThread and interact directly with the OpenThread community. https://github.com/openthread/openthread/discussions
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
die(){
echo" *** ERROR: "$*
exit1
}
set -x
cd /tmp || die
[$TRAVIS_OS_NAME != linux ]||{
sudo apt-get update || die
[$BUILD_TARGET != posix-distcheck -a $BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-mtd -a $BUILD_TARGET != posix-ncp ]||{
pip install --user --upgrade pip || die
pip install --user -r $TRAVIS_BUILD_DIR/tests/scripts/thread-cert/requirements.txt || die
[$BUILD_TARGET != posix-ncp ]||{
# Packages used by ncp tools.
pip install --user git+https://github.com/openthread/pyspinel || die
}
}
[$BUILD_TARGET != pretty-check ]||{
clang-format --version || die
}
[$BUILD_TARGET != scan-build ]||{
sudo apt-get install clang || die
}
[$BUILD_TARGET != arm-gcc49 ]||{
sudo apt-get install lib32z1 || 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
exportPATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH|| die
arm-none-eabi-gcc --version || die
}
[$BUILD_TARGET != arm-gcc54 ]||{
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
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 ]||{
sudo apt-get install lib32z1 || die
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
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-gcc7 ]||{
sudo apt-get install lib32z1 || die
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2 || die
tar xjf gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2 || die
exportPATH=/tmp/gcc-arm-none-eabi-7-2017-q4-major/bin:$PATH|| die
arm-none-eabi-gcc --version || die
}
[$BUILD_TARGET != posix-32-bit -a $BUILD_TARGET != posix-mtd ]||{
scan-build --status-bugs -analyze-headers -v make || die
}
[$BUILD_TARGET != arm-gcc49 ]||{
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
BORDER_ROUTER=1COAP=1COMMISSIONER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1FULL_LOGS=1JOINER=1MAC_FILTER=1MTD_NETDIAG=1SERVICE=1TMF_PROXY=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
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || 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
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc2652 || die
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.36.0.58.zip || die
unzip -qq asf-standalone-archive-3.36.0.58.zip || die
mv xdk-asf-3.36.0 third_party/microchip/asf || die
./bootstrap || die
COMMISSIONER=1JOINER=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-gcc54 ]||{
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
BORDER_ROUTER=1COAP=1COMMISSIONER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1FULL_LOGS=1JOINER=1MAC_FILTER=1MTD_NETDIAG=1SERVICE=1TMF_PROXY=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
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || 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
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc2652 || die
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.36.0.58.zip || die
unzip -qq asf-standalone-archive-3.36.0.58.zip || die
mv xdk-asf-3.36.0 third_party/microchip/asf || die
./bootstrap || die
COMMISSIONER=1JOINER=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-gcc63 ]||{
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-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=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_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
BORDER_ROUTER=1COAP=1COMMISSIONER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1FULL_LOGS=1JOINER=1MAC_FILTER=1MTD_NETDIAG=1SERVICE=1TMF_PROXY=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
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || 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
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc2652 || die
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.36.0.58.zip || die
unzip -qq asf-standalone-archive-3.36.0.58.zip || die
mv xdk-asf-3.36.0 third_party/microchip/asf || die
./bootstrap || die
COMMISSIONER=1JOINER=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
exportPATH=/tmp/arc_gnu_2017.03-rc2_prebuilt_elf32_le_linux_install/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_TARGET != arm-gcc7 ]||{
exportPATH=/tmp/gcc-arm-none-eabi-7-2017-q4-major/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=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_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
BORDER_ROUTER=1COAP=1COMMISSIONER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1FULL_LOGS=1JOINER=1MAC_FILTER=1MTD_NETDIAG=1SERVICE=1TMF_PROXY=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
arm-none-eabi-size output/nrf52840/bin/ot-ncp-radio || 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
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
COMMISSIONER=1JOINER=1DHCP6_CLIENT=1DHCP6_SERVER=1DNS_CLIENT=1 make -f examples/Makefile-cc2652 || die
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
git checkout -- . || die
git clean -xfd || die
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.36.0.58.zip || die
unzip -qq asf-standalone-archive-3.36.0.58.zip || die
mv xdk-asf-3.36.0 third_party/microchip/asf || die
./bootstrap || die
COMMISSIONER=1JOINER=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 != posix ]||{
sh -c '$CC --version'|| die
sh -c '$CXX --version'|| die
git checkout -- . || die
git clean -xfd || die
./bootstrap || 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
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-ncp-app=all \
--with-ncp-bus=spi \
--with-examples=posix \
--enable-border-router \
--enable-child-supervision \
--enable-diag \
--enable-jam-detection \
--enable-legacy \
--enable-mac-filter \
--enable-service \
--enable-channel-manager \
--enable-channel-monitor \
--disable-docs \
--disable-test || die
make -j 8|| die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-cli-app=mtd \
--with-ncp-bus=spi \
--with-examples=posix \
--enable-border-router \
--enable-child-supervision \
--enable-legacy \
--enable-mac-filter \
--enable-service \
--disable-docs \
--disable-test || die
make -j 8|| die
git checkout -- . || die
git clean -xfd || die
./bootstrap || die
./configure \
--enable-cli-app=all \
--enable-ncp-app=all \
--with-ncp-bus=uart \
--with-examples=posix || die
make -j 8|| die
}
[$BUILD_TARGET != posix-distcheck ]||{
exportASAN_SYMBOLIZER_PATH=`which llvm-symbolizer-5.0`|| 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
}
[$BUILD_TARGET != posix-32-bit ]||{
./bootstrap || die
COVERAGE=1CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make -f examples/Makefile-posix check || die
}
[$BUILD_TARGET != posix-mtd ]||{
./bootstrap || die
COVERAGE=1CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 USE_MTD=1 make -f examples/Makefile-posix check || die
}
[$BUILD_TARGET != posix-ncp-spi ]||{
./bootstrap || die
make -f examples/Makefile-posix check configure_OPTIONS="--enable-ncp-app=ftd --with-ncp-bus=spi --with-examples=posix"|| die
}
[$BUILD_TARGET != posix-ncp ]||{
./bootstrap || die
NODE_TYPE=ncp-sim make -f examples/Makefile-posix check || die
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at openthread-conduct@google.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at openthread-conduct@google.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
We would love for you to contribute to OpenThread and help make it even better than it is today! As a contributor, here are the guidelines we would like you to follow.
Help us keep OpenThread open and inclusive. Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).
Help us keep OpenThread open and inclusive. Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).
## Bugs
If you find a bug in the source code, you can help us by [submitting a GitHub Issue](https://github.com/openthread/openthread/issues/new). The best bug reports provide a detailed description of the issue and step-by-step instructions for predictably reproducing the issue. Even better, you can [submit a Pull Request](#submitting-a-pull-request) with a fix.
If you find a bug in the source code, you can help us by [submitting a GitHub Issue](https://github.com/openthread/openthread/issues/new). The best bug reports provide a detailed description of the issue and step-by-step instructions for predictably reproducing the issue. Even better, you can [submit a Pull Request](#submitting-a-pull-request) with a fix.
## New Features
@@ -24,9 +25,9 @@ You can request a new feature by [submitting a GitHub Issue](https://github.com/
If you would like to implement a new feature, please consider the scope of the new feature:
* *Large feature*: first [submit a GitHub Issue](https://github.com/openthread/openthread/issues/new) and communicate your proposal so that the community can review and provide feedback. Getting early feedback will help ensure your implementation work is accepted by the community. This will also allow us to better coordinate our efforts and minimize duplicated effort.
- _Large feature_: first [submit a GitHub Issue](https://github.com/openthread/openthread/issues/new) and communicate your proposal so that the community can review and provide feedback. Getting early feedback will help ensure your implementation work is accepted by the community. This will also allow us to better coordinate our efforts and minimize duplicated effort.
* *Small feature*: can be implemented and directly [submitted as a Pull Request](#submitting-a-pull-request).
- _Small feature_: can be implemented and directly [submitted as a Pull Request](#submitting-a-pull-request).
## Contributing Code
@@ -37,7 +38,6 @@ 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.
The OpenThread Project requires all contributors to sign a Contributor License Agreement ([individual](https://developers.google.com/open-source/cla/individual) or [corporate](https://developers.google.com/open-source/cla/corporate)) in order to protect contributors, users, and Google in issues of intellectual property.
With each Pull Request, an automated check occurs to verify that you have signed the CLA. Make sure that you sign the CLA with the same email address associated with your commits (i.e. via the `user.email` Git config as described on GitHub's [Set up Git](https://help.github.com/articles/set-up-git/) page.
NOTE: Only original source code from you and other people that have signed the CLA can be accepted into the repository. This policy does not apply to [third_party](https://github.com/openthread/openthread/tree/master/third_party).
Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. Head over to <https://cla.developers.google.com/> to see your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.
### Submitting a Pull Request
@@ -66,7 +63,7 @@ For each new feature, create a working branch:
```bash
# Create a working branch for your new feature
git branch --track <branch-name> origin/master
git branch --track <branch-name> origin/main
# Checkout the branch
git checkout <branch-name>
@@ -88,16 +85,16 @@ This will open up a text editor where you can craft your commit message.
Prior to submitting your pull request, you might want to do a few things to clean up your branch and make it as simple as possible for the original repo's maintainer to test, accept, and merge your work.
If any commits have been made to the upstream master branch, you should rebase your development branch so that merging it will be a simple fast-forward that won't require any conflict resolution work.
If any commits have been made to the upstream main branch, you should rebase your development branch so that merging it will be a simple fast-forward that won't require any conflict resolution work.
```bash
# Fetch upstream master and merge with your repo's master branch
git checkout master
git pull upstream master
# Fetch upstream main and merge with your repo's main branch
git checkout main
git pull upstream main
# If there were any new commits, rebase your development branch
git checkout <branch-name>
git rebase master
git rebase main
```
Now, it may be desirable to squash some of your smaller commits down into a small number of larger more cohesive commits. You can do this with an interactive rebase:
@@ -105,24 +102,16 @@ 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 rebase -i master
git rebase -i main
```
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). Use the `makepretty` and `makepretty-check` targets to automatically reformat code and check for code-style compliance, respectively. OpenThread currently requires [clang-format v5.0.1](http://releases.llvm.org/download.html#5.0.1) for `make pretty` and `make pretty-check`.
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 `script/make-pretty` and `script/make-prettycheck` to automatically reformat code and check for code-style compliance, respectively. OpenThread currently requires [clang-format v9.0.0](https://releases.llvm.org/download.html#9.0.0) for C/C++ and [yapf v0.31.0](https://github.com/google/yapf) for Python.
As part of the cleanup process, you should also run `makepretty-check` to ensure that your code passes the baseline code style checks.
```bash
./bootstrap
./configure
make pretty-check
```
Make sure to include any code format changes in your commits.
As part of the cleanup process, you should also run `script/make-prettycheck` to ensure that your code passes the baseline code style checks.
#### Push and Test
@@ -134,8 +123,66 @@ 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 continuous-integration checks using GitHub Actions. You can view the status and logs via the "Actions" tab in your fork.
#### 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 that all continuous-integration checks have passed, 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.
#### Checks fail
Once you've submitted a pull request, all continuous-integration checks are triggered again. If some of these checks fail, it could be either problems with the pull request or an intermittent failure of some test cases. For more information on the failure, check the output and download artifacts. (After all jobs in one group are completed, an `Artifacts` button appears beside the `Re-run` jobs button.) If the failure is intermittent, the check will usually pass after rerunning once or twice.
We want to eliminate intermittent failures as well, so when you experience such a failure, please log an issue and attach any relevant artifacts. If the artifacts are too big, provide the link of the failed run (do not rerun checks again, or it will be overwritten). Alternatively, upload the artifacts to a file-sharing service like Google Drive and share a link to it.
##### Analyze core dumps in failed checks
For some checks, core dumps for crashed programs are uploaded as artifacts in a failed check. Besides core dumps, binaries and shared libraries are also uploaded so that we can analyze the dumps locally. To analyze the dumps, download the artifact `core-xxx` and unzip it. The package is in the following format:
```
|-- build
| `-- cmake
| `-- openthread-simulation-1.2
| `-- examples
| `-- apps
| `-- cli
| |-- ot-cli-ftd
| `-- ot-cli-mtd
|-- ot-core-dump
| `-- corefile-ot-cli-ftd-11323-1606274703
`-- so-lib
|-- ld-linux-x86-64.so.2
|-- libc.so.6
`-- libgcc_s.so.1
```
Once unzipped:
1.`cd` to the unzipped directory
2. Run `gdb build/cmake/openthread-simulation-1.2/examples/apps/cli/ot-cli-ftd ./ot-core-dump/corefile-ot-cli-ftd-XXX`.
3. Set the absolute path of `so-lib`. In gdb, run `set solib-absolute-prefix /ABSOLUTE/PATH/TO/so-lib/`, then run `set solib-search-path /ABSOLUTE/PATH/TO/so-lib/`.
4. In gdb, run `backtrace` or `bt`. Then you should see the stack of the crashed program. Find and fix the problem!
## Contributing Documentation
Documentation undergoes the same review process as code and contributions may be mirrored on our [openthread.io](https://openthread.io) website.
### Codelabs and Guides
To review and contribute to OpenThread Codelabs and Guides, refer to the following GitHub repositories:
For information on how to author and format documentation for contribution, refer to the [Documentation Style Guide](https://github.com/openthread/ot-docs/blob/main/STYLE_GUIDE.md).
### API Reference topics
API Reference topics use [Doxygen comment blocks](https://www.doxygen.nl/manual/docblocks.html) to render the HTML output on [https://openthread.io/reference](https://openthread.io/reference). OpenThread scripts support the following Doxygen [special commands](https://www.doxygen.nl/manual/commands.html):
-@file
-@brief
-@param
-@returns
You can find most of these comments in the [OpenThread header files](https://github.com/openthread/openthread/tree/main/include/openthread). To review an example, refer to [`border_agent.h`](https://github.com/openthread/openthread/tree/main/include/openthread/border_agent.h). The Doxygen comments in `border_agent.h` output the [Border Agent](https://openthread.io/reference/group/api-border-agent) reference topic on openthread.io. For more information, refer to [Comments](https://github.com/openthread/openthread/blob/main/STYLE_GUIDE.md#comments) in the OpenThread Coding Conventions and Style guide.
OpenThread released by Google is... <a href="https://www.threadgroup.org/What-is-Thread/Thread-Benefits#certifiedproducts"> <img src="https://cdn.rawgit.com/openthread/openthread/ab4c4e1e/doc/images/certified.svg" alt="Thread Certified Component" width="150px" align="right"> </a>
**...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](https://www.threadgroup.org/What-is-Thread/Overview) 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. 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), 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.
**...a Thread Certified Component**, implementing all features defined in the [Thread 1.2 specification](https://www.threadgroup.org/support#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 at [threadgroup.org](http://threadgroup.org/). Thread is a registered trademark of the Thread Group, Inc.
All end-user documentation and guides are located at [openthread.io](https://openthread.io). If you're looking to do things like...
* Learn more about OpenThread features and enhancements
* Use OpenThread in your products
* Learn how to build and configure a Thread network
* Port OpenThread to a new platform
* Build an application on top of OpenThread
* Certify a product using OpenThread
- Learn more about OpenThread features and enhancements
- Use OpenThread in your products
- Learn how to build and configure a Thread network
- Port OpenThread to a new platform
- Build an application on top of OpenThread
- Certify a product using OpenThread
...then [openthread.io](https://openthread.io) is the place for you.
> Note: For users in China, end-user documentation is available at [openthread.google.cn](https://openthread.google.cn).
If you're interested in contributing to OpenThread, read on.
# Contributing
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.
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/main/CONTRIBUTING.md) 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).
Contributors are required to abide by our [Code of Conduct](https://github.com/openthread/openthread/blob/main/CODE_OF_CONDUCT.md) and [Coding Conventions and Style Guide](https://github.com/openthread/openthread/blob/main/STYLE_GUIDE.md).
# Versioning
@@ -63,16 +60,13 @@ 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/main/LICENSE). See the [`LICENSE`](https://github.com/openthread/openthread/blob/main/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:
OpenThread support is available on GitHub:
* 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.
- Bugs and feature requests — [submit to the Issue Tracker](https://github.com/openthread/openthread/issues)
- Community Discussion - [ask questions, share ideas, and engage with other community members](https://github.com/openthread/openthread/discussions)
* [1.2 Conventions and Best Practices](#conventions-and-best-practices)
* [1.3 Tightly-constrained Systems and Shared Infrastructure](#tightly-constrained-systems-and-shared-infrastructure)
* [1.4 Format and Style](#format-and-style)
* [1.5 Comments](#comments)
* [2 Python](#python)
* [2.1 Standards](#standards)
* [2.2 Conventions and Best Practices](#conventions-and-best-practices)
* [2.3 Format and Style](#format-and-style)
- [1 C and C++](#c-and-c)
- [1.1 Standards](#standards)
- [1.2 Conventions and Best Practices](#conventions-and-best-practices)
- [1.3 Tightly-constrained Systems and Shared Infrastructure](#tightly-constrained-systems-and-shared-infrastructure)
- [1.4 Format and Style](#format-and-style)
- [1.5 Comments](#comments)
- [2 Python](#python)
- [2.1 Standards](#standards)
- [2.2 Conventions and Best Practices](#conventions-and-best-practices)
- [2.3 Format and Style](#format-and-style)
# C and C++
@@ -18,7 +18,7 @@
- C
- OpenThread uses and enforces the ISO9899:1999 (aka ISO C99, C99) C language standard as the minimum.
- C++
- OpenThread uses and enforces the ISO14882:2003 (aka ISO C++03, C++03) C++ language standard as the minimum.
- OpenThread uses and enforces the ISO14882:2011 (aka ISO C++11, C++11) C++ language standard as the minimum.
- Extensions
- Wherever possible, toolchain-specific (e.g GCC/GNU) extensions or the use of later standards shall be avoided or shall be leveraged through toolchain-compatibility preprocessor macros.
@@ -27,13 +27,13 @@
### Language Independent
- Inline functions should be used judiciously.
- The use of code in headers and, more specifically, the use of the non-local scope inline functions should be avoided. Exception: Simple setters and getters are fine since the compiler can efficiently optimize these and make their overhead as low as a direct data member access.
- The use of code in headers and, more specifically, the use of the non-local scope inline functions should be avoided. Exception: Simple setters and getters are fine since the compiler can efficiently optimize these and make their overhead as low as a direct data member access.
- Return Statements
- There should be one return statement per free function or method at the end of the free function or method.
- Non-local Goto
- There should be no calls to the functions `setjmp` or `longjmp`.
- Local Goto
- There should be no calls to the C/C++ keyword goto. Exception: The use of local gotos for the purposes of common error handling blocks and single points of function return at the bottom of a function.
- There should be no calls to the C/C++ keyword goto. Exception: The use of local gotos for the purposes of common error handling blocks and single points of function return at the bottom of a function.
- C Preprocessor
- Use of the C preprocessor should be limited to file inclusion and simple macros.
- Macros shall not be defined within a function or a block and should be defined at the top of a file.
@@ -63,18 +63,20 @@
- Unbounded Recursion
- There shall be no direct or indirect use of unbounded recursive function calls.
- Symmetric APIs
- Wherever possible and appropriate, particularly around the management of resources, APIs should be symmetric. For example, if there is a free function or object method that allocates a resource, then there should be one that deallocates it. If there is a free function or object method that opens a file or network stream, then there should be one that closes it.
- Wherever possible and appropriate, particularly around the management of resources, APIs should be symmetric. For example, if there is a free function or object method that allocates a resource, then there should be one that deallocates it. If there is a free function or object method that opens a file or network stream, then there should be one that closes it.
- Use C stdint.h or C++ cstdint for Plain Old Data Types
- Standard, scalar data types defined in stdint.h (C) or cstdint (C++) should be used for basic signed and unsigned integer types, especially when size and serialization to non-volatile storage or across a network is concerned. Examples of these are: `uint8_t`, `int8_t`, etc.
- Standard, scalar data types defined in stdint.h (C) or cstdint (C++) should be used for basic signed and unsigned integer types, especially when size and serialization to non-volatile storage or across a network is concerned. Examples of these are: `uint8_t`, `int8_t`, etc.
- Constant Qualifiers
- Read-only methods, global variables, stack variables, or data members are read-only should be qualified using the C or C++ `const` qualifier.
- Pointers or references to read-only objects or storage, including but not limited to function parameters, should be qualified using the C or C++ `const` qualifier.
- Header Include Guard
- All C and C++ headers shall use preprocessor header include guards.
- The terminating endif preprocessor directive shall have a comment, C or C++ depending on the header type, containing the preprocessor symbol introduced by the ifndef directive starting the guard.
- The symbol used for the guard should be the file name, converted to all uppercase, with any spaces (“ “) or dots (“.”) converted to underscores (“_”).
- 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
@@ -84,16 +86,16 @@
### C++
- Prefer Passing Parameters by Reference to Pointer
- Unlike C, C++ offers an alternate way to alias data over and above a pointer, the reference, indicated by the & symbol. Where appropriate, the reference should be preferred to the pointer.
- Unlike C, C++ offers an alternate way to alias data over and above a pointer, the reference, indicated by the & symbol. Where appropriate, the reference should be preferred to the pointer.
- Passing Base Scalars
- Size- and call frequency-based considerations should be made when passing scalars as to whether they should be passed by value or by constant reference; however, pass-by-value should generally be preferred.
- Eliminate Unnecessary Destructors
- The creation of empty or useless destructors should be avoided. Empty or useless destructors should be removed.
- The creation of empty or useless destructors should be avoided. Empty or useless destructors should be removed.
- Default Parameters
- When you declare C++ free functions and object methods, you should avoid or minimize using default parameters.
- When you declare C++ virtual object methods, you shall avoid using default parameters.
- Global and Scoped Static Construction
- There shall be no use of global, static or otherwise, object construction. The use of scoped static object construction should be avoided.
- There shall be no use of global, static or otherwise, object construction. The use of scoped static object construction should be avoided.
- C++-style Casts
- Wherever possible and practical, C++ style casts should be used and preferred to the C style cast equivalent.
- Avoid `using namespace` Statements in Headers
@@ -112,24 +114,25 @@
## Format and Style
- OpenThread uses the `makepretty` build target to reformat code and enforce code format and style. The `makepretty-check` build target is included in OpenThread's continuous integration and must pass before a pull request is merged.
- OpenThread uses `script/make-pretty` to reformat code and enforce code format and style. `script/make-prettycheck` build target is included in OpenThread's continuous integration and must pass before a pull request is merged.
-The `make pretty` and `makepretty-check` build targets require [clang-format v5.0.1](http://releases.llvm.org/download.html#5.0.1).
-`script/make-pretty` requires [clang-format v9.0.0](https://releases.llvm.org/download.html#9.0.0) for C/C++ and [yapf v0.31.0](https://github.com/google/yapf) for Python.
### 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 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.
- File names should be all lower case.
- File extensions shall be indicative and appropriate for the type and usage of the source or header file.
### Naming
- Names should be descriptive but not overly so and they should give some idea of scope and should be selected such that *wrong code looks wrong*.
- Names should be descriptive but not overly so and they should give some idea of scope and should be selected such that _wrong code looks wrong_.
- 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 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*.
- 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.
- All OpenThread C++ code should be in the ‘ot’ top-level namespace.
@@ -141,6 +144,7 @@
- All variables that do not have such prefixes shall be assumed to be function local scope.
### White Space
- Indentation shall be 4 space characters.
- Conditionals shall always appear on a separate line from the code to execute as a result of the condition.
- Scoped Variable declarations
@@ -172,16 +176,24 @@
- Describes the purpose, function, and influence of each parameter as well as whether it is an input, an output, or both.
- Describes the return value, if present, and the expected range or constraints of it.
If your description is longer than 120 characters, continue the comment on the next line:
```
* @brief
* Records the history of different events, for example RX and TX messages or network info changes. All tracked
* entries are timestamped.
```
# Python
## Standards
- OpenThread uses and enforces 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.
- OpenThread uses and enforces Python 3.
## Conventions and Best Practices
- Run `pylint` over your code.`pylint` is a tool for finding bugs and style problems in Python source code. It finds problems that are typically caught by a compiler for less dynamic languages like C and C++. Because of the dynamic nature of Python, some warnings may be incorrect; however, spurious warnings should be fairly infrequent.
- Run `pylint` over your code. `pylint` is a tool for finding bugs and style problems in Python source code. It finds problems that are typically caught by a compiler for less dynamic languages like C and C++. Because of the dynamic nature of Python, some warnings may be incorrect; however, spurious warnings should be fairly infrequent.
## Format and Style
- All code should adhere to [PEP 8](https://www.python.org/dev/peps/pep-0008/).
- All code should adhere to [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html) except maximum line length being 119.
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)).
* 13: `CAP_MCU_POWER_SAVE`: Support for controlling NCP's MCU power state (`PROP_MCU_POWER_STATE`).
* 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.
message(FATAL_ERROR"Invalid max RCP restoration count: ${OT_RCP_RESTORATION_MAX_COUNT}")
endif()
option(OT_EXCLUDE_TCPLP_LIB"exclude TCPlp library from build")
#Checks
if(OT_PLATFORM_UDPANDOT_UDP_FORWARD)
message(FATAL_ERROR"OT_PLATFORM_UDP and OT_UDP_FORWARD are exclusive")
endif()
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.