41 #define DEBUG DEBUG_NONE
56 if(*addrstr ==
'[') addrstr++;
58 for(len = 0; len <
sizeof(
uip_ipaddr_t) - 1; addrstr++) {
60 if(c ==
':' || c ==
'\0' || c ==
']') {
61 ipaddr->u8[len] = (value >> 8) & 0xff;
62 ipaddr->u8[len + 1] = value & 0xff;
66 if(c ==
'\0' || c ==
']') {
70 if(*(addrstr + 1) ==
':') {
78 if(c >=
'0' && c <=
'9') {
80 }
else if(c >=
'a' && c <=
'f') {
82 }
else if(c >=
'A' && c <=
'F') {
85 PRINTF(
"uiplib: illegal char: '%c'\n", c);
88 value = (value << 4) + (tmp & 0xf);
91 if(c !=
'\0' && c !=
']') {
92 PRINTF(
"uiplib: too large address\n");
97 PRINTF(
"uiplib: too short address\n");
101 &ipaddr->u8[zero], len - zero);
102 memset(&ipaddr->u8[zero], 0,
sizeof(
uip_ipaddr_t) - len);
113 for(i = 0; i < 4; ++i) {
121 if(c ==
'.' || c == 0) {
124 }
else if(c >=
'0' && c <=
'9') {
125 tmp = (tmp * 10) + (c -
'0');
130 }
while(c !=
'.' && c != 0);