Home
last modified time | relevance | path

Searched refs:aLength (Results 1 – 25 of 162) sorted by relevance

1234567

/openthread-3.7.0/src/core/common/
Dframe_builder.cpp48 void FrameBuilder::Init(void *aBuffer, uint16_t aLength) in Init() argument
52 mMaxLength = aLength; in Init()
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()
[all …]
Dmessage.cpp228 Error Message::ResizeMessage(uint16_t aLength) in ResizeMessage() argument
238 while (curLength < aLength) in ResizeMessage()
286 Error Message::SetLength(uint16_t aLength) in SetLength() argument
289 uint16_t totalLengthRequest = GetReserved() + aLength; in SetLength()
294 GetMetadata().mLength = aLength; in SetLength()
297 if (GetOffset() > aLength) in SetLength()
299 SetOffset(aLength); in SetLength()
403 Error Message::AppendBytes(const void *aBuf, uint16_t aLength) in AppendBytes() argument
408 SuccessOrExit(error = SetLength(GetLength() + aLength)); in AppendBytes()
409 WriteBytes(oldLength, aBuf, aLength); in AppendBytes()
[all …]
Dheap_data.cpp42 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 …]
Dframe_builder.hpp62 void Init(void *aBuffer, uint16_t aLength);
97 void SetMaxLength(uint16_t aLength) { mMaxLength = aLength; } in SetMaxLength() argument
117 …bool CanAppend(uint16_t aLength) const { return (static_cast<uint32_t>(mLength) + aLength) <= mMax… in CanAppend()
184 Error AppendBytes(const void *aBuffer, uint16_t aLength);
210 Error AppendBytesFromMessage(const Message &aMessage, uint16_t aOffset, uint16_t aLength);
242 void WriteBytes(uint16_t aOffset, const void *aBuffer, uint16_t aLength);
277 Error InsertBytes(uint16_t aOffset, const void *aBuffer, uint16_t aLength);
312 void RemoveBytes(uint16_t aOffset, uint16_t aLength);
Ddata.hpp88 uint16_t aLength,
127 void Init(const void *aBuffer, LengthType aLength) in Init() argument
130 mLength = aLength; in Init()
184 void SetLength(LengthType aLength) { mLength = aLength; } in SetLength() argument
294 void Init(void *aBuffer, LengthType aLength) { Base::Init(aBuffer, aLength); } in Init() argument
360 Error CopyBytesFrom(const uint8_t *aBuffer, LengthType aLength) in CopyBytesFrom() argument
362 Error error = (mLength >= aLength) ? kErrorNone : kErrorNoBufs; in CopyBytesFrom()
364 mLength = Min(mLength, aLength); in CopyBytesFrom()
Dframe_data.cpp87 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
Dmessage.hpp471 Error SetLength(uint16_t aLength);
604 Error PrependBytes(const void *aBuf, uint16_t aLength);
635 void RemoveHeader(uint16_t aLength);
650 void RemoveHeader(uint16_t aOffset, uint16_t aLength);
667 Error InsertHeader(uint16_t aOffset, uint16_t aLength);
678 void RemoveFooter(uint16_t aLength);
692 Error AppendBytes(const void *aBuf, uint16_t aLength);
708 Error AppendBytesFromMessage(const Message &aMessage, uint16_t aOffset, uint16_t aLength);
758 uint16_t ReadBytes(uint16_t aOffset, void *aBuf, uint16_t aLength) const;
774 Error Read(uint16_t aOffset, void *aBuf, uint16_t aLength) const;
[all …]
Dframe_data.hpp64 bool CanRead(uint16_t aLength) const { return GetLength() >= aLength; } in CanRead()
143 Error ReadBytes(void *aBuffer, uint16_t aLength);
172 void SkipOver(uint16_t aLength);
Dbinary_search.hpp108 template <typename Entry> static constexpr bool IsSorted(const Entry *aTable, uint16_t aLength) in IsSorted() argument
110 …return (aLength <= 1) ? true : Entry::AreInOrder(aTable[0], aTable[1]) && IsSorted(aTable + 1, aLe… in IsSorted()
120 uint16_t aLength,
Dtlvs.hpp108 void SetLength(uint8_t aLength) { mLength = aLength; } in SetLength() argument
406 …dTlvValueOffset(const Message &aMessage, uint8_t aType, uint16_t &aValueOffset, uint16_t &aLength);
448 …mplate <typename TlvType> static Error Find(const Message &aMessage, void *aValue, uint8_t aLength) in Find() argument
450 return FindTlv(aMessage, TlvType::kType, aValue, aLength); in Find()
542 static Error AppendTlv(Message &aMessage, uint8_t aType, const void *aValue, uint8_t aLength);
559 …late <typename TlvType> static Error Append(Message &aMessage, const void *aValue, uint8_t aLength) in Append() argument
561 return AppendTlv(aMessage, TlvType::kType, aValue, aLength); in Append()
705 static Error FindTlv(const Message &aMessage, uint8_t aType, void *aValue, uint16_t aLength);
733 void SetLength(uint16_t aLength) in SetLength() argument
736 mLength = BigEndian::HostSwap16(aLength); in SetLength()
Ddata.cpp40 uint16_t aLength, in MatchBytes() argument
47 matches = (memcmp(aFirstBuffer, aSecondBuffer, aLength) == 0); in MatchBytes()
51 while (aLength-- != 0) in MatchBytes()
/openthread-3.7.0/src/core/net/
Dtcp6_ext.cpp59 size_t aLength, in Write() argument
73 aLength = Min(aLength, bytesFree); in Write()
74 VerifyOrExit(aLength != 0); in Write()
87 if ((aFlags & OT_TCP_CIRCULAR_SEND_BUFFER_WRITE_MORE_TO_COME) != 0 && aLength < bytesFree) in Write()
93 if (aLength <= bytesUntilWrap) in Write()
95 memcpy(&mDataBuffer[writeIndex], aData, aLength); in Write()
118 dataSendLink.mLength = aLength; in Write()
121 static_cast<unsigned>(writeIndex), static_cast<unsigned>(aLength)); in Write()
127 LogDebg("Extending tail link by length %u", static_cast<unsigned>(aLength)); in Write()
128 error = aEndpoint.SendByExtension(aLength, flags); in Write()
[all …]
Dip6_address.hpp147 void Set(const uint8_t *aPrefix, uint8_t aLength);
171 void SetLength(uint8_t aLength) { mLength = aLength; } in SetLength() argument
284 static uint8_t SizeForLength(uint8_t aLength) { return BytesForBitSize(aLength); } in SizeForLength() argument
309 static bool IsValidNat64PrefixLength(uint8_t aLength);
850 void GetPrefix(uint8_t aLength, Prefix &aPrefix) const { aPrefix.Set(mFields.m8, aLength); } in GetPrefix() argument
1058 void AppendHexWords(StringWriter &aWriter, uint8_t aLength) const;
/openthread-3.7.0/src/core/api/
Dmessage_api.cpp47 …tMessageSetLength(otMessage *aMessage, uint16_t aLength) { return AsCoreType(aMessage).SetLength(a… in otMessageSetLength() argument
98 otError otMessageAppend(otMessage *aMessage, const void *aBuf, uint16_t aLength) in otMessageAppend() argument
102 return AsCoreType(aMessage).AppendBytes(aBuf, aLength); in otMessageAppend()
105 uint16_t otMessageRead(const otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength) in otMessageRead() argument
109 return AsCoreType(aMessage).ReadBytes(aOffset, aBuf, aLength); in otMessageRead()
112 int otMessageWrite(otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength) in otMessageWrite() argument
116 AsCoreType(aMessage).WriteBytes(aOffset, aBuf, aLength); in otMessageWrite()
118 return aLength; in otMessageWrite()
Ddataset_api.cpp105 uint8_t aLength, in otDatasetSendMgmtActiveGet() argument
109 … aTlvTypes, aLength, aAddress); in otDatasetSendMgmtActiveGet()
115 uint8_t aLength, in otDatasetSendMgmtActiveSet() argument
120aLength, aCallback, aContext); in otDatasetSendMgmtActiveSet()
126 uint8_t aLength, in otDatasetSendMgmtPendingGet() argument
130 … aTlvTypes, aLength, aAddress); in otDatasetSendMgmtPendingGet()
136 uint8_t aLength, in otDatasetSendMgmtPendingSet() argument
141aLength, aCallback, aContext); in otDatasetSendMgmtPendingSet()
/openthread-3.7.0/src/core/radio/
Dble_secure.cpp208 Error BleSecure::Send(uint8_t *aBuf, uint16_t aLength) in Send() argument
218 SuccessOrExit(error = mSendMessage->AppendBytes(aBuf, aLength)); in Send()
224 Error BleSecure::SendApplicationTlv(uint8_t *aBuf, uint16_t aLength) in SendApplicationTlv() argument
227 if (aLength > Tlv::kBaseTlvMaxLength) in SendApplicationTlv()
232 tlv.SetLength(aLength); in SendApplicationTlv()
240 tlv.SetLength((uint8_t)aLength); in SendApplicationTlv()
244 error = Send(aBuf, aLength); in SendApplicationTlv()
265 Error BleSecure::HandleBleReceive(uint8_t *aBuf, uint16_t aLength) in HandleBleReceive() argument
276 SuccessOrExit(error = message->AppendBytes(aBuf, aLength)); in HandleBleReceive()
367 void BleSecure::HandleTlsReceive(void *aContext, uint8_t *aBuf, uint16_t aLength) in HandleTlsReceive() argument
[all …]
/openthread-3.7.0/src/core/meshcop/
Ddataset.cpp186 bool Dataset::ContainsAllTlvs(const Tlv::Type aTlvTypes[], uint8_t aLength) const in ContainsAllTlvs()
190 for (uint8_t index = 0; index < aLength; index++) in ContainsAllTlvs()
317 Error Dataset::SetFrom(const uint8_t *aTlvs, uint8_t aLength) in SetFrom() argument
321 VerifyOrExit(aLength <= kMaxLength, error = kErrorInvalidArgs); in SetFrom()
323 mLength = aLength; in SetFrom()
340 Error Dataset::SetFrom(const Message &aMessage, uint16_t aOffset, uint16_t aLength) in SetFrom() argument
344 VerifyOrExit(aLength <= kMaxLength, error = kErrorInvalidArgs); in SetFrom()
346 SuccessOrExit(error = aMessage.Read(aOffset, mTlvs, aLength)); in SetFrom()
347 mLength = static_cast<uint8_t>(aLength); in SetFrom()
355 Error Dataset::WriteTlv(Tlv::Type aType, const void *aValue, uint8_t aLength) in WriteTlv() argument
[all …]
Dsecure_transport.hpp119 typedef void (*ReceiveHandler)(void *aContext, uint8_t *aBuf, uint16_t aLength);
435 Error SetClientId(const uint8_t *aClientId, uint8_t aLength);
448 Error Send(Message &aMessage, uint16_t aLength);
543 static int HandleMbedtlsReceive(void *aContext, unsigned char *aBuf, size_t aLength);
544 int HandleMbedtlsReceive(unsigned char *aBuf, size_t aLength);
546 static int HandleMbedtlsTransmit(void *aContext, const unsigned char *aBuf, size_t aLength);
547 int HandleMbedtlsTransmit(const unsigned char *aBuf, size_t aLength);
589 void HandleReceive(const uint8_t *aBuf, uint16_t aLength);
590 …Error HandleSecureTransportSend(const uint8_t *aBuf, uint16_t aLength, Message::SubType aMessageSu…
/openthread-3.7.0/src/posix/platform/
Dtrel.cpp130 static const char *BufferToString(const uint8_t *aBuffer, uint16_t aLength) in BufferToString() argument
139 cur += snprintf(cur, (uint16_t)(end - cur), "[(len:%d) ", aLength); in BufferToString()
142 while (aLength-- && (num < kMaxWrite)) in BufferToString()
150 if (aLength != 0) in BufferToString()
207 static otError SendPacket(const uint8_t *aBuffer, uint16_t aLength, const otSockAddr *aDestSockAddr) in SendPacket() argument
220 ret = sendto(sSocket, aBuffer, aLength, 0, (struct sockaddr *)&sockAddr, sizeof(sockAddr)); in SendPacket()
222 if (ret != aLength) in SendPacket()
241 sCounters.mTxBytes += aLength; in SendPacket()
246 otThreadErrorToString(error), BufferToString(aBuffer, aLength)); in SendPacket()
331 static void EnqueuePacket(const uint8_t *aBuffer, uint16_t aLength, const otSockAddr *aDestSockAddr) in EnqueuePacket() argument
[all …]
/openthread-3.7.0/src/core/thread/
Dmle_types.cpp163 Error RxChallenge::ReadFrom(const Message &aMessage, uint16_t aOffset, uint16_t aLength) in ReadFrom() argument
169 aLength = Min<uint16_t>(aLength, kMaxSize); in ReadFrom()
170 VerifyOrExit(kMinSize <= aLength, error = kErrorParse); in ReadFrom()
172 SuccessOrExit(error = aMessage.Read(aOffset, mArray.GetArrayBuffer(), aLength)); in ReadFrom()
173 mArray.SetLength(static_cast<uint8_t>(aLength)); in ReadFrom()
/openthread-3.7.0/src/lib/spinel/
Dmulti_frame_buffer.hpp229 otError SetLength(uint16_t aLength) in SetLength() argument
233 if (GetFrame() + aLength <= GetArrayEnd(mBuffer)) in SetLength()
235 mWritePointer = GetFrame() + aLength; in SetLength()
362 otError GetNextSavedFrame(uint8_t *&aFrame, uint16_t &aLength) in GetNextSavedFrame() argument
368 aFrame = (aFrame == nullptr) ? mBuffer : aFrame + aLength; in GetNextSavedFrame()
375 aLength = totalLength - skipLength; in GetNextSavedFrame()
380 aLength = 0; in GetNextSavedFrame()
Dradio_spinel.hpp1096 typedef otError (RadioSpinel::*ResponseHandler)(const uint8_t *aBuffer, uint16_t aLength);
1138 …otError ParseRadioFrame(otRadioFrame &aFrame, const uint8_t *aBuffer, uint16_t aLength, spinel_ssi…
1156 void HandleNotification(const uint8_t *aFrame, uint16_t aLength, bool &aShouldSaveFrame);
1157 void HandleNotification(const uint8_t *aFrame, uint16_t aLength);
1158 void HandleValueIs(spinel_prop_key_t aKey, const uint8_t *aBuffer, uint16_t aLength);
1160 void HandleResponse(const uint8_t *aBuffer, uint16_t aLength);
1161 …eTransmitDone(uint32_t aCommand, spinel_prop_key_t aKey, const uint8_t *aBuffer, uint16_t aLength);
1162 …itingResponse(uint32_t aCommand, spinel_prop_key_t aKey, const uint8_t *aBuffer, uint16_t aLength);
1175 uint16_t aLength,
1179 …void HandleReceivedFrame(const uint8_t *aFrame, uint16_t aLength, uint8_t aHeader, bool &aS…
[all …]
/openthread-3.7.0/tests/unit/
Dtest_heap_string.cpp167 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-3.7.0/examples/platforms/simulation/
Dtrel.c80 static void dumpBuffer(const void *aBuffer, uint16_t aLength) in dumpBuffer() argument
83 fprintf(stderr, "[ (len:%d) ", aLength); in dumpBuffer()
85 while (aLength--) in dumpBuffer()
172 static void processMessage(otInstance *aInstance, Message *aMessage, uint16_t aLength) in processMessage() argument
177 fprintf(stderr, "\r\n[trel-sim] processMessage(len:%u, type:%s, port:%u)\r\n", aLength, in processMessage()
181 otEXPECT(aLength > 0); in processMessage()
182 otEXPECT(getMessageSize(aMessage) == aLength); in processMessage()
383 …_TOOL_WEAK void otPlatTrelHandleReceived(otInstance *aInstance, uint8_t *aBuffer, uint16_t aLength) in otPlatTrelHandleReceived() argument
387 OT_UNUSED_VARIABLE(aLength); in otPlatTrelHandleReceived()
/openthread-3.7.0/src/core/crypto/
Daes_ccm.cpp191 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()

1234567