/openthread-latest/src/core/common/ |
D | frame_builder.cpp | 71 Error FrameBuilder::AppendBytes(const void *aBuffer, uint16_t aLength) in AppendBytes() argument 75 VerifyOrExit(CanAppend(aLength), error = kErrorNoBufs); in AppendBytes() 76 memcpy(mBuffer + mLength, aBuffer, aLength); in AppendBytes() 77 mLength += aLength; in AppendBytes() 108 …r FrameBuilder::AppendBytesFromMessage(const Message &aMessage, uint16_t aOffset, uint16_t aLength) in AppendBytesFromMessage() argument 112 VerifyOrExit(CanAppend(aLength), error = kErrorNoBufs); in AppendBytesFromMessage() 113 SuccessOrExit(error = aMessage.Read(aOffset, mBuffer + mLength, aLength)); in AppendBytesFromMessage() 114 mLength += aLength; in AppendBytesFromMessage() 121 void *FrameBuilder::AppendLength(uint16_t aLength) in AppendLength() argument 125 VerifyOrExit(CanAppend(aLength)); in AppendLength() [all …]
|
D | message.cpp | 218 Error Message::ResizeMessage(uint16_t aLength) in ResizeMessage() argument 228 while (curLength < aLength) in ResizeMessage() 276 Error Message::SetLength(uint16_t aLength) in SetLength() argument 279 uint16_t totalLengthRequest = GetReserved() + aLength; in SetLength() 284 GetMetadata().mLength = aLength; in SetLength() 287 if (GetOffset() > aLength) in SetLength() 289 SetOffset(aLength); in SetLength() 378 Error Message::AppendBytes(const void *aBuf, uint16_t aLength) in AppendBytes() argument 383 SuccessOrExit(error = SetLength(GetLength() + aLength)); in AppendBytes() 384 WriteBytes(oldLength, aBuf, aLength); in AppendBytes() [all …]
|
D | heap_data.cpp | 42 Error Data::SetFrom(const uint8_t *aBuffer, uint16_t aLength) in SetFrom() argument 46 SuccessOrExit(error = UpdateBuffer(aLength)); in SetFrom() 47 VerifyOrExit(aLength != 0); in SetFrom() 49 SuccessOrAssert(mData.CopyBytesFrom(aBuffer, aLength)); in SetFrom() 60 Error Data::SetFrom(const Message &aMessage, uint16_t aOffset, uint16_t aLength) in SetFrom() argument 64 VerifyOrExit(aOffset + aLength <= aMessage.GetLength(), error = kErrorParse); in SetFrom() 66 SuccessOrExit(error = UpdateBuffer(aLength)); in SetFrom() 67 VerifyOrExit(aLength != 0); in SetFrom() 69 SuccessOrAssert(aMessage.Read(aOffset, mData.GetBytes(), aLength)); in SetFrom() 81 bool Data::Matches(const uint8_t *aBuffer, uint16_t aLength) const in Matches() [all …]
|
D | frame_builder.hpp | 91 void SetMaxLength(uint16_t aLength) { mMaxLength = aLength; } in SetMaxLength() argument 109 …bool CanAppend(uint16_t aLength) const { return (static_cast<uint32_t>(mLength) + aLength) <= mMax… in CanAppend() 170 Error AppendBytes(const void *aBuffer, uint16_t aLength); 194 Error AppendBytesFromMessage(const Message &aMessage, uint16_t aOffset, uint16_t aLength); 226 void *AppendLength(uint16_t aLength); 256 void WriteBytes(uint16_t aOffset, const void *aBuffer, uint16_t aLength); 289 Error InsertBytes(uint16_t aOffset, const void *aBuffer, uint16_t aLength); 322 void RemoveBytes(uint16_t aOffset, uint16_t aLength);
|
D | data.hpp | 85 uint16_t aLength, 121 void Init(const void *aBuffer, LengthType aLength) in Init() argument 124 mLength = aLength; in Init() 173 void SetLength(LengthType aLength) { mLength = aLength; } in SetLength() argument 275 void Init(void *aBuffer, LengthType aLength) { Base::Init(aBuffer, aLength); } in Init() argument 335 Error CopyBytesFrom(const uint8_t *aBuffer, LengthType aLength) in CopyBytesFrom() argument 337 Error error = (mLength >= aLength) ? kErrorNone : kErrorNoBufs; in CopyBytesFrom() 339 mLength = Min(mLength, aLength); in CopyBytesFrom()
|
D | frame_data.cpp | 87 Error FrameData::ReadBytes(void *aBuffer, uint16_t aLength) in ReadBytes() argument 91 VerifyOrExit(CanRead(aLength), error = kErrorParse); in ReadBytes() 92 memcpy(aBuffer, GetBytes(), aLength); in ReadBytes() 93 SkipOver(aLength); in ReadBytes() 99 void FrameData::SkipOver(uint16_t aLength) { Init(GetBytes() + aLength, GetLength() - aLength); } in SkipOver() argument
|
D | offset_range.cpp | 43 void OffsetRange::Init(uint16_t aOffset, uint16_t aLength) in Init() argument 48 mLength = Min(aLength, maxLength); in Init() 63 void OffsetRange::AdvanceOffset(uint32_t aLength) in AdvanceOffset() argument 65 uint16_t length = static_cast<uint16_t>(Min<uint32_t>(aLength, mLength)); in AdvanceOffset() 71 void OffsetRange::ShrinkLength(uint16_t aLength) { mLength = Min(mLength, aLength); } in ShrinkLength() argument
|
D | offset_range.hpp | 60 void Init(uint16_t aOffset, uint16_t aLength); 130 bool Contains(uint32_t aLength) const { return aLength <= mLength; } in Contains() 141 void AdvanceOffset(uint32_t aLength); 151 void ShrinkLength(uint16_t aLength);
|
D | frame_data.hpp | 62 bool CanRead(uint16_t aLength) const { return GetLength() >= aLength; } in CanRead() 135 Error ReadBytes(void *aBuffer, uint16_t aLength); 162 void SkipOver(uint16_t aLength);
|
D | message.hpp | 507 Error SetLength(uint16_t aLength); 656 Error PrependBytes(const void *aBuf, uint16_t aLength); 685 void RemoveHeader(uint16_t aLength); 699 void RemoveHeader(uint16_t aOffset, uint16_t aLength); 715 Error InsertHeader(uint16_t aOffset, uint16_t aLength); 725 void RemoveFooter(uint16_t aLength); 738 Error AppendBytes(const void *aBuf, uint16_t aLength); 753 Error AppendBytesFromMessage(const Message &aMessage, uint16_t aOffset, uint16_t aLength); 818 uint16_t ReadBytes(uint16_t aOffset, void *aBuf, uint16_t aLength) const; 844 Error Read(uint16_t aOffset, void *aBuf, uint16_t aLength) const; [all …]
|
D | binary_search.hpp | 106 template <typename Entry> static constexpr bool IsSorted(const Entry *aTable, uint16_t aLength) in IsSorted() argument 108 …return (aLength <= 1) ? true : Entry::AreInOrder(aTable[0], aTable[1]) && IsSorted(aTable + 1, aLe… in IsSorted() 118 uint16_t aLength,
|
D | data.cpp | 40 uint16_t aLength, in MatchBytes() argument 47 matches = (memcmp(aFirstBuffer, aSecondBuffer, aLength) == 0); in MatchBytes() 51 while (aLength-- != 0) in MatchBytes()
|
/openthread-latest/src/core/net/ |
D | tcp6_ext.cpp | 54 size_t aLength, in Write() argument 68 aLength = Min(aLength, bytesFree); in Write() 69 VerifyOrExit(aLength != 0); in Write() 82 if ((aFlags & OT_TCP_CIRCULAR_SEND_BUFFER_WRITE_MORE_TO_COME) != 0 && aLength < bytesFree) in Write() 88 if (aLength <= bytesUntilWrap) in Write() 90 memcpy(&mDataBuffer[writeIndex], aData, aLength); in Write() 113 dataSendLink.mLength = aLength; in Write() 116 static_cast<unsigned>(writeIndex), static_cast<unsigned>(aLength)); in Write() 122 LogDebg("Extending tail link by length %u", static_cast<unsigned>(aLength)); in Write() 123 error = aEndpoint.SendByExtension(aLength, flags); in Write() [all …]
|
D | ip6_address.hpp | 137 void Set(const uint8_t *aPrefix, uint8_t aLength); 158 void SetLength(uint8_t aLength) { mLength = aLength; } in SetLength() argument 260 static uint8_t SizeForLength(uint8_t aLength) { return BytesForBitSize(aLength); } in SizeForLength() argument 283 static bool IsValidNat64PrefixLength(uint8_t aLength); 777 void GetPrefix(uint8_t aLength, Prefix &aPrefix) const { aPrefix.Set(mFields.m8, aLength); } in GetPrefix() argument 966 void AppendHexWords(StringWriter &aWriter, uint8_t aLength) const;
|
/openthread-latest/tests/gtest/ |
D | fake_coprocessor_platform.cpp | 47 otError DirectSpinelInterface::SendFrame(const uint8_t *aFrame, uint16_t aLength) in SendFrame() argument 54 SuccessOrExit(error = hdlcEncoder.Encode(aFrame, aLength)); in SendFrame() 75 int DirectSpinelInterface::Receive(const uint8_t *aBuffer, uint16_t aLength) in Receive() argument 80 hdlcDecoder.Decode(aBuffer, aLength); in Receive() 82 return aLength; in Receive() 91 otNcpHdlcInit(mInstance, [](const uint8_t *aBuf, uint16_t aLength) -> int { in FakeCoprocessorPlatform() argument 93 .mSpinelInterface.Receive(aBuf, aLength); in FakeCoprocessorPlatform()
|
/openthread-latest/src/core/api/ |
D | message_api.cpp | 44 …tMessageSetLength(otMessage *aMessage, uint16_t aLength) { return AsCoreType(aMessage).SetLength(a… in otMessageSetLength() argument 95 otError otMessageAppend(otMessage *aMessage, const void *aBuf, uint16_t aLength) in otMessageAppend() argument 99 return AsCoreType(aMessage).AppendBytes(aBuf, aLength); in otMessageAppend() 102 uint16_t otMessageRead(const otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength) in otMessageRead() argument 106 return AsCoreType(aMessage).ReadBytes(aOffset, aBuf, aLength); in otMessageRead() 109 int otMessageWrite(otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength) in otMessageWrite() argument 113 AsCoreType(aMessage).WriteBytes(aOffset, aBuf, aLength); in otMessageWrite() 115 return aLength; in otMessageWrite()
|
D | dataset_api.cpp | 100 uint8_t aLength, in otDatasetSendMgmtActiveGet() argument 104 … aTlvTypes, aLength, aAddress); in otDatasetSendMgmtActiveGet() 110 uint8_t aLength, in otDatasetSendMgmtActiveSet() argument 115 … aLength, aCallback, aContext); in otDatasetSendMgmtActiveSet() 121 uint8_t aLength, in otDatasetSendMgmtPendingGet() argument 125 … aTlvTypes, aLength, aAddress); in otDatasetSendMgmtPendingGet() 131 uint8_t aLength, in otDatasetSendMgmtPendingSet() argument 136 … aLength, aCallback, aContext); in otDatasetSendMgmtPendingSet()
|
/openthread-latest/src/core/radio/ |
D | ble_secure.cpp | 194 Error BleSecure::Send(uint8_t *aBuf, uint16_t aLength) in Send() argument 204 SuccessOrExit(error = mSendMessage->AppendBytes(aBuf, aLength)); in Send() 210 Error BleSecure::SendApplicationTlv(uint8_t *aBuf, uint16_t aLength) in SendApplicationTlv() argument 213 if (aLength > Tlv::kBaseTlvMaxLength) in SendApplicationTlv() 218 tlv.SetLength(aLength); in SendApplicationTlv() 226 tlv.SetLength((uint8_t)aLength); in SendApplicationTlv() 230 error = Send(aBuf, aLength); in SendApplicationTlv() 251 Error BleSecure::HandleBleReceive(uint8_t *aBuf, uint16_t aLength) in HandleBleReceive() argument 262 SuccessOrExit(error = message->AppendBytes(aBuf, aLength)); in HandleBleReceive() 351 void BleSecure::HandleTlsReceive(void *aContext, uint8_t *aBuf, uint16_t aLength) in HandleTlsReceive() argument [all …]
|
/openthread-latest/src/lib/spinel/ |
D | multi_frame_buffer.hpp | 216 otError SetLength(uint16_t aLength) in SetLength() argument 220 if (GetFrame() + aLength <= GetArrayEnd(mBuffer)) in SetLength() 222 mWritePointer = GetFrame() + aLength; in SetLength() 345 otError GetNextSavedFrame(uint8_t *&aFrame, uint16_t &aLength) in GetNextSavedFrame() argument 351 aFrame = (aFrame == nullptr) ? mBuffer : aFrame + aLength; in GetNextSavedFrame() 358 aLength = totalLength - skipLength; in GetNextSavedFrame() 363 aLength = 0; in GetNextSavedFrame()
|
D | radio_spinel.hpp | 1115 typedef otError (RadioSpinel::*ResponseHandler)(const uint8_t *aBuffer, uint16_t aLength); 1155 …otError ParseRadioFrame(otRadioFrame &aFrame, const uint8_t *aBuffer, uint16_t aLength, spinel_ssi… 1172 void HandleNotification(const uint8_t *aFrame, uint16_t aLength, bool &aShouldSaveFrame); 1173 void HandleNotification(const uint8_t *aFrame, uint16_t aLength); 1174 void HandleValueIs(spinel_prop_key_t aKey, const uint8_t *aBuffer, uint16_t aLength); 1176 void HandleResponse(const uint8_t *aBuffer, uint16_t aLength); 1177 …eTransmitDone(uint32_t aCommand, spinel_prop_key_t aKey, const uint8_t *aBuffer, uint16_t aLength); 1178 …itingResponse(uint32_t aCommand, spinel_prop_key_t aKey, const uint8_t *aBuffer, uint16_t aLength); 1191 uint16_t aLength, 1195 …void HandleReceivedFrame(const uint8_t *aFrame, uint16_t aLength, uint8_t aHeader, bool &aS… [all …]
|
/openthread-latest/src/core/meshcop/ |
D | tcat_agent.cpp | 507 …dleSetActiveOperationalDataset(const Message &aIncomingMessage, uint16_t aOffset, uint16_t aLength) in HandleSetActiveOperationalDataset() argument 513 offsetRange.Init(aOffset, aLength); in HandleSetActiveOperationalDataset() 554 uint16_t aLength, in HandlePing() argument 561 VerifyOrExit(aLength <= kPingPayloadMaxLength, error = kErrorParse); in HandlePing() 562 if (aLength > ot::Tlv::kBaseTlvMaxLength) in HandlePing() 565 extTlv.SetLength(aLength); in HandlePing() 571 tlv.SetLength(static_cast<uint8_t>(aLength)); in HandlePing() 575 …SuccessOrExit(error = aOutgoingMessage.AppendBytesFromMessage(aIncomingMessage, aOffset, aLength)); in HandlePing() 661 …atAgent::HandlePresentPskdHash(const Message &aIncomingMessage, uint16_t aOffset, uint16_t aLength) in HandlePresentPskdHash() argument 667 SuccessOrExit(error = VerifyHash(aIncomingMessage, aOffset, aLength, mVendorInfo->mPskdString, in HandlePresentPskdHash() [all …]
|
D | dataset.cpp | 190 bool Dataset::ContainsAllTlvs(const Tlv::Type aTlvTypes[], uint8_t aLength) const in ContainsAllTlvs() 194 for (uint8_t index = 0; index < aLength; index++) in ContainsAllTlvs() 325 Error Dataset::SetFrom(const uint8_t *aTlvs, uint8_t aLength) in SetFrom() argument 329 VerifyOrExit(aLength <= kMaxLength, error = kErrorInvalidArgs); in SetFrom() 331 mLength = aLength; in SetFrom() 363 Error Dataset::WriteTlv(Tlv::Type aType, const void *aValue, uint8_t aLength) in WriteTlv() argument 375 VerifyOrExit(sizeof(Tlv) + aLength <= bytesAvailable, error = kErrorNoBufs); in WriteTlv() 380 mLength += sizeof(Tlv) + aLength; in WriteTlv() 383 newTlv->SetLength(aLength); in WriteTlv() 384 memcpy(newTlv->GetValue(), aValue, aLength); in WriteTlv() [all …]
|
/openthread-latest/src/posix/platform/ |
D | trel.cpp | 131 static const char *BufferToString(const uint8_t *aBuffer, uint16_t aLength) in BufferToString() argument 140 cur += snprintf(cur, (uint16_t)(end - cur), "[(len:%d) ", aLength); in BufferToString() 143 while (aLength-- && (num < kMaxWrite)) in BufferToString() 151 if (aLength != 0) in BufferToString() 217 static otError SendPacket(const uint8_t *aBuffer, uint16_t aLength, const otSockAddr *aDestSockAddr) in SendPacket() argument 230 ret = sendto(sSocket, aBuffer, aLength, 0, (struct sockaddr *)&sockAddr, sizeof(sockAddr)); in SendPacket() 232 if (ret != aLength) in SendPacket() 251 sCounters.mTxBytes += aLength; in SendPacket() 256 otThreadErrorToString(error), BufferToString(aBuffer, aLength)); in SendPacket() 347 static void EnqueuePacket(const uint8_t *aBuffer, uint16_t aLength, const otSockAddr *aDestSockAddr) in EnqueuePacket() argument [all …]
|
/openthread-latest/tests/unit/ |
D | test_heap_string.cpp | 167 void VerifyData(const Heap::Data &aData, const uint8_t *aBytes, uint16_t aLength) in VerifyData() argument 174 VerifyOrQuit(aData.Matches(aBytes, aLength)); in VerifyData() 175 VerifyOrQuit(!aData.Matches(aBytes, aLength + 1)); in VerifyData() 177 if (aLength == 0) in VerifyData() 188 VerifyOrQuit(aData.GetLength() == aLength); in VerifyData() 189 VerifyOrQuit(memcmp(aData.GetBytes(), aBytes, aLength) == 0, "Data content is incorrect"); in VerifyData() 192 VerifyOrQuit(memcmp(buffer, aBytes, aLength) == 0, "CopyBytesTo() failed"); in VerifyData() 194 VerifyOrQuit(aData.Matches(buffer, aLength)); in VerifyData() 195 buffer[aLength - 1]++; in VerifyData() 196 VerifyOrQuit(!aData.Matches(buffer, aLength)); in VerifyData()
|
/openthread-latest/src/core/crypto/ |
D | aes_ccm.cpp | 191 void AesCcm::Payload(void *aPlainText, void *aCipherText, uint32_t aLength, Mode aMode) in Payload() argument 197 OT_ASSERT(mPlainTextCur + aLength <= mPlainTextLength); in Payload() 199 for (unsigned i = 0; i < aLength; i++) in Payload() 235 mPlainTextCur += aLength; in Payload() 250 void AesCcm::Payload(Message &aMessage, uint16_t aOffset, uint16_t aLength, Mode aMode) in Payload() argument 254 aMessage.GetFirstChunk(aOffset, aLength, chunk); in Payload() 259 aMessage.GetNextChunk(aLength, chunk); in Payload()
|