1 /*-------------------------------------------------------------------------
4 * IP netmask calculations, and enumerating network interfaces.
6 * Copyright (c) 2003-2019, PostgreSQL Global Development Group
8 * src/include/libpq/ifaddr.h
10 *-------------------------------------------------------------------------
15 #include "libpq/pqcomm.h" /* pgrminclude ignore */
17 typedef void (*PgIfAddrCallback
) (struct sockaddr
*addr
,
18 struct sockaddr
*netmask
,
21 extern int pg_range_sockaddr(const struct sockaddr_storage
*addr
,
22 const struct sockaddr_storage
*netaddr
,
23 const struct sockaddr_storage
*netmask
);
25 extern int pg_sockaddr_cidr_mask(struct sockaddr_storage
*mask
,
26 char *numbits
, int family
);
28 extern int pg_foreach_ifaddr(PgIfAddrCallback callback
, void *cb_data
);