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));
}
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));
}
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));
}
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));
}
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;
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;
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;
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));
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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 */
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))
{
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))
{
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))
{
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))
{
Datum
network_host(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
char *ptr;
char tmp[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255/128")];
Datum
network_show(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
int len;
char tmp[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255/128")];
Datum
inet_abbrev(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
char *dst;
char tmp[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255/128")];
Datum
cidr_abbrev(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
char *dst;
char tmp[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255/128")];
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));
}
Datum
network_family(PG_FUNCTION_ARGS)
{
- inet *ip = PG_GETARG_INET_P(0);
+ inet *ip = PG_GETARG_INET_PP(0);
switch (ip_family(ip))
{
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;
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;
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;
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;
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));
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));
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));
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));
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));
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))