1 | /*------------------------------------------------------------------------- |
2 | * |
3 | * ifaddr.h |
4 | * IP netmask calculations, and enumerating network interfaces. |
5 | * |
6 | * Copyright (c) 2003-2019, PostgreSQL Global Development Group |
7 | * |
8 | * src/include/libpq/ifaddr.h |
9 | * |
10 | *------------------------------------------------------------------------- |
11 | */ |
12 | #ifndef IFADDR_H |
13 | #define IFADDR_H |
14 | |
15 | #include "libpq/pqcomm.h" /* pgrminclude ignore */ |
16 | |
17 | typedef void (*PgIfAddrCallback) (struct sockaddr *addr, |
18 | struct sockaddr *netmask, |
19 | void *cb_data); |
20 | |
21 | extern int pg_range_sockaddr(const struct sockaddr_storage *addr, |
22 | const struct sockaddr_storage *netaddr, |
23 | const struct sockaddr_storage *netmask); |
24 | |
25 | extern int pg_sockaddr_cidr_mask(struct sockaddr_storage *mask, |
26 | char *numbits, int family); |
27 | |
28 | extern int pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data); |
29 | |
30 | #endif /* IFADDR_H */ |
31 | |