Home
last modified time | relevance | path

Searched refs:aKey (Results 1 – 25 of 78) sorted by relevance

1234

/openthread-latest/src/core/common/
Dsettings_driver.hpp104 Error Add(uint16_t aKey, const void *aValue, uint16_t aValueLength) in Add() argument
110 error = mFlash.Add(aKey, value, aValueLength); in Add()
112 error = otPlatSettingsAdd(GetInstancePtr(), aKey, value, aValueLength); in Add()
127 Error Delete(uint16_t aKey, int aIndex = -1) in Delete() argument
132 error = mFlash.Delete(aKey, aIndex); in Delete()
134 error = otPlatSettingsDelete(GetInstancePtr(), aKey, aIndex); in Delete()
155 Error Get(uint16_t aKey, int aIndex, void *aValue, uint16_t *aValueLength) const in Get() argument
161 error = mFlash.Get(aKey, aIndex, value, aValueLength); in Get()
163 error = otPlatSettingsGet(GetInstancePtr(), aKey, aIndex, value, aValueLength); in Get()
183 …Error Get(uint16_t aKey, void *aValue, uint16_t *aValueLength) const { return Get(aKey, 0, aValue,… in Get() argument
[all …]
Dbinary_search.hpp72 static const Entry *Find(const Key &aKey, const Entry (&aTable)[kLength]) in Find() argument
75 Find(&aKey, &aTable[0], kLength, sizeof(aTable[0]), BinarySearch::Compare<Key, Entry>)); in Find()
104 typedef int (&Comparator)(const void *aKey, const void *aEntry);
111 template <typename Key, typename Entry> static int Compare(const void *aKey, const void *aEntry) in Compare() argument
113 return static_cast<const Entry *>(aEntry)->Compare(*static_cast<const Key *>(aKey)); in Compare()
116 static const void *Find(const void *aKey,
Dsettings.cpp82 void SettingsBase::LogPrefix(Action aAction, Key aKey, const Ip6::Prefix &aPrefix) in LogPrefix() argument
84 LogInfo("%s %s %s", ActionToString(aAction), KeyToString(aKey), aPrefix.ToString().AsCString()); in LogPrefix()
151 const char *SettingsBase::KeyToString(Key aKey) in KeyToString() argument
199 OT_ASSERT(aKey <= kLastKey); in KeyToString()
201 return kKeyStrings[aKey]; in KeyToString()
403 Error Settings::ReadEntry(Key aKey, void *aValue, uint16_t aMaxLength) const in ReadEntry() argument
408 error = Get<SettingsDriver>().Get(aKey, aValue, &length); in ReadEntry()
409 Log(kActionRead, error, aKey, aValue); in ReadEntry()
414 Error Settings::SaveEntry(Key aKey, const void *aValue, void *aPrev, uint16_t aLength) in SaveEntry() argument
420 …if ((Get<SettingsDriver>().Get(aKey, aPrev, &readLength) == kErrorNone) && (readLength == aLength)… in SaveEntry()
[all …]
/openthread-latest/tests/nexus/platform/
Dnexus_settings.cpp45 otError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue, uint16… in otPlatSettingsGet() argument
47 return AsNode(aInstance).mSettings.Get(aKey, aIndex, aValue, aValueLength); in otPlatSettingsGet()
50 otError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aVa… in otPlatSettingsSet() argument
52 return AsNode(aInstance).mSettings.SetOrAdd(Settings::kSet, aKey, aValue, aValueLength); in otPlatSettingsSet()
55 otError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aVa… in otPlatSettingsAdd() argument
57 return AsNode(aInstance).mSettings.SetOrAdd(Settings::kAdd, aKey, aValue, aValueLength); in otPlatSettingsAdd()
60 otError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex) in otPlatSettingsDelete() argument
62 return AsNode(aInstance).mSettings.Delete(aKey, aIndex); in otPlatSettingsDelete()
72 Error Settings::Get(uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength) const in Get() argument
79 entry = mEntries.FindMatching(aKey); in Get()
[all …]
Dnexus_settings.hpp47 Error Get(uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength) const;
48 Error SetOrAdd(SetAddMode aMode, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength);
49 Error Delete(uint16_t aKey, int aIndex);
69 bool Matches(uint16_t aKey) const { return mKey == aKey; } in Matches()
/openthread-latest/src/core/utils/
Dflash.hpp82 Error Get(uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength) const;
98 Error Set(uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength);
111 Error Add(uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength);
124 Error Delete(uint16_t aKey, int aIndex);
141 void Init(uint16_t aKey, bool aFirst) in Init() argument
143 mKey = aKey; in Init()
156 void SetKey(uint16_t aKey) { mKey = aKey; } in SetKey() argument
208 Error Add(uint16_t aKey, bool aFirst, const uint8_t *aValue, uint16_t aValueLength);
209 bool DoesValidRecordExist(uint32_t aOffset, uint16_t aKey) const;
Dflash.cpp114 Error Flash::Get(uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength) const in Get() argument
126 if ((record.GetKey() != aKey) || !record.IsValid()) in Get()
165 Error Flash::Set(uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength) in Set() argument
167 return Add(aKey, true, aValue, aValueLength); in Set()
170 Error Flash::Add(uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength) in Add() argument
172 bool first = (Get(aKey, 0, nullptr, nullptr) == kErrorNotFound); in Add()
174 return Add(aKey, first, aValue, aValueLength); in Add()
177 Error Flash::Add(uint16_t aKey, bool aFirst, const uint8_t *aValue, uint16_t aValueLength) in Add() argument
182 record.Init(aKey, aFirst); in Add()
204 bool Flash::DoesValidRecordExist(uint32_t aOffset, uint16_t aKey) const in DoesValidRecordExist()
[all …]
/openthread-latest/src/posix/platform/
Dconfig_file.cpp53 bool ConfigFile::HasKey(const char *aKey) const in HasKey()
57 return (Get(aKey, iterator, nullptr, 0) == OT_ERROR_NONE); in HasKey()
62 otError ConfigFile::Get(const char *aKey, int &aIterator, char *aValue, int aValueLength) const in Get() argument
71 VerifyOrExit(aKey != nullptr, error = OT_ERROR_INVALID_ARGS); in Get()
102 if (strcmp(aKey, key) == 0) in Get()
129 otError ConfigFile::Add(const char *aKey, const char *aValue) in Add() argument
137 VerifyOrExit((aKey != nullptr) && (aValue != nullptr), error = OT_ERROR_INVALID_ARGS); in Add()
147 VerifyOrDie(fprintf(fp, "%s=%s\n", aKey, aValue) > 0, OT_EXIT_ERROR_ERRNO); in Add()
163 otError ConfigFile::Clear(const char *aKey) in Clear() argument
171 VerifyOrExit(aKey != nullptr, error = OT_ERROR_INVALID_ARGS); in Clear()
[all …]
Dsettings.cpp67 static bool isSensitiveKey(uint16_t aKey) in isSensitiveKey() argument
75 VerifyOrExit(aKey != sSensitiveKeys[i], ret = true); in isSensitiveKey()
139 otError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue, uint16… in otPlatSettingsGet() argument
147 if (isSensitiveKey(aKey)) in otPlatSettingsGet()
149 error = otPosixSecureSettingsGet(aInstance, aKey, aIndex, aValue, aValueLength); in otPlatSettingsGet()
154 error = sSettingsFile.Get(aKey, aIndex, aValue, aValueLength); in otPlatSettingsGet()
162 otError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aVa… in otPlatSettingsSet() argument
169 if (isSensitiveKey(aKey)) in otPlatSettingsSet()
171 error = otPosixSecureSettingsSet(aInstance, aKey, aValue, aValueLength); in otPlatSettingsSet()
176 sSettingsFile.Set(aKey, aValue, aValueLength); in otPlatSettingsSet()
[all …]
Dsettings_file.cpp113 otError SettingsFile::Get(uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength) in Get() argument
137 if (key == aKey) in Get()
171 void SettingsFile::Set(uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength) in Set() argument
177 switch (Delete(aKey, -1, &swapFd)) in Set()
188 VerifyOrDie(write(swapFd, &aKey, sizeof(aKey)) == sizeof(aKey) && in Set()
196 void SettingsFile::Add(uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength) in Add() argument
212 VerifyOrDie(write(swapFd, &aKey, sizeof(aKey)) == sizeof(aKey) && in Add()
220 otError SettingsFile::Delete(uint16_t aKey, int aIndex) { return Delete(aKey, aIndex, nullptr); } in Delete() argument
222 otError SettingsFile::Delete(uint16_t aKey, int aIndex, int *aSwapFd) in Delete() argument
253 if (aKey == key) in Delete()
Dsettings_file.hpp72 otError Get(uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength);
81 void Set(uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength);
90 void Add(uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength);
102 otError Delete(uint16_t aKey, int aIndex);
117 otError Delete(uint16_t aKey, int aIndex, int *aSwapFd);
Dconfig_file.hpp67 otError Get(const char *aKey, int &aIterator, char *aValue, int aValueLength) const;
78 otError Add(const char *aKey, const char *aValue);
88 otError Clear(const char *aKey);
98 bool HasKey(const char *aKey) const;
/openthread-latest/examples/platforms/utils/
Dsettings_ram.c70 otError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue, uint16… in otPlatSettingsGet() argument
85 if (aKey == currentBlock->key) in otPlatSettingsGet()
122 otError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aVa… in otPlatSettingsSet() argument
135 if (aKey == currentBlock->key) in otPlatSettingsSet()
153 return otPlatSettingsAdd(aInstance, aKey, aValue, aValueLength); in otPlatSettingsSet()
156 otError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aVa… in otPlatSettingsAdd() argument
167 currentBlock->key = aKey; in otPlatSettingsAdd()
183 otError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex) in otPlatSettingsDelete() argument
199 if (aKey == currentBlock->key) in otPlatSettingsDelete()
/openthread-latest/src/lib/spinel/
Dradio_spinel.hpp885 otError Get(spinel_prop_key_t aKey, const char *aFormat, ...);
900 otError GetWithParam(spinel_prop_key_t aKey,
917 otError Set(spinel_prop_key_t aKey, const char *aFormat, ...);
930 otError Insert(spinel_prop_key_t aKey, const char *aFormat, ...);
943 otError Remove(spinel_prop_key_t aKey, const char *aFormat, ...);
1137 otError RequestV(uint32_t aCommand, spinel_prop_key_t aKey, const char *aFormat, va_list aArgs);
1138 otError Request(uint32_t aCommand, spinel_prop_key_t aKey, const char *aFormat, ...);
1141 spinel_prop_key_t aKey,
1146 spinel_prop_key_t aKey,
1151 spinel_prop_key_t aKey,
[all …]
Dspinel_prop_codec.cpp171 otPlatDnssdKey &aKey, in DecodeDnssdKey() argument
178 SuccessOrExit(error = aDecoder.ReadUtf8(aKey.mName)); in DecodeDnssdKey()
182 SuccessOrExit(error = aDecoder.ReadUtf8(aKey.mServiceType)); in DecodeDnssdKey()
186 aKey.mServiceType = nullptr; in DecodeDnssdKey()
189 SuccessOrExit(error = aDecoder.ReadDataWithLen(aKey.mKeyData, aKey.mKeyDataLength)); in DecodeDnssdKey()
190 SuccessOrExit(error = aDecoder.ReadUint16(aKey.mClass)); in DecodeDnssdKey()
191 SuccessOrExit(error = aDecoder.ReadUint32(aKey.mTtl)); in DecodeDnssdKey()
Dradio_spinel.cpp431 spinel_prop_key_t aKey, in HandleWaitingResponse() argument
435 if (aKey == SPINEL_PROP_LAST_STATUS) in HandleWaitingResponse()
444 else if (aKey == SPINEL_PROP_NEST_STREAM_MFG) in HandleWaitingResponse()
456 else if (aKey == mWaitingKey) in HandleWaitingResponse()
499 void RadioSpinel::HandleValueIs(spinel_prop_key_t aKey, const uint8_t *aBuffer, uint16_t aLength) in HandleValueIs() argument
504 if (aKey == SPINEL_PROP_STREAM_RAW) in HandleValueIs()
509 else if (aKey == SPINEL_PROP_LAST_STATUS) in HandleValueIs()
542 else if (aKey == SPINEL_PROP_MAC_ENERGY_SCAN_RESULT) in HandleValueIs()
557 else if (aKey == SPINEL_PROP_STREAM_DEBUG) in HandleValueIs()
568 else if ((aKey == SPINEL_PROP_STREAM_LOG) && sSupportsLogStream) in HandleValueIs()
[all …]
/openthread-latest/src/core/crypto/
Dstorage.cpp73 LiteralKey::LiteralKey(const Key &aKey) in LiteralKey() argument
74 : mKey(aKey.GetBytes()) in LiteralKey()
75 , mLength(aKey.GetLength()) in LiteralKey()
78 if (aKey.IsKeyRef()) in LiteralKey()
82 SuccessOrAssert(aKey.ExtractKey(mBuffer, mLength)); in LiteralKey()
/openthread-latest/src/posix/platform/include/openthread/platform/
Dsecure_settings.h94 uint16_t aKey,
115 otError otPosixSecureSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint1…
136 otError otPosixSecureSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint1…
152 otError otPosixSecureSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex);
/openthread-latest/tests/gtest/
Dfake_platform.cpp212 otError FakePlatform::SettingsGet(uint16_t aKey, uint16_t aIndex, uint8_t *aValue, uint16_t *aValue… in SettingsGet() argument
214 auto setting = mSettings.find(aKey); in SettingsGet()
249 otError FakePlatform::SettingsSet(uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength) in SettingsSet() argument
253 mSettings[aKey].clear(); in SettingsSet()
254 mSettings[aKey].push_back(setting); in SettingsSet()
259 otError FakePlatform::SettingsAdd(uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength) in SettingsAdd() argument
263 mSettings[aKey].push_back(setting); in SettingsAdd()
268 otError FakePlatform::SettingsDelete(uint16_t aKey, int aIndex) in SettingsDelete() argument
270 auto setting = mSettings.find(aKey); in SettingsDelete()
519 otError otPlatSettingsGet(otInstance *, uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValu… in otPlatSettingsGet() argument
[all …]
/openthread-latest/include/openthread/platform/
Dsettings.h143 otError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue, uint16…
172 otError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aVa…
208 otError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aVa…
229 otError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex);
/openthread-latest/src/core/api/
Dcrypto_api.cpp44 void otCryptoHmacSha256(const otCryptoKey *aKey, const uint8_t *aBuf, uint16_t aBufLength, otCrypto… in otCryptoHmacSha256() argument
50 hmac.Start(AsCoreType(aKey)); in otCryptoHmacSha256()
55 void otCryptoAesCcm(const otCryptoKey *aKey, in otCryptoAesCcm() argument
74 aesCcm.SetKey(AsCoreType(aKey)); in otCryptoAesCcm()
Dmdns_api.cpp99 const otMdnsKey *aKey, in otMdnsRegisterKey() argument
103 AssertPointerIsNotNull(aKey); in otMdnsRegisterKey()
105 …return AsCoreType(aInstance).Get<Dns::Multicast::Core>().RegisterKey(*aKey, aRequestId, aCallback); in otMdnsRegisterKey()
108 otError otMdnsUnregisterKey(otInstance *aInstance, const otMdnsKey *aKey) in otMdnsUnregisterKey() argument
110 AssertPointerIsNotNull(aKey); in otMdnsUnregisterKey()
112 return AsCoreType(aInstance).Get<Dns::Multicast::Core>().UnregisterKey(*aKey); in otMdnsUnregisterKey()
150 otError otMdnsGetNextKey(otInstance *aInstance, otMdnsIterator *aIterator, otMdnsKey *aKey, otMdnsE… in otMdnsGetNextKey() argument
153 AssertPointerIsNotNull(aKey); in otMdnsGetNextKey()
156 return AsCoreType(aInstance).Get<Dns::Multicast::Core>().GetNextKey(*aIterator, *aKey, *aState); in otMdnsGetNextKey()
/openthread-latest/src/core/mac/
Dmac_types.cpp323 void KeyMaterial::SetFrom(const Key &aKey, bool aIsExportable) in SetFrom() argument
335 … Crypto::Storage::kTypeVolatile, aKey.GetBytes(), Key::kSize)); in SetFrom()
340 SetKey(aKey); in SetFrom()
345 void KeyMaterial::ExtractKey(Key &aKey) const in ExtractKey()
348 aKey.Clear(); in ExtractKey()
354 SuccessOrAssert(Crypto::Storage::ExportKey(GetKeyRef(), aKey.m8, Key::kSize, keySize)); in ExtractKey()
357 aKey = GetKey(); in ExtractKey()
/openthread-latest/src/ncp/
Dncp_base.hpp301 void DnssdRegisterKey(const otPlatDnssdKey *aKey,
312 void DnssdUnregisterKey(const otPlatDnssdKey *aKey,
367 spinel_prop_key_t aKey);
368 static PropertyHandler FindGetPropertyHandler(spinel_prop_key_t aKey);
369 static PropertyHandler FindSetPropertyHandler(spinel_prop_key_t aKey);
370 static PropertyHandler FindInsertPropertyHandler(spinel_prop_key_t aKey);
371 static PropertyHandler FindRemovePropertyHandler(spinel_prop_key_t aKey);
373 …bool HandlePropertySetForSpecialProperties(uint8_t aHeader, spinel_prop_key_t aKey, otError &aE…
374 otError HandleCommandPropertySet(uint8_t aHeader, spinel_prop_key_t aKey);
375 …otError HandleCommandPropertyInsertRemove(uint8_t aHeader, spinel_prop_key_t aKey, unsigned int aC…
[all …]
/openthread-latest/tests/fuzz/
Dfuzzer_platform.cpp475 otError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue, uint16… in otPlatSettingsGet() argument
478 OT_UNUSED_VARIABLE(aKey); in otPlatSettingsGet()
485 otError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aVa… in otPlatSettingsSet() argument
488 OT_UNUSED_VARIABLE(aKey); in otPlatSettingsSet()
494 otError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aVa… in otPlatSettingsAdd() argument
497 OT_UNUSED_VARIABLE(aKey); in otPlatSettingsAdd()
503 otError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex) in otPlatSettingsDelete() argument
506 OT_UNUSED_VARIABLE(aKey); in otPlatSettingsDelete()
598 const otPlatDnssdKey *aKey, in otPlatDnssdRegisterKey() argument
603 OT_UNUSED_VARIABLE(aKey); in otPlatDnssdRegisterKey()
[all …]

1234