mirror of
https://github.com/espressif/openthread.git
synced 2026-08-30 05:49:54 +00:00
[clang-tidy] apply v14 changes (#8490)
This commit is contained in:
@@ -80,14 +80,14 @@ void InfraIf::Deinit(void)
|
||||
LogInfo("Deinit");
|
||||
}
|
||||
|
||||
bool InfraIf::HasAddress(const Ip6::Address &aAddress)
|
||||
bool InfraIf::HasAddress(const Ip6::Address &aAddress) const
|
||||
{
|
||||
OT_ASSERT(mInitialized);
|
||||
|
||||
return otPlatInfraIfHasAddress(mIfIndex, &aAddress);
|
||||
}
|
||||
|
||||
Error InfraIf::Send(const Icmp6Packet &aPacket, const Ip6::Address &aDestination)
|
||||
Error InfraIf::Send(const Icmp6Packet &aPacket, const Ip6::Address &aDestination) const
|
||||
{
|
||||
OT_ASSERT(mInitialized);
|
||||
|
||||
@@ -112,7 +112,7 @@ exit:
|
||||
}
|
||||
}
|
||||
|
||||
Error InfraIf::DiscoverNat64Prefix(void)
|
||||
Error InfraIf::DiscoverNat64Prefix(void) const
|
||||
{
|
||||
OT_ASSERT(mInitialized);
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
* @retval FALSE The infrastructure interface does not have @p aAddress.
|
||||
*
|
||||
*/
|
||||
bool HasAddress(const Ip6::Address &aAddress);
|
||||
bool HasAddress(const Ip6::Address &aAddress) const;
|
||||
|
||||
/**
|
||||
* This method sends an ICMPv6 Neighbor Discovery packet on the infrastructure interface.
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
* @retval kErrorFailed Failed to send the ICMPv6 message.
|
||||
*
|
||||
*/
|
||||
Error Send(const Icmp6Packet &aPacket, const Ip6::Address &aDestination);
|
||||
Error Send(const Icmp6Packet &aPacket, const Ip6::Address &aDestination) const;
|
||||
|
||||
/**
|
||||
* This method processes a received ICMPv6 Neighbor Discovery packet from an infrastructure interface.
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
* @retval kErrorFailed Failed to request NAT64 prefix discovery.
|
||||
*
|
||||
*/
|
||||
Error DiscoverNat64Prefix(void);
|
||||
Error DiscoverNat64Prefix(void) const;
|
||||
|
||||
/**
|
||||
* This method processes the discovered NAT64 prefix.
|
||||
|
||||
@@ -84,7 +84,7 @@ uint16_t Appender::GetAppendedLength(void) const
|
||||
return length;
|
||||
}
|
||||
|
||||
void Appender::GetAsData(Data<kWithUint16Length> &aData)
|
||||
void Appender::GetAsData(Data<kWithUint16Length> &aData) const
|
||||
{
|
||||
aData.Init(mShared.mFrameBuilder.GetBytes(), mShared.mFrameBuilder.GetLength());
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
* @returns The `Message` instance associated with `Appender`.
|
||||
*
|
||||
*/
|
||||
Message &GetMessage(void) { return *mShared.mMessage.mMessage; }
|
||||
Message &GetMessage(void) const { return *mShared.mMessage.mMessage; }
|
||||
|
||||
/**
|
||||
* This method returns a pointer to the start of the data buffer associated with `Appender`.
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
* @returns A pointer to the start of the data buffer associated with `Appender`.
|
||||
*
|
||||
*/
|
||||
uint8_t *GetBufferStart(void) { return AsNonConst(mShared.mFrameBuilder.GetBytes()); }
|
||||
uint8_t *GetBufferStart(void) const { return AsNonConst(mShared.mFrameBuilder.GetBytes()); }
|
||||
|
||||
/**
|
||||
* This method gets the data buffer associated with `Appender` as a `Data`.
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
* @pram[out] aData A reference to a `Data` to output the data buffer.
|
||||
*
|
||||
*/
|
||||
void GetAsData(Data<kWithUint16Length> &aData);
|
||||
void GetAsData(Data<kWithUint16Length> &aData) const;
|
||||
|
||||
private:
|
||||
Type mType;
|
||||
|
||||
@@ -1255,7 +1255,7 @@ public:
|
||||
* @returns TRUE if the resources records matches @p aType and @p aClass, FALSE otherwise.
|
||||
*
|
||||
*/
|
||||
bool Matches(uint16_t aType, uint16_t aClass = kClassInternet)
|
||||
bool Matches(uint16_t aType, uint16_t aClass = kClassInternet) const
|
||||
{
|
||||
return (mType == HostSwap16(aType)) && (mClass == HostSwap16(aClass));
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ private:
|
||||
const Header &GetResponseHeader(void) const { return mResponseHeader; }
|
||||
Header &GetResponseHeader(void) { return mResponseHeader; }
|
||||
const Message &GetResponseMessage(void) const { return *mResponseMessage; }
|
||||
Message &GetResponseMessage(void) { return *mResponseMessage; }
|
||||
Message &GetResponseMessage(void) { return const_cast<Message &>(*mResponseMessage); }
|
||||
TimeMilli GetStartTime(void) const { return mStartTime; }
|
||||
NameCompressInfo &GetNameCompressInfo(void) { return mCompressInfo; };
|
||||
void Finalize(Header::Response aResponseMessage, Ip6::Udp::Socket &aSocket);
|
||||
|
||||
@@ -274,7 +274,7 @@ exit:
|
||||
return res;
|
||||
}
|
||||
|
||||
Translator::AddressMapping::InfoString Translator::AddressMapping::ToString(void)
|
||||
Translator::AddressMapping::InfoString Translator::AddressMapping::ToString(void) const
|
||||
{
|
||||
InfoString string;
|
||||
|
||||
|
||||
@@ -331,7 +331,7 @@ private:
|
||||
typedef String<Ip6::Address::kInfoStringSize + Ip4::Address::kAddressStringSize + 4> InfoString;
|
||||
|
||||
void Touch(TimeMilli aNow) { mExpiry = aNow + kAddressMappingIdleTimeoutMsec; }
|
||||
InfoString ToString(void);
|
||||
InfoString ToString(void) const;
|
||||
void CopyTo(otNat64AddressMapping &aMapping, TimeMilli aNow) const;
|
||||
|
||||
uint64_t mId; // The unique id for a mapping session.
|
||||
|
||||
@@ -1356,7 +1356,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
Error Client::AppendUpdateLeaseOptRecord(Message &aMessage)
|
||||
Error Client::AppendUpdateLeaseOptRecord(Message &aMessage) const
|
||||
{
|
||||
Error error;
|
||||
Dns::OptRecord optRecord;
|
||||
|
||||
@@ -1044,7 +1044,7 @@ private:
|
||||
Error AppendDeleteAllRrsets(Message &aMessage) const;
|
||||
Error AppendHostName(Message &aMessage, Info &aInfo, bool aDoNotCompress = false) const;
|
||||
Error AppendAaaaRecord(const Ip6::Address &aAddress, Message &aMessage, Info &aInfo) const;
|
||||
Error AppendUpdateLeaseOptRecord(Message &aMessage);
|
||||
Error AppendUpdateLeaseOptRecord(Message &aMessage) const;
|
||||
Error AppendSignature(Message &aMessage, Info &aInfo);
|
||||
void UpdateRecordLengthInMessage(Dns::ResourceRecord &aRecord, uint16_t aOffset, Message &aMessage) const;
|
||||
static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
|
||||
|
||||
@@ -694,7 +694,7 @@ exit:
|
||||
void Tcp::ProcessSignals(Endpoint &aEndpoint,
|
||||
otLinkedBuffer *aPriorHead,
|
||||
size_t aPriorBacklog,
|
||||
struct tcplp_signals &aSignals)
|
||||
struct tcplp_signals &aSignals) const
|
||||
{
|
||||
VerifyOrExit(IsInitialized(aEndpoint) && !aEndpoint.IsClosed());
|
||||
if (aSignals.conn_established && aEndpoint.mEstablishedCallback != nullptr)
|
||||
|
||||
@@ -681,7 +681,7 @@ private:
|
||||
void ProcessSignals(Endpoint &aEndpoint,
|
||||
otLinkedBuffer *aPriorHead,
|
||||
size_t aPriorBacklog,
|
||||
struct tcplp_signals &aSignals);
|
||||
struct tcplp_signals &aSignals) const;
|
||||
|
||||
static Error BsdErrorToOtError(int aBsdError);
|
||||
bool CanBind(const SockAddr &aSockName);
|
||||
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
* @returns The Forward Series Flags mask.
|
||||
*
|
||||
*/
|
||||
uint8_t GetSeriesFlagsMask(void) { return mSeriesFlagsMask; }
|
||||
uint8_t GetSeriesFlagsMask(void) const { return mSeriesFlagsMask; }
|
||||
|
||||
/**
|
||||
* This method sets the Forward Series Flags bit-mask
|
||||
|
||||
@@ -4287,7 +4287,7 @@ void Mle::RegisterParentResponseStatsCallback(otThreadParentResponseCallback aCa
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
uint64_t Mle::CalcParentCslMetric(const Mac::CslAccuracy &aCslAccuracy)
|
||||
uint64_t Mle::CalcParentCslMetric(const Mac::CslAccuracy &aCslAccuracy) const
|
||||
{
|
||||
// This function calculates the overall time that device will operate
|
||||
// on battery by summing sequence of "ON quants" over a period of time.
|
||||
|
||||
@@ -771,7 +771,7 @@ public:
|
||||
* @returns CSL metric.
|
||||
*
|
||||
*/
|
||||
uint64_t CalcParentCslMetric(const Mac::CslAccuracy &aCslAccuracy);
|
||||
uint64_t CalcParentCslMetric(const Mac::CslAccuracy &aCslAccuracy) const;
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
|
||||
|
||||
@@ -1273,7 +1273,7 @@ public:
|
||||
* @returns The CSL Clock Accuracy value.
|
||||
*
|
||||
*/
|
||||
uint8_t GetCslClockAccuracy(void) { return mCslClockAccuracy; }
|
||||
uint8_t GetCslClockAccuracy(void) const { return mCslClockAccuracy; }
|
||||
|
||||
/**
|
||||
* This method sets the CSL Clock Accuracy value.
|
||||
@@ -1289,7 +1289,7 @@ public:
|
||||
* @returns The Clock Accuracy value.
|
||||
*
|
||||
*/
|
||||
uint8_t GetCslUncertainty(void) { return mCslUncertainty; }
|
||||
uint8_t GetCslUncertainty(void) const { return mCslUncertainty; }
|
||||
|
||||
/**
|
||||
* This method sets the CSL Uncertainty value.
|
||||
|
||||
Reference in New Issue
Block a user