mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-06 05:21:22 +03:00
LEAmDNSv2: change a macro name to be independant from LEAmDNS1 (#7640)
This commit is contained in:
parent
36b444dba3
commit
bc2b13ae16
@ -33,7 +33,7 @@
|
||||
#ifdef MDNS_IPV4_SUPPORT
|
||||
#include <lwip/igmp.h>
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
#include <lwip/mld6.h>
|
||||
#endif
|
||||
|
||||
@ -172,7 +172,7 @@ const char* clsLEAMDNSHost::clsConsts::pcUDP = "udp";
|
||||
#ifdef MDNS_IPV4_SUPPORT
|
||||
const char* clsLEAMDNSHost::clsConsts::pcReverseIPv4Domain = "in-addr";
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
const char* clsLEAMDNSHost::clsConsts::pcReverseIPv6Domain = "ip6";
|
||||
#endif
|
||||
const char* clsLEAMDNSHost::clsConsts::pcReverseTopDomain = "arpa";
|
||||
@ -904,7 +904,7 @@ bool clsLEAMDNSHost::_joinMulticastGroups(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
|
||||
bResult = ((bResult) &&
|
||||
(ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6))));
|
||||
@ -937,7 +937,7 @@ bool clsLEAMDNSHost::_leaveMulticastGroups()
|
||||
DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
|
||||
if (ERR_OK != mld6_leavegroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6)/*&(multicast_addr_V6.u_addr.ip6)*/))
|
||||
{
|
||||
|
@ -110,7 +110,7 @@
|
||||
|
||||
#define MDNS_IPV4_SUPPORT
|
||||
#if LWIP_IPV6
|
||||
#define MDNS_IPV6_SUPPORT // If we've got IPv6 support, then we need IPv6 support :-)
|
||||
#define MDNS2_IPV6_SUPPORT // If we've got IPv6 support, then we need IPv6 support :-)
|
||||
#endif
|
||||
|
||||
namespace esp8266
|
||||
@ -136,7 +136,7 @@ protected:
|
||||
#ifdef MDNS_IPV4_SUPPORT
|
||||
static constexpr uint16_t u16IPv4Size = 4; // IPv4 address size in bytes
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
static constexpr uint16_t u16IPv6Size = 16; // IPv6 address size in bytes
|
||||
#endif
|
||||
static constexpr size_t stServiceTxtMaxLength = 1300; // Maximum length for all service txts for one service
|
||||
@ -168,7 +168,7 @@ protected:
|
||||
#ifdef MDNS_IPV4_SUPPORT
|
||||
static const char* pcReverseIPv4Domain; // "in-addr";
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
static const char* pcReverseIPv6Domain; // "ip6";
|
||||
#endif
|
||||
static const char* pcReverseTopDomain; // "arpa";
|
||||
@ -246,7 +246,7 @@ protected:
|
||||
#ifdef MDNS_IPV4_SUPPORT
|
||||
V4 = 0x01,
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
V6 = 0x02,
|
||||
#endif
|
||||
};
|
||||
@ -784,7 +784,7 @@ protected:
|
||||
bool clear(void);
|
||||
};
|
||||
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
/**
|
||||
clsRRAnswerAAAA
|
||||
*/
|
||||
@ -935,7 +935,7 @@ public:
|
||||
#ifdef MDNS_IPV4_SUPPORT
|
||||
IPv4Address = 0x10, // IPv4 address
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
IPv6Address = 0x20, // IPv6 address
|
||||
#endif
|
||||
};
|
||||
@ -1004,7 +1004,7 @@ public:
|
||||
#ifdef MDNS_IPV4_SUPPORT
|
||||
clsIPAddressWithTTL::list m_IPv4Addresses; // 3. level answer (A, using host domain), eg. 123.456.789.012
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
clsIPAddressWithTTL::list m_IPv6Addresses; // 3. level answer (AAAA, using host domain), eg. 1234::09
|
||||
#endif
|
||||
typeQueryAnswerType m_QueryAnswerFlags; // enuQueryAnswerType
|
||||
@ -1029,7 +1029,7 @@ public:
|
||||
const clsIPAddressWithTTL* IPv4AddressAtIndex(uint32_t p_u32Index) const;
|
||||
clsIPAddressWithTTL* IPv4AddressAtIndex(uint32_t p_u32Index);
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
bool releaseIPv6Addresses(void);
|
||||
bool addIPv6Address(clsIPAddressWithTTL* p_pIPAddress);
|
||||
bool removeIPv6Address(clsIPAddressWithTTL* p_pIPAddress);
|
||||
@ -1081,7 +1081,7 @@ public:
|
||||
bool IPv4AddressAvailable(void) const;
|
||||
clsIPAddressVector IPv4Addresses(void) const;
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
bool IPv6AddressAvailable(void) const;
|
||||
clsIPAddressVector IPv6Addresses(void) const;
|
||||
#endif
|
||||
@ -1362,7 +1362,7 @@ protected:
|
||||
#ifdef MDNS_IPV4_SUPPORT
|
||||
bool _processAAnswer(const clsRRAnswerA* p_pAAnswer);
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
bool _processAAAAAnswer(const clsRRAnswerAAAA* p_pAAAAAnswer);
|
||||
#endif
|
||||
|
||||
@ -1426,7 +1426,7 @@ protected:
|
||||
uint16_t p_u16RDLength);
|
||||
bool _readRRAnswerTXT(clsRRAnswerTXT& p_rRRAnswerTXT,
|
||||
uint16_t p_u16RDLength);
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
bool _readRRAnswerAAAA(clsRRAnswerAAAA& p_rRRAnswerAAAA,
|
||||
uint16_t p_u16RDLength);
|
||||
#endif
|
||||
@ -1455,7 +1455,7 @@ protected:
|
||||
bool _buildDomainForReverseIPv4(IPAddress p_IPv4Address,
|
||||
clsRRDomain& p_rReverseIPv4Domain) const;
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
bool _buildDomainForReverseIPv6(IPAddress p_IPv4Address,
|
||||
clsRRDomain& p_rReverseIPv6Domain) const;
|
||||
#endif
|
||||
@ -1520,7 +1520,7 @@ protected:
|
||||
clsSendParameter& p_rSendParameter);
|
||||
bool _writeMDNSAnswer_TXT(clsService& p_rService,
|
||||
clsSendParameter& p_rSendParameter);
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
bool _writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
|
||||
clsSendParameter& p_rSendParameter);
|
||||
bool _writeMDNSAnswer_PTR_IPv6(IPAddress p_IPAddress,
|
||||
@ -1537,7 +1537,7 @@ protected:
|
||||
bool _writeMDNSAnswer_NSEC_PTR_IPv4(IPAddress p_IPAddress,
|
||||
clsSendParameter& p_rSendParameter);
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
bool _writeMDNSAnswer_NSEC_PTR_IPv6(IPAddress p_IPAddress,
|
||||
clsSendParameter& p_rSendParameter);
|
||||
#endif
|
||||
|
@ -218,7 +218,7 @@ bool clsLEAMDNSHost::_parseQuery(netif* pNetIf,
|
||||
(true)
|
||||
#endif
|
||||
&&
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
(m_pUDPContext->getRemoteAddress().isV6()) &&
|
||||
(ip6_addr_islinklocal(ip_2_ip6((const ip_addr_t*)m_pUDPContext->getRemoteAddress())))
|
||||
#else
|
||||
@ -304,7 +304,7 @@ bool clsLEAMDNSHost::_parseQuery(netif* pNetIf,
|
||||
sendParameter.m_u32HostReplyMask &= ~static_cast<uint32_t>(enuContentFlag::PTR_IPv4);
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
if (u32HostMatchMask & static_cast<uint32_t>(enuContentFlag::PTR_IPv6))
|
||||
{
|
||||
// IPv6 PTR was asked for, but is already known -> skipping
|
||||
@ -330,7 +330,7 @@ bool clsLEAMDNSHost::_parseQuery(netif* pNetIf,
|
||||
else if (u32HostMatchMask & static_cast<uint32_t>(enuContentFlag::AAAA))
|
||||
{
|
||||
// IPv6 address was asked for
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
if ((enuAnswerType::AAAA == pKnownRRAnswer->answerType()) &&
|
||||
(((stcRRAnswerAAAA*)pKnownRRAnswer)->m_IPAddress == _getResponderIPAddress(pNetIf, enuIPProtocolType::V6)))
|
||||
{
|
||||
@ -381,7 +381,7 @@ bool clsLEAMDNSHost::_parseQuery(netif* pNetIf,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
if (enuAnswerType::AAAA == pKnownRRAnswer->answerType())
|
||||
{
|
||||
IPAddress localIPAddress(_getResponderIPAddress(pNetIf, enuIPProtocolType::V6));
|
||||
@ -775,7 +775,7 @@ bool clsLEAMDNSHost::_processAnswers(netif* pNetIf, const clsLEAMDNSHost::clsRRA
|
||||
bResult = _processAAnswer((clsRRAnswerA*)pRRAnswer);
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
// AAAA -> IPv6Address
|
||||
else if (enuAnswerType::AAAA == pRRAnswer->answerType())
|
||||
{
|
||||
@ -802,7 +802,7 @@ bool clsLEAMDNSHost::_processAnswers(netif* pNetIf, const clsLEAMDNSHost::clsRRA
|
||||
bPossibleEcho = true;
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
if ((enuAnswerType::AAAA == pRRAnswer->answerType()) &&
|
||||
(((clsRRAnswerAAAA*)pRRAnswer)->m_IPAddress == _getResponderIPAddress(pNetIf, enuIPProtocolType::V6)))
|
||||
{
|
||||
@ -1159,7 +1159,7 @@ bool clsLEAMDNSHost::_processAAnswer(const clsLEAMDNSHost::clsRRAnswerA* p_pAAns
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
/*
|
||||
clsLEAmDNS2_Host::_processAAAAAnswer (level 3)
|
||||
*/
|
||||
@ -1298,7 +1298,7 @@ bool clsLEAMDNSHost::_updateProbeStatus()
|
||||
true
|
||||
#endif
|
||||
) || (
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
_getResponderIPAddress(pNetIf, enuIPProtocolType::V6).isSet() // OR has IPv6 address
|
||||
#else
|
||||
true
|
||||
@ -1511,7 +1511,7 @@ bool clsLEAMDNSHost::_sendHostProbe()
|
||||
#ifdef MDNS_IPV4_SUPPORT
|
||||
sendParameter.m_u32HostReplyMask |= static_cast<uint32_t>(enuContentFlag::A); // Add A answer
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
sendParameter.m_u32HostReplyMask |= static_cast<uint32_t>(enuContentFlag::AAAA); // Add AAAA answer
|
||||
#endif
|
||||
}
|
||||
@ -1705,7 +1705,7 @@ bool clsLEAMDNSHost::_announce(bool p_bAnnounce,
|
||||
sendParameter.m_u32HostReplyMask |= static_cast<uint32_t>(enuContentFlag::A); // A answer
|
||||
sendParameter.m_u32HostReplyMask |= static_cast<uint32_t>(enuContentFlag::PTR_IPv4); // PTR_IPv4 answer
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
sendParameter.m_u32HostReplyMask |= static_cast<uint32_t>(enuContentFlag::AAAA); // AAAA answer
|
||||
sendParameter.m_u32HostReplyMask |= static_cast<uint32_t>(enuContentFlag::PTR_IPv6); // PTR_IPv6 answer
|
||||
#endif
|
||||
@ -1892,7 +1892,7 @@ bool clsLEAMDNSHost::_checkQueryCache()
|
||||
pQAnswer->releaseIPv4Addresses();
|
||||
queryAnswerContentFlags |= static_cast<clsQuery::clsAnswer::typeQueryAnswerType>(clsQuery::clsAnswer::enuQueryAnswerType::IPv4Address);
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
pQAnswer->releaseIPv6Addresses();
|
||||
queryAnswerContentFlags |= static_cast<clsQuery::clsAnswer::typeQueryAnswerType>(clsQuery::clsAnswer::enuQueryAnswerType::IPv6Address);
|
||||
#endif
|
||||
@ -1991,7 +1991,7 @@ bool clsLEAMDNSHost::_checkQueryCache()
|
||||
pQAnswer->removeIPv4Address(pIPv4Address);
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
// IPv6Address (from AAAA)
|
||||
clsQuery::clsAnswer::clsIPAddressWithTTL::list expiredIPv6Addresses;
|
||||
bool bAAAAUpdateQuerySent = false;
|
||||
@ -2095,7 +2095,7 @@ uint32_t clsLEAMDNSHost::_replyMaskForHost(netif* pNetIf,
|
||||
u32ReplyMask |= static_cast<uint32_t>(enuContentFlag::PTR_IPv4);
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
clsRRDomain reverseIPv6Domain;
|
||||
if ((_getResponderIPAddress(pNetIf, enuIPProtocolType::V6).isSet()) &&
|
||||
(_buildDomainForReverseIPv6(_getResponderIPAddress(pNetIf, enuIPProtocolType::V6), reverseIPv6Domain)) &&
|
||||
@ -2121,7 +2121,7 @@ uint32_t clsLEAMDNSHost::_replyMaskForHost(netif* pNetIf,
|
||||
u32ReplyMask |= static_cast<uint32_t>(enuContentFlag::A);
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
if ((DNS_RRTYPE_AAAA == p_RRHeader.m_Attributes.m_u16Type) ||
|
||||
(DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ bool clsLEAMDNSHost::_printRRAnswer(const clsLEAMDNSHost::clsRRAnswer& p_RRAnswe
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
case DNS_RRTYPE_AAAA:
|
||||
DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((clsRRAnswerAAAA*&)p_RRAnswer)->m_IPAddress.toString().c_str());
|
||||
break;
|
||||
@ -175,7 +175,7 @@ const char* clsLEAMDNSHost::_RRType2Name(uint16_t p_u16RRType) const
|
||||
#endif
|
||||
case DNS_RRTYPE_PTR: strcpy_P(acRRName, PSTR("PTR")); break;
|
||||
case DNS_RRTYPE_TXT: strcpy_P(acRRName, PSTR("TXT")); break;
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
case DNS_RRTYPE_AAAA: strcpy_P(acRRName, PSTR("AAAA")); break;
|
||||
#endif
|
||||
case DNS_RRTYPE_SRV: strcpy_P(acRRName, PSTR("SRV")); break;
|
||||
@ -288,7 +288,7 @@ const char* clsLEAMDNSHost::_NSECBitmap2String(const clsNSECBitmap* p_pNSECBitma
|
||||
{
|
||||
strcat_P(acFlagsString, PSTR("PTR ")); // 4
|
||||
}
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
if (p_pNSECBitmap->getBit(DNS_RRTYPE_AAAA))
|
||||
{
|
||||
strcat_P(acFlagsString, PSTR("AAAA ")); // 5
|
||||
|
@ -1898,7 +1898,7 @@ bool clsLEAMDNSHost::clsRRAnswerTXT::clear(void)
|
||||
|
||||
*/
|
||||
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
/*
|
||||
clsLEAMDNSHost::clsRRAnswerAAAA::clsRRAnswerAAAA constructor
|
||||
|
||||
@ -2398,7 +2398,7 @@ bool clsLEAMDNSHost::clsQuery::clsAnswer::clear(void)
|
||||
(true)
|
||||
#endif
|
||||
&&
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
(releaseIPv6Addresses())
|
||||
#else
|
||||
(true)
|
||||
@ -2528,7 +2528,7 @@ const clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* clsLEAMDNSHost::
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
/*
|
||||
clsLEAMDNSHost::clsQuery::clsAnswer::releaseIPv6Addresses
|
||||
|
||||
@ -2793,7 +2793,7 @@ clsLEAMDNSHost::clsQuery::clsAnswerAccessor::clsIPAddressVector clsLEAMDNSHost::
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
/*
|
||||
clsLEAMDNSHost::clsQuery::clsAnswerAccessor::IPv6AddressAvailable
|
||||
|
||||
@ -2913,7 +2913,7 @@ size_t clsLEAMDNSHost::clsQuery::clsAnswerAccessor::printTo(Print& p_Print) cons
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
if (IPv6AddressAvailable())
|
||||
{
|
||||
stLen += p_Print.print(cpcI);
|
||||
|
@ -84,7 +84,7 @@ bool clsLEAMDNSHost::_sendMessage(netif* pNetIf, clsLEAMDNSHost::clsSendParamete
|
||||
DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage: No IPv4 address available!\n"), _DH());
|
||||
});
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
// Only send out IPv6 messages, if we've got an IPv6 address
|
||||
if (_getResponderIPAddress(pNetIf, enuIPProtocolType::V6).isSet())
|
||||
{
|
||||
@ -128,7 +128,7 @@ bool clsLEAMDNSHost::_sendMessage(netif* pNetIf, clsLEAMDNSHost::clsSendParamete
|
||||
bResult = _sendMessage_Multicast(pNetIf, p_rSendParameter, static_cast<uint8_t>(enuIPProtocolType::V4));
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
if (((!ipRemote.isSet()) || // NO remote IP
|
||||
(ipRemote.isV6())) && // OR IPv6
|
||||
(u8AvailableProtocols & static_cast<uint8_t>(enuIPProtocolType::V6))) // AND IPv6 protocol available
|
||||
@ -182,7 +182,7 @@ bool clsLEAMDNSHost::_sendMessage_Multicast(netif* pNetIf, clsLEAMDNSHost::clsSe
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
if (p_IPProtocolTypes & static_cast<uint8_t>(enuIPProtocolType::V6))
|
||||
{
|
||||
IPAddress ip6MulticastAddress(DNS_MQUERY_IPV6_GROUP_INIT);
|
||||
@ -308,7 +308,7 @@ bool clsLEAMDNSHost::_prepareMessage(netif* pNetIf, clsLEAMDNSHost::clsSendParam
|
||||
DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_PTR_IPv4 FAILED!\n"), _DH()););
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
// AAAA
|
||||
if ((bResult) &&
|
||||
(p_rSendParameter.m_u32HostReplyMask & static_cast<uint32_t>(enuContentFlag::AAAA)) &&
|
||||
@ -383,7 +383,7 @@ bool clsLEAMDNSHost::_prepareMessage(netif* pNetIf, clsLEAMDNSHost::clsSendParam
|
||||
#ifdef MDNS_IPV4_SUPPORT
|
||||
bool bNeedsAdditionalAnswerA = false;
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
bool bNeedsAdditionalAnswerAAAA = false;
|
||||
#endif
|
||||
for (clsService::list::iterator it = m_Services.begin(); ((bResult) && (it != m_Services.end())); it++)
|
||||
@ -420,7 +420,7 @@ bool clsLEAMDNSHost::_prepareMessage(netif* pNetIf, clsLEAMDNSHost::clsSendParam
|
||||
bNeedsAdditionalAnswerA = true;
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
if ((bResult) &&
|
||||
(!(p_rSendParameter.m_u32HostReplyMask & static_cast<uint32_t>(enuContentFlag::AAAA)))) // Add IPv6 address
|
||||
{
|
||||
@ -455,7 +455,7 @@ bool clsLEAMDNSHost::_prepareMessage(netif* pNetIf, clsLEAMDNSHost::clsSendParam
|
||||
DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_A(B) FAILED!\n"), _DH()););
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
// Answer AAAA needed?
|
||||
if ((bResult) &&
|
||||
(bNeedsAdditionalAnswerAAAA) &&
|
||||
@ -481,7 +481,7 @@ bool clsLEAMDNSHost::_prepareMessage(netif* pNetIf, clsLEAMDNSHost::clsSendParam
|
||||
uint32_t u32NSECContent_PTR_IPv4 = (u32NSECContent & static_cast<uint32_t>(enuContentFlag::PTR_IPv4));
|
||||
u32NSECContent &= ~static_cast<uint32_t>(enuContentFlag::PTR_IPv4);
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
uint32_t u32NSECContent_PTR_IPv6 = (u32NSECContent & static_cast<uint32_t>(enuContentFlag::PTR_IPv6));
|
||||
u32NSECContent &= ~static_cast<uint32_t>(enuContentFlag::PTR_IPv6);
|
||||
#endif
|
||||
@ -491,7 +491,7 @@ bool clsLEAMDNSHost::_prepareMessage(netif* pNetIf, clsLEAMDNSHost::clsSendParam
|
||||
#ifdef MDNS_IPV4_SUPPORT
|
||||
+ (u32NSECContent_PTR_IPv4 ? 1 : 0)
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
+ (u32NSECContent_PTR_IPv6 ? 1 : 0)
|
||||
#endif
|
||||
))
|
||||
@ -504,7 +504,7 @@ bool clsLEAMDNSHost::_prepareMessage(netif* pNetIf, clsLEAMDNSHost::clsSendParam
|
||||
((!_getResponderIPAddress(pNetIf, (enuIPProtocolType::V4)).isSet()) ||
|
||||
(_writeMDNSAnswer_NSEC_PTR_IPv4(_getResponderIPAddress(pNetIf, (enuIPProtocolType::V4)), p_rSendParameter))))
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
// Write separate answer for host PTR IPv6
|
||||
&& ((!u32NSECContent_PTR_IPv6) ||
|
||||
((!_getResponderIPAddress(pNetIf, (enuIPProtocolType::V6)).isSet()) ||
|
||||
@ -566,7 +566,7 @@ bool clsLEAMDNSHost::_sendQuery(const clsLEAMDNSHost::clsQuery& p_Query,
|
||||
#ifdef MDNS_IPV4_SUPPORT
|
||||
bResult = _addQueryRecord(sendParameter, p_Query.m_Domain, DNS_RRTYPE_A);
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
bResult = _addQueryRecord(sendParameter, p_Query.m_Domain, DNS_RRTYPE_AAAA);
|
||||
#endif
|
||||
break;
|
||||
@ -623,7 +623,7 @@ IPAddress clsLEAMDNSHost::_getResponderIPAddress(netif* pNetIf, enuIPProtocolTyp
|
||||
ipResponder = netif_ip_addr4(pNetIf);
|
||||
}
|
||||
#endif
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
if (enuIPProtocolType::V6 == p_IPProtocolType)
|
||||
{
|
||||
bool bCheckLinkLocal = true;
|
||||
@ -731,7 +731,7 @@ bool clsLEAMDNSHost::_readRRAnswer(clsLEAMDNSHost::clsRRAnswer*& p_rpRRAnswer)
|
||||
p_rpRRAnswer = new clsRRAnswerTXT(header, u32TTL);
|
||||
bResult = _readRRAnswerTXT(*(clsRRAnswerTXT*&)p_rpRRAnswer, u16RDLength);
|
||||
break;
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
case DNS_RRTYPE_AAAA:
|
||||
p_rpRRAnswer = new clsRRAnswerAAAA(header, u32TTL);
|
||||
bResult = _readRRAnswerAAAA(*(clsRRAnswerAAAA*&)p_rpRRAnswer, u16RDLength);
|
||||
@ -779,7 +779,7 @@ bool clsLEAMDNSHost::_readRRAnswer(clsLEAMDNSHost::clsRRAnswer*& p_rpRRAnswer)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
case DNS_RRTYPE_AAAA:
|
||||
DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((clsRRAnswerAAAA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
|
||||
break;
|
||||
@ -968,7 +968,7 @@ bool clsLEAMDNSHost::_readRRAnswerTXT(clsLEAMDNSHost::clsRRAnswerTXT& p_rRRAnswe
|
||||
return bResult;
|
||||
}
|
||||
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
bool clsLEAMDNSHost::_readRRAnswerAAAA(clsLEAMDNSHost::clsRRAnswerAAAA& p_rRRAnswerAAAA,
|
||||
uint16_t p_u16RDLength)
|
||||
{
|
||||
@ -1280,7 +1280,7 @@ bool clsLEAMDNSHost::_buildDomainForReverseIPv4(IPAddress p_IPv4Address,
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
/*
|
||||
MDNSResponder::_buildDomainForReverseIPv6
|
||||
|
||||
@ -2014,7 +2014,7 @@ bool clsLEAMDNSHost::_writeMDNSAnswer_TXT(clsLEAMDNSHost::clsService& p_rService
|
||||
return bResult;
|
||||
}
|
||||
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
/*
|
||||
MDNSResponder::_writeMDNSAnswer_AAAA
|
||||
|
||||
@ -2189,7 +2189,7 @@ clsLEAMDNSHost::clsNSECBitmap* clsLEAMDNSHost::_createNSECBitmap(uint32_t p_u32N
|
||||
{
|
||||
pNSECBitmap->setBit(DNS_RRTYPE_PTR); // 12/0x0C
|
||||
}
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
if (p_u32NSECContent & static_cast<uint32_t>(enuContentFlag::AAAA))
|
||||
{
|
||||
pNSECBitmap->setBit(DNS_RRTYPE_AAAA); // 28/0x1C
|
||||
@ -2335,7 +2335,7 @@ bool clsLEAMDNSHost::_writeMDNSAnswer_NSEC_PTR_IPv4(IPAddress p_IPAddress,
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef MDNS_IPV6_SUPPORT
|
||||
#ifdef MDNS2_IPV6_SUPPORT
|
||||
/*
|
||||
MDNSResponder::_writeMDNSAnswer_NSEC_PTR_IPv6(host)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user