40 #include "lwip/ip_addr.h"
96 for (mask = 1U << 31 ; mask != 0; mask >>= 1) {
97 if ((nm_hostorder & mask) == 0) {
102 for (; mask != 0; mask >>= 1) {
103 if ((nm_hostorder & mask) != 0) {
114 #define in_range(c, lo, up) ((u8_t)c >= lo && (u8_t)c <= up)
115 #define isprint(c) in_range(c, 0x20, 0x7f)
116 #define isdigit(c) in_range(c, '0', '9')
117 #define isxdigit(c) (isdigit(c) || in_range(c, 'a', 'f') || in_range(c, 'A', 'F'))
118 #define islower(c) in_range(c, 'a', 'z')
119 #define isspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
173 if (c ==
'x' || c ==
'X') {
181 val = (val * base) + (
int)(c -
'0');
183 }
else if (base == 16 &&
isxdigit(c)) {
184 val = (val << 4) | (
int)(c + 10 - (
islower(c) ?
'a' :
'A'));
196 if (pp >= parts + 3) {
207 if (c !=
'\0' && !
isspace(c)) {
214 switch (pp - parts + 1) {
223 if (val > 0xffffffUL) {
226 val |= parts[0] << 24;
233 val |= (parts[0] << 24) | (parts[1] << 16);
240 val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
290 ap = (
u8_t *)&s_addr;
291 for(n = 0; n < 4; n++) {
294 rem = *ap % (
u8_t)10;
296 inv[i++] =
'0' + rem;
299 if (len++ >= buflen) {
304 if (len++ >= buflen) {