From a824add49a899eb7f64883ad49cf21cba8f44c9a Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 20 Oct 1998 23:03:20 +0000 Subject: [PATCH] Remove unused INET functions for D'Arcy. --- src/backend/utils/adt/inet.c | 111 +--------------------------------- src/include/catalog/pg_proc.h | 8 +-- src/include/utils/builtins.h | 5 +- 3 files changed, 3 insertions(+), 121 deletions(-) diff --git a/src/backend/utils/adt/inet.c b/src/backend/utils/adt/inet.c index 9d547184c2..6c1f74f187 100644 --- a/src/backend/utils/adt/inet.c +++ b/src/backend/utils/adt/inet.c @@ -3,7 +3,7 @@ * is for IP V4 CIDR notation, but prepared for V6: just * add the necessary bits where the comments indicate. * - * $Id: inet.c,v 1.5 1998/10/17 04:08:40 momjian Exp $ + * $Id: inet.c,v 1.6 1998/10/20 23:03:19 momjian Exp $ */ #include @@ -312,115 +312,6 @@ inet_masklen(inet *ip) return ip_bits(ip); } -text * -inet_host(inet *ip) -{ - char *dst, - tmp[sizeof("255.255.255.255/32")]; - - if (ip_family(ip) == AF_INET) - { -#ifdef BAD - /* It's an IP V4 address: */ - if (inet_cidr_ntop(AF_INET, &ip_v4addr(ip), 4, -1, - tmp, sizeof(tmp)) < 0) - { - elog(ERROR, "unable to print host (%s)", strerror(errno)); - return (NULL); - } -#endif - } - else - { - /* Go for an IPV6 address here, before faulting out: */ - elog(ERROR, "unknown address family (%d)", ip_family(ip)); - return (NULL); - } - dst = palloc(strlen(tmp) + 1); - if (dst == NULL) - { - elog(ERROR, "unable to allocate memory in inet_out()"); - return (NULL); - } - strcpy(dst, tmp); - return (dst); - -} - -text * -inet_network_without_bits(inet *ip) -{ - char *dst, - tmp[sizeof("255.255.255.255/32")]; - - if (ip_family(ip) == AF_INET) - { - /* It's an IP V4 address: */ - int addr = ip_v4addr(ip) & (-1 << (32 - ip_bits(ip))); -#ifdef BAD - - if (inet_cidr_ntop(AF_INET, &addr, (int)(ip_bits(ip)/8), -1, - tmp, sizeof(tmp)) < 0) - { - elog(ERROR, "unable to print address (%s)", strerror(errno)); - return (NULL); - } -#endif - } - else - { - /* Go for an IPV6 address here, before faulting out: */ - elog(ERROR, "unknown address family (%d)", ip_family(ip)); - return (NULL); - } - dst = palloc(strlen(tmp) + 1); - if (dst == NULL) - { - elog(ERROR, "unable to allocate memory in inet_out()"); - return (NULL); - } - strcpy(dst, tmp); - return (dst); - -} - -text * -inet_network_with_bits(inet *ip) -{ - char *dst, - tmp[sizeof("255.255.255.255/32")]; - - if (ip_family(ip) == AF_INET) - { - /* It's an IP V4 address: */ - int addr = ip_v4addr(ip) & (-1 << (32 - ip_bits(ip))); -#ifdef BAD - - if (inet_cidr_ntop(AF_INET, &addr, (int)(ip_bits(ip)/8), - ip_bits(ip), tmp, sizeof(tmp)) < 0) - { - elog(ERROR, "unable to print address (%s)", strerror(errno)); - return (NULL); - } -#endif - } - else - { - /* Go for an IPV6 address here, before faulting out: */ - elog(ERROR, "unknown address family (%d)", ip_family(ip)); - return (NULL); - } - dst = palloc(strlen(tmp) + 1); - if (dst == NULL) - { - elog(ERROR, "unable to allocate memory in inet_out()"); - return (NULL); - } - strcpy(dst, tmp); - return (dst); - -} - text * inet_broadcast(inet *ip) { diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index f454342be9..1be26d5891 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.73 1998/10/12 04:07:48 momjian Exp $ + * $Id: pg_proc.h,v 1.74 1998/10/20 23:03:19 momjian Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -2101,12 +2101,6 @@ DATA(insert OID = 940 ( inet_netmask PGUID 11 f t f 1 f 25 "869" 100 0 0 100 DESCR("netmask of inet address"); DATA(insert OID = 941 ( inet_masklen PGUID 11 f t f 1 f 23 "869" 100 0 0 100 foo bar )); DESCR("netmask length"); -DATA(insert OID = 942 ( inet_host PGUID 11 f t f 1 f 25 "869" 100 0 0 100 foo bar )); -DESCR("host adress"); -DATA(insert OID = 943 ( inet_network_without_bits PGUID 11 f t f 1 f 25 "869" 100 0 0 100 foo bar )); -DESCR("netmask without bits"); -DATA(insert OID = 944 ( inet_network_with_bits PGUID 11 f t f 1 f 25 "869" 100 0 0 100 foo bar )); -DESCR("netmask with bits"); DATA(insert OID = 945 ( inet_broadcast PGUID 11 f t f 1 f 25 "869" 100 0 0 100 foo bar )); DESCR("broadcast address"); diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 49b849de09..9d9989a7c9 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: builtins.h,v 1.61 1998/10/12 04:07:51 momjian Exp $ + * $Id: builtins.h,v 1.62 1998/10/20 23:03:20 momjian Exp $ * * NOTES * This should normally only be included by fmgr.h. @@ -535,9 +535,6 @@ int4 inet_cmp(inet * a1, inet * a2); text *inet_netmask(inet * addr); int4 inet_masklen(inet * addr); -text *inet_host(inet * addr); -text *inet_network_without_bits(inet * addr); -text *inet_network_with_bits(inet * addr); text *inet_broadcast(inet * addr);