#include #include #include "lwip/ip_addr.h" void test_ip(const char* ip_string) { ip4_addr_t ip_addr; if(ip4addr_aton(ip_string, &ip_addr)) { printf("IP : \"%s\" is correct and is also known as \"%s\"\r\n", ip_string,\ ip4addr_ntoa(&ip_addr)); } else printf("IP : \"%s\" is not correct\r\n", ip_string); } int main(void) { test_ip("192.168.0.1"); test_ip("192.168.0.0001"); test_ip("192.168.0.zzz"); test_ip("192.168.1"); test_ip("192.168.0xd3"); test_ip("192.168.0xz5"); test_ip("192.168.095"); return 0; }