Fix for funcs on INET/CIDR.
authorBruce Momjian
Thu, 22 Oct 1998 04:58:11 +0000 (04:58 +0000)
committerBruce Momjian
Thu, 22 Oct 1998 04:58:11 +0000 (04:58 +0000)
src/backend/utils/adt/inet.c
src/include/catalog/pg_proc.h
src/include/utils/builtins.h

index c755678cbc7b2578ed224c5646408a9c7e8ad579..c8daa75d9ee09bf78a9b88bbe3ccf67ca7732459 100644 (file)
@@ -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.10 1998/10/22 00:35:23 momjian Exp $
+ * $Id: inet.c,v 1.11 1998/10/22 04:58:07 momjian Exp $
  * Jon Postel RIP 16 Oct 1998
  */
 
@@ -355,12 +355,24 @@ inet_host(inet *ip)
    return (ret);
 }
 
+text *
+cidr_host(inet *ip)
+{
+       inet_host(ip);
+}
+
 int4
 inet_netmasklen(inet *ip)
 {
    return ip_bits(ip);
 }
 
+int4
+cidr_netmasklen(inet *ip)
+{
+   return inet_netmasklen(ip);
+}
+
 text *
 inet_broadcast(inet *ip)
 {
@@ -402,6 +414,12 @@ inet_broadcast(inet *ip)
    return (ret);
 }
 
+text *
+cidr_broadcast(inet *ip)
+{
+   inet_broadcast(ip);
+}
+   
 text *
 inet_netmask(inet *ip)
 {
@@ -441,6 +459,12 @@ inet_netmask(inet *ip)
    return (ret);
 }
 
+text *
+cidr_netmask(inet *ip)
+{
+   inet_netmask(ip);
+}
+
 /*
  * Bitwise comparison for V4 addresses.  Add V6 implementation!
  */
index ef6d067199c25e4c66984cf3bc139d44ff402b43..10553c2b513be3a88f03a5cdb43c9dee27a907d8 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: pg_proc.h,v 1.77 1998/10/22 00:35:25 momjian Exp $
+ * $Id: pg_proc.h,v 1.78 1998/10/22 04:58:09 momjian Exp $
  *
  * NOTES
  *   The script catalog/genbki.sh reads this file and generates .bki
@@ -2104,7 +2104,7 @@ DESCR("is-supernet");
 DATA(insert OID = 930 (  inet_supeq       PGUID 11 f t f 2 f 16 "869 869" 100 0 0 100  foo bar ));
 DESCR("is-supernet-or-equal");
 
-/* inet/cidr base versions */
+/* inet base versions */
 DATA(insert OID = 940 (  inet_netmask      PGUID 11 f t f 1 f 25 "869" 100 0 0 100  foo bar ));
 DESCR("netmask of address");
 DATA(insert OID = 941 (  inet_netmasklen   PGUID 11 f t f 1 f 23 "869" 100 0 0 100  foo bar ));
@@ -2114,6 +2114,16 @@ DESCR("broadcast address");
 DATA(insert OID = 682 (  inet_host         PGUID 11 f t f 1 f 25 "869" 100 0 0 100  foo bar ));
 DESCR("host address");
 
+/* cidr base versions */
+DATA(insert OID = 1619 (  cidr_netmask     PGUID 11 f t f 1 f 25 "650" 100 0 0 100  foo bar ));
+DESCR("netmask of address");
+DATA(insert OID = 1620 (  cidr_netmasklen  PGUID 11 f t f 1 f 23 "650" 100 0 0 100  foo bar ));
+DESCR("netmask length");
+DATA(insert OID = 1621 (  cidr_broadcast   PGUID 11 f t f 1 f 25 "650" 100 0 0 100  foo bar ));
+DESCR("broadcast address");
+DATA(insert OID = 1622 (  cidr_host            PGUID 11 f t f 1 f 25 "650" 100 0 0 100  foo bar ));
+DESCR("host address");
+
 /* inet versions */
 DATA(insert OID = 946 (  netmask       PGUID 14 f t f 1 f 25 "869" 100 0 0 100  "select inet_netmask($1)" - ));
 DESCR("netmask of address");
@@ -2125,17 +2135,16 @@ DATA(insert OID = 949 (  host           PGUID 14 f t f 1 f 25 "869" 100 0 0 100  "select
 DESCR("host address");
 
 /* cidr versions */
-DATA(insert OID = 696 (  netmask       PGUID 14 f t f 1 f 25 "650" 100 0 0 100  "select inet_netmask($1)" - ));
+DATA(insert OID = 696 (  netmask       PGUID 14 f t f 1 f 25 "650" 100 0 0 100  "select cidr_netmask($1)" - ));
 DESCR("netmask of address");
-DATA(insert OID = 697 (  netmasklen        PGUID 14 f t f 1 f 23 "650" 100 0 0 100  "select inet_netmasklen($1)" - ));
+DATA(insert OID = 697 (  netmasklen        PGUID 14 f t f 1 f 23 "650" 100 0 0 100  "select cidr_netmasklen($1)" - ));
 DESCR("netmask length");
-DATA(insert OID = 698 (  broadcast     PGUID 14 f t f 1 f 25 "650" 100 0 0 100  "select inet_broadcast($1)" - ));
+DATA(insert OID = 698 (  broadcast     PGUID 14 f t f 1 f 25 "650" 100 0 0 100  "select cidr_broadcast($1)" - ));
 DESCR("broadcast address");
-DATA(insert OID = 699 (  host          PGUID 14 f t f 1 f 25 "650" 100 0 0 100  "select inet_host($1)" - ));
+DATA(insert OID = 699 (  host          PGUID 14 f t f 1 f 25 "650" 100 0 0 100  "select cidr_host($1)" - ));
 DESCR("host address");
 
 
-
 /*
  * prototypes for functions pg_proc.c
  */
index 4144b54fcb470695c6b65fad1813b22944dada0c..430303b28d63e4672f7dffac61e5bfc19951b779 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: builtins.h,v 1.64 1998/10/22 00:35:28 momjian Exp $
+ * $Id: builtins.h,v 1.65 1998/10/22 04:58:11 momjian Exp $
  *
  * NOTES
  *   This should normally only be included by fmgr.h.
@@ -542,6 +542,11 @@ int4       inet_netmasklen(inet * addr);
 text      *inet_broadcast(inet * addr);
 text      *inet_host(inet * addr);
 
+text      *cidr_netmask(inet * addr);
+int4       cidr_netmasklen(inet * addr);
+text      *cidr_broadcast(inet * addr);
+text      *cidr_host(inet * addr);
+
 
 /* mac.c */
 macaddr    *macaddr_in(char *str);