Skip to content

Commit 580e325

Browse files
lmaciejonczykrlubos
authored andcommitted
openthread: update OpenThread pre-build libraries
Update OpenThread pre-build libraries for NCS v1.7 release. Signed-off-by: Lukasz Maciejonczyk <[email protected]>
1 parent 0211ba3 commit 580e325

File tree

134 files changed

+1957
-280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+1957
-280
lines changed

openthread/include/openthread/border_router.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,37 @@ otError otBorderRoutingInit(otInstance *aInstance, uint32_t aInfraIfIndex, bool
8686
*/
8787
otError otBorderRoutingSetEnabled(otInstance *aInstance, bool aEnabled);
8888

89+
/**
90+
* This method returns the off-mesh-routable (OMR) prefix.
91+
*
92+
* The randomly generated 64-bit prefix will be published
93+
* in the Thread network if there isn't already an OMR prefix.
94+
*
95+
* @param[in] aInstance A pointer to an OpenThread instance.
96+
* @param[out] aPrefix A pointer to where the prefix will be output to.
97+
*
98+
* @retval OT_ERROR_INVALID_STATE The Border Routing Manager is not initialized yet.
99+
* @retval OT_ERROR_NONE Successfully retrieved the OMR prefix.
100+
*
101+
*/
102+
otError otBorderRoutingGetOmrPrefix(otInstance *aInstance, otIp6Prefix *aPrefix);
103+
104+
/**
105+
* This method returns the on-link prefix for the adjacent infrastructure link.
106+
*
107+
* The randomly generated 64-bit prefix will be advertised
108+
* on the infrastructure link if there isn't already a usable
109+
* on-link prefix being advertised on the link.
110+
*
111+
* @param[in] aInstance A pointer to an OpenThread instance.
112+
* @param[out] aPrefix A pointer to where the prefix will be output to.
113+
*
114+
* @retval OT_ERROR_INVALID_STATE The Border Routing Manager is not initialized yet.
115+
* @retval OT_ERROR_NONE Successfully retrieved the on-link prefix.
116+
*
117+
*/
118+
otError otBorderRoutingGetOnLinkPrefix(otInstance *aInstance, otIp6Prefix *aPrefix);
119+
89120
/**
90121
* This method provides a full or stable copy of the local Thread Network Data.
91122
*

openthread/include/openthread/dataset.h

Lines changed: 71 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,37 @@ extern "C" {
5050
*
5151
*/
5252

53-
#define OT_MASTER_KEY_SIZE 16 ///< Size of the Thread Master Key (bytes)
53+
#define OT_NETWORK_KEY_SIZE 16 ///< Size of the Thread Network Key (bytes)
5454

5555
/**
56-
* @struct otMasterKey
56+
* @struct otNetworkKey
5757
*
58-
* This structure represents a Thread Master Key.
58+
* This structure represents a Thread Network Key.
5959
*
6060
*/
6161
OT_TOOL_PACKED_BEGIN
62-
struct otMasterKey
62+
struct otNetworkKey
6363
{
64-
uint8_t m8[OT_MASTER_KEY_SIZE]; ///< Byte values
64+
uint8_t m8[OT_NETWORK_KEY_SIZE]; ///< Byte values
6565
} OT_TOOL_PACKED_END;
6666

6767
/**
68-
* This structure represents a Thread Master Key.
68+
* This structure represents a Thread Network Key.
6969
*
7070
*/
71-
typedef struct otMasterKey otMasterKey;
71+
typedef struct otNetworkKey otNetworkKey;
7272

7373
#define OT_NETWORK_NAME_MAX_SIZE 16 ///< Maximum size of the Thread Network Name field (bytes)
7474

7575
/**
7676
* This structure represents a Network Name.
7777
*
78+
* The `otNetworkName` is a null terminated C string (i.e., `m8` char array MUST end with null char `\0`).
79+
*
7880
*/
7981
typedef struct otNetworkName
8082
{
81-
char m8[OT_NETWORK_NAME_MAX_SIZE + 1]; ///< Byte values
83+
char m8[OT_NETWORK_NAME_MAX_SIZE + 1]; ///< Byte values. The `+ 1` is for null char.
8284
} otNetworkName;
8385

8486
#define OT_EXT_PAN_ID_SIZE 8 ///< Size of a Thread PAN ID (bytes)
@@ -133,14 +135,14 @@ typedef struct otSecurityPolicy
133135
{
134136
uint16_t mRotationTime; ///< The value for thrKeyRotation in units of hours.
135137

136-
bool mObtainMasterKeyEnabled : 1; ///< Obtaining the Master Key for out-of-band commissioning is enabled
138+
bool mObtainNetworkKeyEnabled : 1; ///< Obtaining the Network Key for out-of-band commissioning is enabled
137139
bool mNativeCommissioningEnabled : 1; ///< Native Commissioning using PSKc is allowed
138140
bool mRoutersEnabled : 1; ///< Thread 1.0/1.1.x Routers are enabled
139141
bool mExternalCommissioningEnabled : 1; ///< External Commissioner authentication is allowed
140142
bool mBeaconsEnabled : 1; ///< Thread 1.0/1.1.x Beacons are enabled
141143
bool mCommercialCommissioningEnabled : 1; ///< Commercial Commissioning is enabled
142144
bool mAutonomousEnrollmentEnabled : 1; ///< Autonomous Enrollment is enabled
143-
bool mMasterKeyProvisioningEnabled : 1; ///< Network Master-key Provisioning is enabled
145+
bool mNetworkKeyProvisioningEnabled : 1; ///< Network Key Provisioning is enabled
144146
bool mTobleLinkEnabled : 1; ///< ToBLE link is enabled
145147
bool mNonCcmRoutersEnabled : 1; ///< Non-CCM Routers enabled
146148
uint8_t mVersionThresholdForRouting : 3; ///< Version-threshold for Routing
@@ -187,7 +189,7 @@ typedef struct otOperationalDatasetComponents
187189
{
188190
bool mIsActiveTimestampPresent : 1; ///< TRUE if Active Timestamp is present, FALSE otherwise.
189191
bool mIsPendingTimestampPresent : 1; ///< TRUE if Pending Timestamp is present, FALSE otherwise.
190-
bool mIsMasterKeyPresent : 1; ///< TRUE if Network Master Key is present, FALSE otherwise.
192+
bool mIsNetworkKeyPresent : 1; ///< TRUE if Network Key is present, FALSE otherwise.
191193
bool mIsNetworkNamePresent : 1; ///< TRUE if Network Name is present, FALSE otherwise.
192194
bool mIsExtendedPanIdPresent : 1; ///< TRUE if Extended PAN ID is present, FALSE otherwise.
193195
bool mIsMeshLocalPrefixPresent : 1; ///< TRUE if Mesh Local Prefix is present, FALSE otherwise.
@@ -209,7 +211,7 @@ typedef struct otOperationalDataset
209211
{
210212
uint64_t mActiveTimestamp; ///< Active Timestamp
211213
uint64_t mPendingTimestamp; ///< Pending Timestamp
212-
otMasterKey mMasterKey; ///< Network Master Key
214+
otNetworkKey mNetworkKey; ///< Network Key
213215
otNetworkName mNetworkName; ///< Network Name
214216
otExtendedPanId mExtendedPanId; ///< Extended PAN ID
215217
otMeshLocalPrefix mMeshLocalPrefix; ///< Mesh Local Prefix
@@ -251,7 +253,7 @@ typedef enum otMeshcopTlvType
251253
OT_MESHCOP_TLV_EXTPANID = 2, ///< meshcop Extended Pan Id TLV
252254
OT_MESHCOP_TLV_NETWORKNAME = 3, ///< meshcop Network Name TLV
253255
OT_MESHCOP_TLV_PSKC = 4, ///< meshcop PSKc TLV
254-
OT_MESHCOP_TLV_MASTERKEY = 5, ///< meshcop Network Master Key TLV
256+
OT_MESHCOP_TLV_NETWORKKEY = 5, ///< meshcop Network Key TLV
255257
OT_MESHCOP_TLV_NETWORK_KEY_SEQUENCE = 6, ///< meshcop Network Key Sequence TLV
256258
OT_MESHCOP_TLV_MESHLOCALPREFIX = 7, ///< meshcop Mesh Local Prefix TLV
257259
OT_MESHCOP_TLV_STEERING_DATA = 8, ///< meshcop Steering Data TLV
@@ -288,6 +290,21 @@ typedef enum otMeshcopTlvType
288290
OT_MESHCOP_TLV_JOINERADVERTISEMENT = 241, ///< meshcop Joiner Advertisement TLV
289291
} otMeshcopTlvType;
290292

293+
/**
294+
* This function pointer is called when a response to a MGMT_SET request is received or times out.
295+
*
296+
* @param[in] aResult A result of the operation.
297+
* @param[in] aContext A pointer to application-specific context.
298+
*
299+
* @retval OT_ERROR_NONE The request was accepted by the leader.
300+
* @retval OT_ERROR_REJECTED The request was rejected by the leader.
301+
* @retval OT_ERROR_PARSE An error occurred during parsing the response.
302+
* @retval OT_ERROR_ABORT The request was reset by peer.
303+
* @retval OT_ERROR_RESPONSE_TIMEOUT No response or acknowledgment received during timeout period.
304+
*
305+
*/
306+
typedef void (*otDatasetMgmtSetCallback)(otError aResult, void *aContext);
307+
291308
/**
292309
* This function indicates whether a valid network is present in the Active Operational Dataset or not.
293310
*
@@ -328,7 +345,7 @@ otError otDatasetGetActiveTlvs(otInstance *aInstance, otOperationalDatasetTlvs *
328345
* If the dataset does not include an Active Timestamp, the dataset is only partially complete.
329346
*
330347
* If Thread is enabled on a device that has a partially complete Active Dataset, the device will attempt to attach to
331-
* an existing Thread network using any existing information in the dataset. Only the Thread Master Key is needed to
348+
* an existing Thread network using any existing information in the dataset. Only the Thread Network Key is needed to
332349
* attach to a network.
333350
*
334351
* If channel is not included in the dataset, the device will send MLE Announce messages across different channels to
@@ -354,7 +371,7 @@ otError otDatasetSetActive(otInstance *aInstance, const otOperationalDataset *aD
354371
* If the dataset does not include an Active Timestamp, the dataset is only partially complete.
355372
*
356373
* If Thread is enabled on a device that has a partially complete Active Dataset, the device will attempt to attach to
357-
* an existing Thread network using any existing information in the dataset. Only the Thread Master Key is needed to
374+
* an existing Thread network using any existing information in the dataset. Only the Thread Network Key is needed to
358375
* attach to a network.
359376
*
360377
* If channel is not included in the dataset, the device will send MLE Announce messages across different channels to
@@ -450,15 +467,20 @@ otError otDatasetSendMgmtActiveGet(otInstance * aInstan
450467
* @param[in] aDataset A pointer to operational dataset.
451468
* @param[in] aTlvs A pointer to TLVs.
452469
* @param[in] aLength The length of TLVs.
470+
* @param[in] aCallback A pointer to a function that is called on response reception or timeout.
471+
* @param[in] aContext A pointer to application-specific context for @p aCallback.
453472
*
454473
* @retval OT_ERROR_NONE Successfully send the meshcop dataset command.
455474
* @retval OT_ERROR_NO_BUFS Insufficient buffer space to send.
475+
* @retval OT_ERROR_BUSY A previous request is ongoing.
456476
*
457477
*/
458478
otError otDatasetSendMgmtActiveSet(otInstance * aInstance,
459479
const otOperationalDataset *aDataset,
460480
const uint8_t * aTlvs,
461-
uint8_t aLength);
481+
uint8_t aLength,
482+
otDatasetMgmtSetCallback aCallback,
483+
void * aContext);
462484

463485
/**
464486
* This function sends MGMT_PENDING_GET.
@@ -486,15 +508,20 @@ otError otDatasetSendMgmtPendingGet(otInstance * aInsta
486508
* @param[in] aDataset A pointer to operational dataset.
487509
* @param[in] aTlvs A pointer to TLVs.
488510
* @param[in] aLength The length of TLVs.
511+
* @param[in] aCallback A pointer to a function that is called on response reception or timeout.
512+
* @param[in] aContext A pointer to application-specific context for @p aCallback.
489513
*
490514
* @retval OT_ERROR_NONE Successfully send the meshcop dataset command.
491515
* @retval OT_ERROR_NO_BUFS Insufficient buffer space to send.
516+
* @retval OT_ERROR_BUSY A previous request is ongoing.
492517
*
493518
*/
494519
otError otDatasetSendMgmtPendingSet(otInstance * aInstance,
495520
const otOperationalDataset *aDataset,
496521
const uint8_t * aTlvs,
497-
uint8_t aLength);
522+
uint8_t aLength,
523+
otDatasetMgmtSetCallback aCallback,
524+
void * aContext);
498525

499526
/**
500527
* This function generates PSKc from a given pass-phrase, network name, and extended PAN ID.
@@ -515,6 +542,33 @@ otError otDatasetGeneratePskc(const char * aPassPhrase,
515542
const otExtendedPanId *aExtPanId,
516543
otPskc * aPskc);
517544

545+
/**
546+
* This function sets an `otNetworkName` instance from a given null terminated C string.
547+
*
548+
* This function also validates that the given @p aNameString follows UTF-8 encoding and its length is not longer than
549+
* `OT_NETWORK_NAME_MAX_SIZE`.
550+
*
551+
* @param[out] aNetworkName A pointer to the `otNetworkName` to set.
552+
* @param[in] aNameString A name C string.
553+
*
554+
* @retval OT_ERROR_NONE Successfully set @p aNetworkName from @p aNameString.
555+
* @retval OT_ERROR_INVALID_ARGS @p aNameStrng is invalid (too long or does not follow UTF-8 encoding).
556+
*
557+
*/
558+
otError otNetworkNameFromString(otNetworkName *aNetworkName, const char *aNameString);
559+
560+
/**
561+
* This function parses an Operational Dataset from a `otOperationalDatasetTlvs`.
562+
*
563+
* @param[in] aDatasetTlvs A pointer to dataset TLVs.
564+
* @param[out] aDataset A pointer to where the dataset will be placed.
565+
*
566+
* @retval OT_ERROR_NONE Successfully set @p aDataset from @p aDatasetTlvs.
567+
* @retval OT_ERROR_INVALID_ARGS @p aDatasetTlvs is invalid.
568+
*
569+
*/
570+
otError otDatasetParseTlvs(const otOperationalDatasetTlvs *aDatasetTlvs, otOperationalDataset *aDataset);
571+
518572
/**
519573
* @}
520574
*

openthread/include/openthread/diag.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ extern "C" {
5454
/**
5555
* This function processes a factory diagnostics command line.
5656
*
57+
* The output of this function (the content written to @p aOutput) MUST terminate with `\0` and the `\0` is within the
58+
* output buffer.
59+
*
5760
* @param[in] aInstance A pointer to an OpenThread instance.
5861
* @param[in] aArgsLength The number of elements in @p aArgs.
5962
* @param[in] aArgs An array of arguments.
@@ -74,6 +77,9 @@ otError otDiagProcessCmd(otInstance *aInstance,
7477
/**
7578
* This function processes a factory diagnostics command line.
7679
*
80+
* The output of this function (the content written to @p aOutput) MUST terminate with `\0` and the `\0` is within the
81+
* output buffer.
82+
*
7783
* @param[in] aInstance A pointer to an OpenThread instance.
7884
* @param[in] aString A NULL-terminated input string.
7985
* @param[out] aOutput The diagnostics execution result.

openthread/include/openthread/dns_client.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ const otDnsQueryConfig *otDnsClientGetDefaultConfig(otInstance *aInstance);
124124
* (value zero). The unspecified fields are replaced by the corresponding OT config option definitions
125125
* `OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_{}` to form the default query config.
126126
*
127+
* When `OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_SERVER_ADDRESS_AUTO_SET_ENABLE` is enabled, the server's IPv6 address in
128+
* the default config is automatically set and updated by DNS client. This is done only when user does not explicitly
129+
* set or specify it. This behavior requires SRP client and its auto-start feature to be enabled. SRP client will then
130+
* monitor the Thread Network Data for DNS/SRP Service entries to select an SRP server. The selected SRP server address
131+
* is also set as the DNS server address in the default config.
132+
*
127133
* @param[in] aInstance A pointer to an OpenThread instance.
128134
* @param[in] aConfig A pointer to the new query config to use as default.
129135
*

openthread/include/openthread/error.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ typedef enum OT_MUST_USE_RESULT otError
234234
*/
235235
OT_ERROR_PENDING = 36,
236236

237+
/**
238+
* Request rejected.
239+
*/
240+
OT_ERROR_REJECTED = 37,
241+
237242
/**
238243
* The number of defined errors.
239244
*/

0 commit comments

Comments
 (0)