File tree 3 files changed +16
-6
lines changed
3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 38
38
#define IP4_ADDR_ANY4 IPADDR_ANY
39
39
#define IPADDR4_INIT (x ) { x }
40
40
#define CONST /* nothing: lwIP-v1 does not use const */
41
- #else
41
+ #else // lwIP-v2+
42
42
#define CONST const
43
- #endif
43
+ #if !LWIP_IPV6
44
+ #define ip_addr ipv4_addr
45
+ #endif // !LWIP_IPV6
46
+ #endif // lwIP-v2+
44
47
45
48
// A class to make it easier to handle and pass around IP addresses
46
49
// IPv6 update:
@@ -96,9 +99,15 @@ class IPAddress: public Printable {
96
99
bool operator ==(uint32_t addr) const {
97
100
return isV4 () && v4 () == addr;
98
101
}
102
+ bool operator ==(u32_t addr) const {
103
+ return isV4 () && v4 () == addr;
104
+ }
99
105
bool operator !=(uint32_t addr) const {
100
106
return !(isV4 () && v4 () == addr);
101
107
}
108
+ bool operator !=(u32_t addr) const {
109
+ return !(isV4 () && v4 () == addr);
110
+ }
102
111
bool operator ==(const uint8_t * addr) const ;
103
112
104
113
// Overloaded index operator to allow getting and setting individual octets of the address
@@ -193,6 +202,7 @@ class IPAddress: public Printable {
193
202
194
203
extern CONST IPAddress IPNoAddress;
195
204
196
- #include < AddrList.h>
205
+ #include < lwip/inet.h> // bring definition of INADDR_NONE
206
+ #include < AddrList.h> // bring interface iterator
197
207
198
208
#endif
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ void DNSClient::begin(const IPAddress& aDNSServer)
55
55
}
56
56
57
57
58
- int DNSClient::inet_aton (const char * aIPAddrString, IPAddress& aResult)
58
+ int DNSClient::inet_aton_ethlib (const char * aIPAddrString, IPAddress& aResult)
59
59
{
60
60
// See if we've been given a valid IP address
61
61
const char * p =aIPAddrString;
@@ -120,7 +120,7 @@ int DNSClient::getHostByName(const char* aHostname, IPAddress& aResult)
120
120
int ret =0 ;
121
121
122
122
// See if it's a numeric IP address
123
- if (inet_aton (aHostname, aResult))
123
+ if (inet_aton_ethlib (aHostname, aResult))
124
124
{
125
125
// It is, our work here is done
126
126
return 1 ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class DNSClient
19
19
@result 1 if aIPAddrString was successfully converted to an IP address,
20
20
else error code
21
21
*/
22
- int inet_aton (const char *aIPAddrString, IPAddress& aResult);
22
+ int inet_aton_ethlib (const char *aIPAddrString, IPAddress& aResult);
23
23
24
24
/* * Resolve the given hostname to an IP address.
25
25
@param aHostname Name to be resolved
You can’t perform that action at this time.
0 commit comments