#include uint32_t getipstr(char *); uint32_t getipstr(char *s) { int c, ip = 0; do { int byte = 0; while ((c = *s++) >= '0') byte = byte * 10 + c - '0'; ip = ip << 8 | byte; } while (c); return (uint32_t)ip; }