summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt/network.c')
-rw-r--r--src/backend/utils/adt/network.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/backend/utils/adt/network.c b/src/backend/utils/adt/network.c
index 3c1cc46a7ec..ab6fd043384 100644
--- a/src/backend/utils/adt/network.c
+++ b/src/backend/utils/adt/network.c
@@ -172,7 +172,7 @@ network_out(inet *src, bool is_cidr)
Datum
inet_out(PG_FUNCTION_ARGS)
{
- inet *src = PG_GETARG_INET_P(0);
+ inet *src = PG_GETARG_INET_PP(0);
PG_RETURN_CSTRING(network_out(src, false));
}
@@ -180,7 +180,7 @@ inet_out(PG_FUNCTION_ARGS)
Datum
cidr_out(PG_FUNCTION_ARGS)
{
- inet *src = PG_GETARG_INET_P(0);
+ inet *src = PG_GETARG_INET_PP(0);
PG_RETURN_CSTRING(network_out(src, true));
}
@@ -299,7 +299,7 @@ network_send(inet *addr, bool is_cidr)
Datum
inet_send(PG_FUNCTION_ARGS)
{
- inet *addr = PG_GETARG_INET_P(0);
+ inet *addr = PG_GETARG_INET_PP(0);
PG_RETURN_BYTEA_P(network_send(addr, false));
}
@@ -307,7 +307,7 @@ inet_send(PG_FUNCTION_ARGS)
Datum
cidr_send(PG_FUNCTION_ARGS)
{
- inet *addr = PG_GETARG_INET_P(0);
+ inet *addr = PG_GETARG_INET_PP(0);
PG_RETURN_BYTEA_P(network_send(addr, true));
}
@@ -316,7 +316,7 @@ cidr_send(PG_FUNCTION_ARGS)
Datum
inet_to_cidr(PG_FUNCTION_ARGS)
{
- inet *src = PG_GETARG_INET_P(0);
+ inet *src = PG_GETARG_INET_PP(0);
inet *dst;
int bits;
int byte;
@@ -356,7 +356,7 @@ inet_to_cidr(PG_FUNCTION_ARGS)
Datum
inet_set_masklen(PG_FUNCTION_ARGS)
{
- inet *src = PG_GETARG_INET_P(0);
+ inet *src = PG_GETARG_INET_PP(0);
int bits = PG_GETARG_INT32(1);
inet *dst;
@@ -380,7 +380,7 @@ inet_set_masklen(PG_FUNCTION_ARGS)
Datum
cidr_set_masklen(PG_FUNCTION_ARGS)
{
- inet *src = PG_GETARG_INET_P(0);
+ inet *src = PG_GETARG_INET_PP(0);
int bits = PG_GETARG_INT32(1);
inet *dst;
int byte;
@@ -455,8 +455,8 @@ network_cmp_internal(inet *a1, inet *a2)
Datum
network_cmp(PG_FUNCTION_ARGS)
{
- inet *a1 = PG_GETARG_INET_P(0);
- inet *a2 = PG_GETARG_INET_P(1);
+ inet *a1 = PG_GETARG_INET_PP(0);
+ inet *a2 = PG_GETARG_INET_PP(1);
PG_RETURN_INT32(network_cmp_internal(a1, a2));
}
@@ -467,8 +467,8 @@ network_cmp(PG_FUNCTION_ARGS)
Datum
network_lt(PG_FUNCTION_ARGS)
{
- inet *a1 = PG_GETARG_INET_P(0);
- inet *a2 = PG_GETARG_INET_P(1);
+ inet *a1 = PG_GETARG_INET_PP(0);
+ inet *a2 = PG_GETARG_INET_PP(1);
PG_RETURN_BOOL(network_cmp_internal(a1, a2) < 0);
}
@@ -476,8 +476,8 @@ network_lt(PG_FUNCTION_ARGS)
Datum
network_le(PG_FUNCTION_ARGS)
{
- inet *a1 = PG_GETARG_INET_P(0);
- inet *a2 = PG_GETARG_INET_P(1);
+ inet *a1 = PG_GETARG_INET_PP(0);
+ inet *a2 = PG_GETARG_INET_PP(1);
PG_RETURN_BOOL(network_cmp_internal(a1, a2) <= 0);
}
@@ -485,8 +485,8 @@ network_le(PG_FUNCTION_ARGS)
Datum
network_eq(PG_FUNCTION_ARGS)
{
- inet *a1 = PG_GETARG_INET_P(0);
- inet *a2 = PG_GETARG_INET_P(1);
+ inet *a1 = PG_GETARG_INET_PP(0);
+ inet *a2 = PG_GETARG_INET_PP(1);
PG_RETURN_BOOL(network_cmp_internal(a1, a2) == 0);
}
@@ -494,8 +494,8 @@ network_eq(PG_FUNCTION_ARGS)
Datum
network_ge(PG_FUNCTION_ARGS)
{
- inet *a1 = PG_GETARG_INET_P(0);
- inet *a2 = PG_GETARG_INET_P(1);
+ inet *a1 = PG_GETARG_INET_PP(0);
+ inet *a2 = PG_GETARG_INET_PP(1);
PG_RETURN_BOOL(network_cmp_internal(a1, a2) >= 0);
}
@@ -503,8 +503,8 @@ network_ge(PG_FUNCTION_ARGS)
Datum
network_gt(PG_FUNCTION_ARGS)
{
- inet *a1 = PG_GETARG_INET_P(0);
- inet *a2 = PG_GETARG_INET_P(1);
+ inet *a1 = PG_GETARG_INET_PP(0);
+ inet *a2 = PG_GETARG_INET_PP(1);
PG_RETURN_BOOL(network_cmp_internal(a1, a2) > 0);
}
@@ -512,8 +512,8 @@ network_gt(PG_FUNCTION_ARGS)
Datum
network_ne(PG_FUNCTION_ARGS)
{
- inet *a1 = PG_GETARG_INET_P(0);
- inet *a2 = PG_GETARG_INET_P(1);
+ inet *a1 = PG_GETARG_INET_PP(0);
+ inet *a2 = PG_GETARG_INET_PP(1);
PG_RETURN_BOOL(network_cmp_internal(a1, a2) != 0);
}
@@ -524,7 +524,7 @@ network_ne(PG_FUNCTION_ARGS)
Datum
hashinet(PG_FUNCTION_ARGS)
{
- inet *addr = PG_GETARG_INET_P(0);
+ inet *addr = PG_GETARG_INET_PP(0);
int addrsize = ip_addrsize(addr);
/* XXX this assumes there are no pad bytes in the data structure */
@@ -537,8 +537,8 @@ hashinet(PG_FUNCTION_ARGS)
Datum
network_sub(PG_FUNCTION_ARGS)
{
- inet *a1 = PG_GETARG_INET_P(0);
- inet *a2 = PG_GETARG_INET_P(1);
+ inet *a1 = PG_GETARG_INET_PP(0);
+ inet *a2 = PG_GETARG_INET_PP(1);
if (ip_family(a1) == ip_family(a2))
{
@@ -552,8 +552,8 @@ network_sub(PG_FUNCTION_ARGS)
Datum
network_subeq(PG_FUNCTION_ARGS)
{
- inet *a1 = PG_GETARG_INET_P(0);
- inet *a2 = PG_GETARG_INET_P(1);
+ inet *a1 = PG_GETARG_INET_PP(0);
+ inet *a2 = PG_GETARG_INET_PP(1);
if (ip_family(a1) == ip_family(a2))
{
@@ -567,8 +567,8 @@ network_subeq(PG_FUNCTION_ARGS)
Datum
network_sup(PG_FUNCTION_ARGS)
{
- inet *a1 = PG_GETARG_INET_P(0);
- inet *a2 = PG_GETARG_INET_P(1);
+ inet *a1 = PG_GETARG_INET_PP(0);
+ inet *a2 = PG_GETARG_INET_PP(1);
if (ip_family(a1) == ip_family(a2))
{
@@ -582,8 +582,8 @@ network_sup(PG_FUNCTION_ARGS)
Datum
network_supeq(PG_FUNCTION_ARGS)
{
- inet *a1 = PG_GETARG_INET_P(0);
- inet *a2 = PG_GETARG_INET_P(1);
+ inet *a1 = PG_GETARG_INET_PP(0);
+ inet *a2 = PG_GETARG_INET_PP(1);
if (ip_family(a1) == ip_family(a2))
{
@@ -600,7 +600,7 @@ network_supeq(PG_FUNCTION_ARGS)
Datum
network_host(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
text *ret;
int len;
char *ptr;
@@ -633,7 +633,7 @@ network_host(PG_FUNCTION_ARGS)
Datum
network_show(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
text *ret;
int len;
char tmp[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255/128")];
@@ -662,7 +662,7 @@ network_show(PG_FUNCTION_ARGS)
Datum
inet_abbrev(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
text *ret;
char *dst;
int len;
@@ -687,7 +687,7 @@ inet_abbrev(PG_FUNCTION_ARGS)
Datum
cidr_abbrev(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
text *ret;
char *dst;
int len;
@@ -712,7 +712,7 @@ cidr_abbrev(PG_FUNCTION_ARGS)
Datum
network_masklen(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
PG_RETURN_INT32(ip_bits(ip));
}
@@ -720,7 +720,7 @@ network_masklen(PG_FUNCTION_ARGS)
Datum
network_family(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
switch (ip_family(ip))
{
@@ -739,7 +739,7 @@ network_family(PG_FUNCTION_ARGS)
Datum
network_broadcast(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
inet *dst;
int byte;
int bits;
@@ -788,7 +788,7 @@ network_broadcast(PG_FUNCTION_ARGS)
Datum
network_network(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
inet *dst;
int byte;
int bits;
@@ -831,7 +831,7 @@ network_network(PG_FUNCTION_ARGS)
Datum
network_netmask(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
inet *dst;
int byte;
int bits;
@@ -872,7 +872,7 @@ network_netmask(PG_FUNCTION_ARGS)
Datum
network_hostmask(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
inet *dst;
int byte;
int bits;
@@ -1239,7 +1239,7 @@ inet_server_port(PG_FUNCTION_ARGS)
Datum
inetnot(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
inet *dst;
dst = (inet *) palloc0(sizeof(inet));
@@ -1264,8 +1264,8 @@ inetnot(PG_FUNCTION_ARGS)
Datum
inetand(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
- inet *ip2 = PG_GETARG_INET_P(1);
+ inet *ip = PG_GETARG_INET_PP(0);
+ inet *ip2 = PG_GETARG_INET_PP(1);
inet *dst;
dst = (inet *) palloc0(sizeof(inet));
@@ -1296,8 +1296,8 @@ inetand(PG_FUNCTION_ARGS)
Datum
inetor(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
- inet *ip2 = PG_GETARG_INET_P(1);
+ inet *ip = PG_GETARG_INET_PP(0);
+ inet *ip2 = PG_GETARG_INET_PP(1);
inet *dst;
dst = (inet *) palloc0(sizeof(inet));
@@ -1380,7 +1380,7 @@ internal_inetpl(inet *ip, int64 addend)
Datum
inetpl(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
int64 addend = PG_GETARG_INT64(1);
PG_RETURN_INET_P(internal_inetpl(ip, addend));
@@ -1390,7 +1390,7 @@ inetpl(PG_FUNCTION_ARGS)
Datum
inetmi_int8(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
int64 addend = PG_GETARG_INT64(1);
PG_RETURN_INET_P(internal_inetpl(ip, -addend));
@@ -1400,8 +1400,8 @@ inetmi_int8(PG_FUNCTION_ARGS)
Datum
inetmi(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
- inet *ip2 = PG_GETARG_INET_P(1);
+ inet *ip = PG_GETARG_INET_PP(0);
+ inet *ip2 = PG_GETARG_INET_PP(1);
int64 res = 0;
if (ip_family(ip) != ip_family(ip2))