File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 3838#define IP4_ADDR_ANY4 IPADDR_ANY
3939#define IPADDR4_INIT (x ) { x }
4040#define CONST /* nothing: lwIP-v1 does not use const */
41- #else
41+ #else // lwIP-v2+
4242#define CONST const
43- #endif
43+ #if !LWIP_IPV6
44+ #define ip_addr ipv4_addr
45+ #endif // !LWIP_IPV6
46+ #endif // lwIP-v2+
4447
4548// A class to make it easier to handle and pass around IP addresses
4649// IPv6 update:
@@ -96,9 +99,15 @@ class IPAddress: public Printable {
9699 bool operator ==(uint32_t addr) const {
97100 return isV4 () && v4 () == addr;
98101 }
102+ bool operator ==(u32_t addr) const {
103+ return isV4 () && v4 () == addr;
104+ }
99105 bool operator !=(uint32_t addr) const {
100106 return !(isV4 () && v4 () == addr);
101107 }
108+ bool operator !=(u32_t addr) const {
109+ return !(isV4 () && v4 () == addr);
110+ }
102111 bool operator ==(const uint8_t * addr) const ;
103112
104113 // Overloaded index operator to allow getting and setting individual octets of the address
@@ -193,6 +202,7 @@ class IPAddress: public Printable {
193202
194203extern CONST IPAddress IPNoAddress;
195204
196- #include < AddrList.h>
205+ #include < lwip/inet.h> // bring definition of INADDR_NONE
206+ #include < AddrList.h> // bring interface iterator
197207
198208#endif
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ void DNSClient::begin(const IPAddress& aDNSServer)
5555}
5656
5757
58- int DNSClient::inet_aton (const char * aIPAddrString, IPAddress& aResult)
58+ int DNSClient::inet_aton_ethlib (const char * aIPAddrString, IPAddress& aResult)
5959{
6060 // See if we've been given a valid IP address
6161 const char * p =aIPAddrString;
@@ -120,7 +120,7 @@ int DNSClient::getHostByName(const char* aHostname, IPAddress& aResult)
120120 int ret =0 ;
121121
122122 // See if it's a numeric IP address
123- if (inet_aton (aHostname, aResult))
123+ if (inet_aton_ethlib (aHostname, aResult))
124124 {
125125 // It is, our work here is done
126126 return 1 ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class DNSClient
1919 @result 1 if aIPAddrString was successfully converted to an IP address,
2020 else error code
2121 */
22- int inet_aton (const char *aIPAddrString, IPAddress& aResult);
22+ int inet_aton_ethlib (const char *aIPAddrString, IPAddress& aResult);
2323
2424 /* * Resolve the given hostname to an IP address.
2525 @param aHostname Name to be resolved
You can’t perform that action at this time.
0 commit comments