Skip to content

LEAmDNSv2: change a macro name to be independant from LEAmDNS1 #7640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions libraries/ESP8266mDNS/src/LEAmDNS2Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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))));
Expand Down Expand Up @@ -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)*/))
{
Expand Down
28 changes: 14 additions & 14 deletions libraries/ESP8266mDNS/src/LEAmDNS2Host.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -136,7 +136,7 @@ class clsLEAMDNSHost
#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
Expand Down Expand Up @@ -168,7 +168,7 @@ class clsLEAMDNSHost
#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";
Expand Down Expand Up @@ -246,7 +246,7 @@ class clsLEAMDNSHost
#ifdef MDNS_IPV4_SUPPORT
V4 = 0x01,
#endif
#ifdef MDNS_IPV6_SUPPORT
#ifdef MDNS2_IPV6_SUPPORT
V6 = 0x02,
#endif
};
Expand Down Expand Up @@ -784,7 +784,7 @@ class clsLEAMDNSHost
bool clear(void);
};

#ifdef MDNS_IPV6_SUPPORT
#ifdef MDNS2_IPV6_SUPPORT
/**
clsRRAnswerAAAA
*/
Expand Down Expand Up @@ -935,7 +935,7 @@ class clsLEAMDNSHost
#ifdef MDNS_IPV4_SUPPORT
IPv4Address = 0x10, // IPv4 address
#endif
#ifdef MDNS_IPV6_SUPPORT
#ifdef MDNS2_IPV6_SUPPORT
IPv6Address = 0x20, // IPv6 address
#endif
};
Expand Down Expand Up @@ -1004,7 +1004,7 @@ class clsLEAMDNSHost
#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
Expand All @@ -1029,7 +1029,7 @@ class clsLEAMDNSHost
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);
Expand Down Expand Up @@ -1081,7 +1081,7 @@ class clsLEAMDNSHost
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
Expand Down Expand Up @@ -1362,7 +1362,7 @@ class clsLEAMDNSHost
#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

Expand Down Expand Up @@ -1426,7 +1426,7 @@ class clsLEAMDNSHost
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
Expand Down Expand Up @@ -1455,7 +1455,7 @@ class clsLEAMDNSHost
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
Expand Down Expand Up @@ -1520,7 +1520,7 @@ class clsLEAMDNSHost
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,
Expand All @@ -1537,7 +1537,7 @@ class clsLEAMDNSHost
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
Expand Down
28 changes: 14 additions & 14 deletions libraries/ESP8266mDNS/src/LEAmDNS2Host_Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)))
{
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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())
{
Expand All @@ -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)))
{
Expand Down Expand Up @@ -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)
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)) &&
Expand All @@ -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))
{
Expand Down
6 changes: 3 additions & 3 deletions libraries/ESP8266mDNS/src/LEAmDNS2Host_Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions libraries/ESP8266mDNS/src/LEAmDNS2Host_Structs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,7 @@ bool clsLEAMDNSHost::clsRRAnswerTXT::clear(void)

*/

#ifdef MDNS_IPV6_SUPPORT
#ifdef MDNS2_IPV6_SUPPORT
/*
clsLEAMDNSHost::clsRRAnswerAAAA::clsRRAnswerAAAA constructor

Expand Down Expand Up @@ -2398,7 +2398,7 @@ bool clsLEAMDNSHost::clsQuery::clsAnswer::clear(void)
(true)
#endif
&&
#ifdef MDNS_IPV6_SUPPORT
#ifdef MDNS2_IPV6_SUPPORT
(releaseIPv6Addresses())
#else
(true)
Expand Down Expand Up @@ -2528,7 +2528,7 @@ const clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* clsLEAMDNSHost::
}
#endif

#ifdef MDNS_IPV6_SUPPORT
#ifdef MDNS2_IPV6_SUPPORT
/*
clsLEAMDNSHost::clsQuery::clsAnswer::releaseIPv6Addresses

Expand Down Expand Up @@ -2793,7 +2793,7 @@ clsLEAMDNSHost::clsQuery::clsAnswerAccessor::clsIPAddressVector clsLEAMDNSHost::
}
#endif

#ifdef MDNS_IPV6_SUPPORT
#ifdef MDNS2_IPV6_SUPPORT
/*
clsLEAMDNSHost::clsQuery::clsAnswerAccessor::IPv6AddressAvailable

Expand Down Expand Up @@ -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);
Expand Down
Loading