22 #include <sys/socket.h>
23 #include <netinet/in.h>
37 #define addr8 xa.addr8
38 #define addr16 xa.addr16
39 #define addr32 xa.addr32
42 int addr_unicast_masklen(
int af);
43 int addr_xaddr_to_sa(
const struct xaddr *xa,
struct sockaddr *sa,
44 socklen_t *len, u_int16_t port);
45 int addr_sa_to_xaddr(
struct sockaddr *sa, socklen_t slen,
struct xaddr *xa);
46 int addr_netmask(
int af, u_int l,
struct xaddr *n);
47 int addr_hostmask(
int af, u_int l,
struct xaddr *n);
48 int addr_invert(
struct xaddr *n);
49 int addr_pton(
const char *p,
struct xaddr *n);
50 int addr_sa_pton(
const char *h,
const char *s,
struct sockaddr *sa,
52 int addr_pton_cidr(
const char *p,
struct xaddr *n, u_int *l);
53 int addr_ntop(
const struct xaddr *n,
char *p,
size_t len);
54 int addr_and(
struct xaddr *dst,
const struct xaddr *a,
const struct xaddr *b);
55 int addr_cmp(
const struct xaddr *a,
const struct xaddr *b);
56 int addr_is_all0s(
const struct xaddr *n);
57 int addr_host_is_all0s(
const struct xaddr *n, u_int masklen);
58 int addr_netmatch(
const struct xaddr *host,
const struct xaddr *net,