#include "IP4.h"

#include <lwip/inet.h>

IP4::IP4(const char *str) {
    in_addr_t addr;
    if (str && inet_aton(str, &addr))
	*this = addr;
    else
	*this = null_ip;
}
const char * IP4::cstr() {
    in_addr_t addr = *this;
    return inet_ntoa(addr);
}
