mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-15 16:36:52 +01:00
Merge pull request #113 from tieto/develop
Improve UDPv6 code portability
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
* Contributors:
|
* Contributors:
|
||||||
* Benjamin Aigner - Adaption of the UDPv4 code to use UDPv6
|
* Benjamin Aigner - Adaption of the UDPv4 code to use UDPv6
|
||||||
* Tomoaki Yamaguchi - initial API and implementation and/or initial documentation
|
* Tomoaki Yamaguchi - initial API and implementation and/or initial documentation
|
||||||
|
* Tieto Poland Sp. z o.o. - improve portability
|
||||||
**************************************************************************************/
|
**************************************************************************************/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -94,10 +95,10 @@ char* SensorNetAddress::getAddress(void)
|
|||||||
bool SensorNetAddress::isMatch(SensorNetAddress* addr)
|
bool SensorNetAddress::isMatch(SensorNetAddress* addr)
|
||||||
{
|
{
|
||||||
return ((this->_portNo == addr->_portNo) && \
|
return ((this->_portNo == addr->_portNo) && \
|
||||||
(this->_IpAddr.sin6_addr.__in6_u.__u6_addr32[0] == addr->_IpAddr.sin6_addr.__in6_u.__u6_addr32[0]) && \
|
(this->_IpAddr.sin6_addr.s6_addr32[0] == addr->_IpAddr.sin6_addr.s6_addr32[0]) && \
|
||||||
(this->_IpAddr.sin6_addr.__in6_u.__u6_addr32[1] == addr->_IpAddr.sin6_addr.__in6_u.__u6_addr32[1]) && \
|
(this->_IpAddr.sin6_addr.s6_addr32[1] == addr->_IpAddr.sin6_addr.s6_addr32[1]) && \
|
||||||
(this->_IpAddr.sin6_addr.__in6_u.__u6_addr32[2] == addr->_IpAddr.sin6_addr.__in6_u.__u6_addr32[2]) && \
|
(this->_IpAddr.sin6_addr.s6_addr32[2] == addr->_IpAddr.sin6_addr.s6_addr32[2]) && \
|
||||||
(this->_IpAddr.sin6_addr.__in6_u.__u6_addr32[3] == addr->_IpAddr.sin6_addr.__in6_u.__u6_addr32[3]));
|
(this->_IpAddr.sin6_addr.s6_addr32[3] == addr->_IpAddr.sin6_addr.s6_addr32[3]));
|
||||||
}
|
}
|
||||||
|
|
||||||
SensorNetAddress& SensorNetAddress::operator =(SensorNetAddress& addr)
|
SensorNetAddress& SensorNetAddress::operator =(SensorNetAddress& addr)
|
||||||
|
|||||||
Reference in New Issue
Block a user