summaryrefslogtreecommitdiff
path: root/src/backend/libpq/ip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/libpq/ip.c')
-rw-r--r--src/backend/libpq/ip.c60
1 files changed, 29 insertions, 31 deletions
diff --git a/src/backend/libpq/ip.c b/src/backend/libpq/ip.c
index e1b26e5da8e..efba0753ce8 100644
--- a/src/backend/libpq/ip.c
+++ b/src/backend/libpq/ip.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.32 2005/10/17 16:24:19 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.32.2.1 2005/11/22 18:23:09 momjian Exp $
*
* This file and the IPV6 implementation were initially provided by
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
@@ -38,22 +38,22 @@
#include "libpq/ip.h"
-static int range_sockaddr_AF_INET(const struct sockaddr_in *addr,
- const struct sockaddr_in *netaddr,
- const struct sockaddr_in *netmask);
+static int range_sockaddr_AF_INET(const struct sockaddr_in * addr,
+ const struct sockaddr_in * netaddr,
+ const struct sockaddr_in * netmask);
#ifdef HAVE_IPV6
-static int range_sockaddr_AF_INET6(const struct sockaddr_in6 *addr,
- const struct sockaddr_in6 *netaddr,
- const struct sockaddr_in6 *netmask);
+static int range_sockaddr_AF_INET6(const struct sockaddr_in6 * addr,
+ const struct sockaddr_in6 * netaddr,
+ const struct sockaddr_in6 * netmask);
#endif
#ifdef HAVE_UNIX_SOCKETS
static int getaddrinfo_unix(const char *path,
- const struct addrinfo *hintsp,
- struct addrinfo **result);
+ const struct addrinfo * hintsp,
+ struct addrinfo ** result);
-static int getnameinfo_unix(const struct sockaddr_un *sa, int salen,
+static int getnameinfo_unix(const struct sockaddr_un * sa, int salen,
char *node, int nodelen,
char *service, int servicelen,
int flags);
@@ -65,7 +65,7 @@ static int getnameinfo_unix(const struct sockaddr_un *sa, int salen,
*/
int
pg_getaddrinfo_all(const char *hostname, const char *servname,
- const struct addrinfo *hintp, struct addrinfo **result)
+ const struct addrinfo * hintp, struct addrinfo ** result)
{
/* not all versions of getaddrinfo() zero *result on failure */
*result = NULL;
@@ -91,7 +91,7 @@ pg_getaddrinfo_all(const char *hostname, const char *servname,
* not safe to look at ai_family in the addrinfo itself.
*/
void
-pg_freeaddrinfo_all(int hint_ai_family, struct addrinfo *ai)
+pg_freeaddrinfo_all(int hint_ai_family, struct addrinfo * ai)
{
#ifdef HAVE_UNIX_SOCKETS
if (hint_ai_family == AF_UNIX)
@@ -125,7 +125,7 @@ pg_freeaddrinfo_all(int hint_ai_family, struct addrinfo *ai)
* guaranteed to be filled with something even on failure return.
*/
int
-pg_getnameinfo_all(const struct sockaddr_storage *addr, int salen,
+pg_getnameinfo_all(const struct sockaddr_storage * addr, int salen,
char *node, int nodelen,
char *service, int servicelen,
int flags)
@@ -168,8 +168,8 @@ pg_getnameinfo_all(const struct sockaddr_storage *addr, int salen,
* -------
*/
static int
-getaddrinfo_unix(const char *path, const struct addrinfo *hintsp,
- struct addrinfo **result)
+getaddrinfo_unix(const char *path, const struct addrinfo * hintsp,
+ struct addrinfo ** result)
{
struct addrinfo hints;
struct addrinfo *aip;
@@ -234,7 +234,7 @@ getaddrinfo_unix(const char *path, const struct addrinfo *hintsp,
* Convert an address to a hostname.
*/
static int
-getnameinfo_unix(const struct sockaddr_un *sa, int salen,
+getnameinfo_unix(const struct sockaddr_un * sa, int salen,
char *node, int nodelen,
char *service, int servicelen,
int flags)
@@ -267,7 +267,6 @@ getnameinfo_unix(const struct sockaddr_un *sa, int salen,
return 0;
}
-
#endif /* HAVE_UNIX_SOCKETS */
@@ -278,9 +277,9 @@ getnameinfo_unix(const struct sockaddr_un *sa, int salen,
* in the same address family; and AF_UNIX addresses are not supported.
*/
int
-pg_range_sockaddr(const struct sockaddr_storage *addr,
- const struct sockaddr_storage *netaddr,
- const struct sockaddr_storage *netmask)
+pg_range_sockaddr(const struct sockaddr_storage * addr,
+ const struct sockaddr_storage * netaddr,
+ const struct sockaddr_storage * netmask)
{
if (addr->ss_family == AF_INET)
return range_sockaddr_AF_INET((struct sockaddr_in *) addr,
@@ -297,9 +296,9 @@ pg_range_sockaddr(const struct sockaddr_storage *addr,
}
static int
-range_sockaddr_AF_INET(const struct sockaddr_in *addr,
- const struct sockaddr_in *netaddr,
- const struct sockaddr_in *netmask)
+range_sockaddr_AF_INET(const struct sockaddr_in * addr,
+ const struct sockaddr_in * netaddr,
+ const struct sockaddr_in * netmask)
{
if (((addr->sin_addr.s_addr ^ netaddr->sin_addr.s_addr) &
netmask->sin_addr.s_addr) == 0)
@@ -312,9 +311,9 @@ range_sockaddr_AF_INET(const struct sockaddr_in *addr,
#ifdef HAVE_IPV6
static int
-range_sockaddr_AF_INET6(const struct sockaddr_in6 *addr,
- const struct sockaddr_in6 *netaddr,
- const struct sockaddr_in6 *netmask)
+range_sockaddr_AF_INET6(const struct sockaddr_in6 * addr,
+ const struct sockaddr_in6 * netaddr,
+ const struct sockaddr_in6 * netmask)
{
int i;
@@ -327,8 +326,7 @@ range_sockaddr_AF_INET6(const struct sockaddr_in6 *addr,
return 1;
}
-
-#endif /* HAVE_IPV6 */
+#endif /* HAVE_IPV6 */
/*
* pg_sockaddr_cidr_mask - make a network mask of the appropriate family
@@ -339,7 +337,7 @@ range_sockaddr_AF_INET6(const struct sockaddr_in6 *addr,
* Return value is 0 if okay, -1 if not.
*/
int
-pg_sockaddr_cidr_mask(struct sockaddr_storage *mask, char *numbits, int family)
+pg_sockaddr_cidr_mask(struct sockaddr_storage * mask, char *numbits, int family)
{
long bits;
char *endptr;
@@ -414,7 +412,7 @@ pg_sockaddr_cidr_mask(struct sockaddr_storage *mask, char *numbits, int family)
* that pg_range_sockaddr will look at.
*/
void
-pg_promote_v4_to_v6_addr(struct sockaddr_storage *addr)
+pg_promote_v4_to_v6_addr(struct sockaddr_storage * addr)
{
struct sockaddr_in addr4;
struct sockaddr_in6 addr6;
@@ -449,7 +447,7 @@ pg_promote_v4_to_v6_addr(struct sockaddr_storage *addr)
* that pg_range_sockaddr will look at.
*/
void
-pg_promote_v4_to_v6_mask(struct sockaddr_storage *addr)
+pg_promote_v4_to_v6_mask(struct sockaddr_storage * addr)
{
struct sockaddr_in addr4;
struct sockaddr_in6 addr6;