mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 19:27:46 +00:00
[ip6-address] inline very simple methods (#4519)
This commit inlines the very simple methods (containing a single basic operation) in `Ip6::Address` class.
This commit is contained in:
committed by
Jonathan Hui
parent
a5862a6de1
commit
45d5afb10e
@@ -65,11 +65,6 @@ bool Address::IsLinkLocal(void) const
|
||||
return (mFields.m16[0] & HostSwap16(0xffc0)) == HostSwap16(0xfe80);
|
||||
}
|
||||
|
||||
bool Address::IsMulticast(void) const
|
||||
{
|
||||
return mFields.m8[0] == 0xff;
|
||||
}
|
||||
|
||||
bool Address::IsLinkLocalMulticast(void) const
|
||||
{
|
||||
return IsMulticast() && (GetScope() == kLinkLocalScope);
|
||||
@@ -149,16 +144,6 @@ bool Address::IsIidReserved(void) const
|
||||
return IsSubnetRouterAnycast() || IsReservedSubnetAnycast() || IsAnycastRoutingLocator();
|
||||
}
|
||||
|
||||
const uint8_t *Address::GetIid(void) const
|
||||
{
|
||||
return mFields.m8 + kInterfaceIdentifierOffset;
|
||||
}
|
||||
|
||||
uint8_t *Address::GetIid(void)
|
||||
{
|
||||
return mFields.m8 + kInterfaceIdentifierOffset;
|
||||
}
|
||||
|
||||
void Address::SetIid(const uint8_t *aIid)
|
||||
{
|
||||
memcpy(mFields.m8 + kInterfaceIdentifierOffset, aIid, kInterfaceIdentifierSize);
|
||||
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
* @retval FALSE If the IPv6 address scope is not a multicast address.
|
||||
*
|
||||
*/
|
||||
bool IsMulticast(void) const;
|
||||
bool IsMulticast(void) const { return mFields.m8[0] == 0xff; }
|
||||
|
||||
/**
|
||||
* This method indicates whether or not the IPv6 address is a link-local multicast address.
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
* @returns A pointer to the Interface Identifier.
|
||||
*
|
||||
*/
|
||||
const uint8_t *GetIid(void) const;
|
||||
const uint8_t *GetIid(void) const { return mFields.m8 + kInterfaceIdentifierOffset; }
|
||||
|
||||
/**
|
||||
* This method returns a pointer to the Interface Identifier.
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
* @returns A pointer to the Interface Identifier.
|
||||
*
|
||||
*/
|
||||
uint8_t *GetIid(void);
|
||||
uint8_t *GetIid(void) { return mFields.m8 + kInterfaceIdentifierOffset; }
|
||||
|
||||
/**
|
||||
* This method sets the Interface Identifier.
|
||||
|
||||
Reference in New Issue
Block a user