#ifndef _IP4ADDR_H_INCLUDED
#define _IP4ADDR_H_INCLUDED

#include <stdint.h>

typedef uint32_t ip4addr_t; /* host byte order */

/* parse string to ip4addr_t...: */
/*  ..single address, return true on ok and false if not */
int ip4addr(const char *s, ip4addr_t *ap);
/*  ..CIDR range, return number of bits or 0 if error */
unsigned ip4cidr(const char *s, ip4addr_t *ap);
/*  ..range of addresses (inclusive), return true/false */
int ip4range(const char *s, ip4addr_t *sp, ip4addr_t *ep);

/* inet_ntoa() */
const char *ip4atos(ip4addr_t a);

#endif
