Commit Graph

6 Commits

Author SHA1 Message Date
Abtin Keshavarzian 59385b188b [network-data] use enumeration Type for local vs leader (#3455)
This commit changes `NetworkData` to use an enumeration `Type` to
specify whether a `NetworkData` instance represents local network
data or leader network data.
2019-01-14 13:51:50 -08:00
Abtin Keshavarzian 2abd7a2822 [code-utils] adding helper macro OT_ARRAY_LENGTH() (#2743)
This commit adds helper macro `OT_ARRAY_LENGTH()` to get the number
of elements in an array.
2018-05-29 15:53:53 -07:00
Jonathan Hui 69d98d4a53 [code-style] apply clang-format 2018-02-09 21:43:42 +00:00
Abtin Keshavarzian 02c876ef62 [instance] define ot::Instance class (#2307)
This commit makes the following changes: It defines the public
`otInstance` as an empty opaque structure which is used by all public
C OpenThread APIs. It defines a new class `ot::Instance` (inheriting
from `otInstance) which is then used in core source files. The
functionality related to the instance is also moved/added into the
newly added `Instance` class (as class/static or member methods).
2017-11-13 08:27:57 -08:00
Abtin Keshavarzian 4cb17495b2 [core] pass/locate otInstance to all OpenThread classes
This commit changes the model for OpenThread classes so that all
classes track/locate their owning/parent `otInstance` object (i.e.,
the owning `otInstance` object reference is expected to be passed  as
an input argument in the object constructor). This replaces and
simplifies current model where some of classes track/locate the parent
`ThreadNetif`, `MeshForwarder`, or `Ip6` object references instead.
This helps harmonize the model across OpenThread source and also
simplify the `Locator` class implementation.
2017-10-25 09:00:14 -07:00
Abtin Keshavarzian 8cade88f29 [network-data] iterate over both stable and not-stable network data entries (#2183)
This commit updates the `otNetworkDataIterator` to also store the
sub-tlv offset (in addition to main prefix tlv offset and the entry
index). It also updates two methods `GetNextExternalRoute()` and
`GetNextOnMeshPrefix()`. This commit also adds network data unit
test module.
2017-09-13 14:07:50 -07:00