Full Code of RhodiumToad/ip4r for AI

master 941f6b8ddd35 cached
35 files
966.4 KB
362.8k tokens
752 symbols
1 requests
Download .txt
Showing preview only (995K chars total). Download the full file or copy to clipboard to get everything.
Repository: RhodiumToad/ip4r
Branch: master
Commit: 941f6b8ddd35
Files: 35
Total size: 966.4 KB

Directory structure:
gitextract_txv3m7cj/

├── .dir-locals.el
├── .editorconfig
├── .gitattributes
├── .github/
│   └── workflows/
│       ├── regr_macos.yml
│       └── regression.yml
├── .gitignore
├── LICENSE
├── Makefile
├── README.ip4r
├── expected/
│   ├── ip4r-softerr.out
│   ├── ip4r-v11.out
│   └── ip4r.out
├── ip4r.control
├── scripts/
│   ├── ip4r--2.0--2.1.sql
│   ├── ip4r--2.1--2.2.sql
│   ├── ip4r--2.2--2.4.sql
│   ├── ip4r--2.4.sql
│   ├── ip4r--unpackaged1--2.0.sql
│   ├── ip4r--unpackaged2.0--2.0.sql
│   └── ip4r--unpackaged2.1--2.1.sql
├── sql/
│   ├── ip4r-softerr.sql
│   ├── ip4r-v11.sql
│   └── ip4r.sql
├── src/
│   ├── ip4r.c
│   ├── ip4r_funcs.h
│   ├── ip4r_module.c
│   ├── ip6r.c
│   ├── ip6r_funcs.h
│   ├── ipaddr.c
│   ├── ipr.h
│   ├── ipr_internal.h
│   ├── iprange.c
│   └── raw_io.c
└── tools/
    ├── numeric-tests.mk
    └── numeric.mk

================================================
FILE CONTENTS
================================================

================================================
FILE: .dir-locals.el
================================================
;; largely stolen from pg itself

((c-mode . ((c-basic-offset . 4)
            (c-file-style . "bsd")
	    (c-file-offsets (case-label . +) (label . -) (statement-case-open . +))
            (fill-column . 78)
            (indent-tabs-mode . t)
            (tab-width . 4)
	    (eval add-hook 'before-save-hook 'delete-trailing-whitespace nil t)))
 (css-mode . ((tab-width . 4)
	      (eval add-hook 'before-save-hook 'delete-trailing-whitespace nil t)))
 (dsssl-mode . ((indent-tabs-mode . nil)))
 (nxml-mode . ((indent-tabs-mode . nil))))

;; c-file-offsets is not marked safe by default, but you can either
;; accept the specific value given as safe always, or do something
;; like this in your .emacs to accept only the simplest offset lists
;; automatically:
;; (defun my-safe-c-file-offsets-p (alist)
;;  (catch 'break
;;    (and (listp alist)
;;         (dolist (elt alist t)
;;           (pcase elt
;;             (`(,(pred symbolp) . ,(or `+ `- `++ `-- `* `/)) t)
;;             (`(,(pred symbolp) . ,(or (pred null) (pred integerp))) t)
;;             (`(,(pred symbolp) . [ ,(pred integerp) ]) t)
;;             (_ (throw 'break nil)))))))
;; (put 'c-file-offsets 'safe-local-variable 'my-safe-c-file-offsets-p)


================================================
FILE: .editorconfig
================================================

[*]
tab_width = 4

[Makefile]
tab_width = 8


================================================
FILE: .gitattributes
================================================
# gitattributes
*		whitespace=space-before-tab,trailing-space
*.[chly]	whitespace=space-before-tab,trailing-space,indent-with-non-tab,tabwidth=4
*.[ch]		linguist-language=C

src/*.h		linguist-language=C
src/*.c		linguist-language=C

# Test output files that contain extra whitespace
*.out		-whitespace


================================================
FILE: .github/workflows/regr_macos.yml
================================================
name: Build on MacOS

on:
  push:
    branches: [ master ]
    tags:     [ REL_* ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: macos-latest

    defaults:
      run:
        shell: sh

    steps:
    - name: checkout
      uses: actions/checkout@v3

    - name: start pg
      run: |
        brew services start postgresql

    - name: build
      run: |
        make && sudo -E make install

    - name: wait for pg
      run: |
        n=0
        while ! pg_isready; do [ $(( n += 1 )) -gt 10 ] && exit 1; sleep $n; done

    - name: test
      run: |
        time make installcheck

    - name: show output
      if: always()
      run: |
        cat regression.diffs || true


================================================
FILE: .github/workflows/regression.yml
================================================
name: Build

on:
  push:
    branches: [ master ]
    tags:     [ REL_* ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest

    defaults:
      run:
        shell: sh

    strategy:
      matrix:
        pgver:  [ 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16 ]
        include:
          - pgrepo: ""
          - pgver: 17
            pgrepo: "-pgdg-snapshot"

    env:
      PG:       ${{ matrix.pgver }}
      PGREPO:   ${{ matrix.pgrepo }}

    steps:
    - name: checkout
      uses: actions/checkout@v3

    - name: cleanup pg
      run: |
        sudo apt-get -y --purge --no-upgrade remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common
        curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
        sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" >/etc/apt/sources.list.d/pgdg.list'
        sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg-snapshot main 17" >/etc/apt/sources.list.d/pgdg-snap.list'
        sudo apt-get update -qq
        sudo rm -rf /var/lib/postgresql

    - name: install pg
      run: |
        sudo apt-get -y \
               -o Dpkg::Options::=--force-confdef \
               -o Dpkg::Options::=--force-confnew \
               ${PGREPO:+-t "$(lsb_release -cs)$PGREPO"} \
               install postgresql-${PG:?} postgresql-server-dev-${PG:?}
        sudo -u postgres createuser -s "$USER"

    - name: build and test
      run: |
        make && sudo -E make install && time make installcheck

    - name: show output
      if: always()
      run: |
        cat regression.diffs || true


================================================
FILE: .gitignore
================================================
*.o
*.so
*.so.[0-9]
*.so.[0-9].[0-9]
*.sl
*.sl.[0-9]
*.sl.[0-9].[0-9]
*.dylib
*.dll
*.a
*.mo
*.bc
objfiles.txt
.deps/
*.gcno
*.gcda
*.gcov
*.gcov.out
lcov.info
coverage/
/results/
/ip4r.sql
/ip4r.sql.in
/sql/ip4r-legacy.sql
/expected/ip4r-legacy.out
/build*/


================================================
FILE: LICENSE
================================================
PostgreSQL License

Copyright (c) 2004-2019, Andrew Gierth
Copyright (c) 2003, Steve Atkins
Copyright (c) 2000-2003, PostgreSQL Global Development Group

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without a written agreement is
hereby granted, provided that the above copyright notice and this paragraph
and the following two paragraphs appear in all copies.

IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHORS
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

THE AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
AND THE AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.



================================================
FILE: Makefile
================================================

EXTENSION= ip4r

MODULE_big = ip4r

SRC_SQL	= ip4r--2.4.sql \
	  ip4r--2.2--2.4.sql \
	  ip4r--2.1--2.2.sql \
	  ip4r--2.0--2.1.sql \
	  $(if $(call version_ge,$(MAJORVERSION),13),,$(SRC_OLD))
# "FROM unpackaged" was removed in pg13
SRC_OLD = ip4r--unpackaged2.1--2.1.sql \
	  ip4r--unpackaged2.0--2.0.sql \
	  ip4r--unpackaged1--2.0.sql
DATA	= $(addprefix scripts/, $(SRC_SQL))

objdir	= src

DOCS	= README.ip4r
OBJS_C	= ip4r_module.o ip4r.o ip6r.o ipaddr.o iprange.o raw_io.o
OBJS	= $(addprefix src/, $(OBJS_C))
INCS	= ipr.h ipr_internal.h

HEADERS = src/ipr.h

REGRESS = ip4r \
	  $(REGRESS_BY_VERSION)
REGRESS_V11 := ip4r-v11
REGRESS_V16 := ip4r-softerr

define REGRESS_BY_VERSION
$(strip $(foreach v,$(filter REGRESS_V%,$(.VARIABLES)),
           $(if $(call version_ge,$(MAJORVERSION),$(subst REGRESS_V,,$(v))),
                $($(v)))))
endef

# if VPATH is not already set, but the makefile is not in the current
# dir, then assume a vpath build using the makefile's directory as
# source. PGXS will set $(srcdir) accordingly.
ifndef VPATH
ifneq ($(realpath $(CURDIR)),$(realpath $(dir $(firstword $(MAKEFILE_LIST)))))
VPATH := $(dir $(firstword $(MAKEFILE_LIST)))
endif
endif

mklibdir := $(if $(VPATH),$(VPATH)/tools,tools)
include $(mklibdir)/numeric.mk

PG_CONFIG ?= pg_config
PGXS = $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

ifeq ($(call version_ge,$(MAJORVERSION),9.1),)
$(error unsupported PostgreSQL version)
endif

$(OBJS): $(addprefix $(srcdir)/src/, $(INCS))

# for a vpath build, we need src/ to exist in the build dir before
# building any objects.
ifdef VPATH
all: vpath-mkdirs
.PHONY: vpath-mkdirs
$(OBJS): | vpath-mkdirs

vpath-mkdirs:
	$(MKDIR_P) $(objdir)
endif # VPATH


# end


================================================
FILE: README.ip4r
================================================

IP4R  - IPv4/v6 and IPv4/v6 range index type for PostgreSQL
===========================================================

CHANGES in version 2.4.2:
=========================

 * Support pg 16, including soft-error handling for input.

 * Check for lower < upper in binary format input and correct
   if necessary.

 * Remove support for some long-obsolete PG versions

 * Remove support for old-style (pre-extension) building.

CHANGES in version 2.4.1:
=========================

 * No functional changes.

 * Adjust regression tests for PostgreSQL 12.

CHANGES in version 2.4:
=======================

 * Add new cidr_split functions to decompose an arbitrary range into
   a set of CIDR blocks.

 * Add casts to and from bit and bytea types.

 * Support new hash functions for hash partitioning.

 * Support window function RANGE offsets in pg11+, including a special
   case where negative offset values are treated as CIDR prefix lengths
   (so RANGE BETWEEN -16 PRECEDING AND -16 FOLLOWING includes in the
   window frame all rows in the same /16 as the current row).

 * Fix a historical oversight with the hash function for iprange, in which
   it would return different values for ip6 cidr ranges than the ip6r hash
   function. This was not a bug in that no queries would give wrong
   answers, but it would prevent any future reorganization of the opclass
   to handle cross-type comparisons. Since allowing hash partitioning has
   the practical effect of casting the hash function in stone (far more so
   than hash indexes do), best to fix this now.

   The result of the function iprangehash(iprange) is NOT changed by this
   update, on the assumption that it might have been in use for
   inheritance partitioning or other explicit uses. Instead, a new hash
   function is added for the opclass to use.

   NOTE: This version requires any hash indexes on iprange columns to be
   rebuilt. An ALTER EXTENSION ... UPDATE command will refuse to run if it
   detects any such indexes (it will report the offending indexes in INFO
   messages to the client). You can automatically drop or recreate
   affected indexes by performing one of these commands before the ALTER
   EXTENSION:

     SET ip4r.update_indexes = 'drop';
     SET ip4r.update_indexes = 'rebuild';

   (on pg 9.1 you will have to add 'ip4r' to custom_variable_classes
   in postgresql.conf and restart before doing this)

   The value 'drop' will drop any iprange hash indexes and complete the
   upgrade. The DROP commands will be done with RESTRICT: if there are any
   additional dependencies on the indexes in question, the upgrade will
   not proceed; these will have to be dealt with manually. If any indexes
   were dropped the upgrade will leave behind a new table named
   ip4r_update_to_2_4.update_indexes containing the affected table and
   index information, including the CREATE INDEX command as obtained by
   pg_get_indexdef(). This table is not part of the extension and can be
   dropped when the data is no longer needed. The value 'rebuild' will
   cause the update script to perform the needed CREATE INDEX commands
   itself (which of course may take some time).

CHANGES in version 2.3:
=======================

 * Fix build for changes in PostgreSQL 11.

 * Fix long-standing bug in binary-mode I/O of iprange type
   (other types were not affected).

CHANGES in version 2.2:
=======================

 * Updating to this version should fix the pg_dump issue that affects
   certain older installs that have been updated to 2.1, where a
   poorly written catalog update to fix old function signatures broke
   pg_dump.

CHANGES in version 2.1:
=======================

 * Index-only scans are now supported (on pg 9.5 or later)

 * Downward casts from ipaddress to ip4/ip6, and iprange to
   ip4r/ip6r, are now allowed as assignment casts as well as
   explicit casts.

 * parallel-safe is set on all functions in pg 9.6 or later.

 * Support for pre-9.1 versions of postgres (back to 8.4), and
   non-extension builds on any version, is maintained in this release
   (and some glaring bugs fixed), but should be considered
   deprecated. Future releases will likely abandon support for
   non-extension packaging.

 * Vestigial (and apparently non-functional) support for versions
   prior to 8.4 is removed.

CHANGES in version 2.0:
=======================

 * 9.1+ extension packaging mechanism is the default for this version
   (use NO_EXTENSION=1 to build on pre-9.1 or without packaging)

 * New types for ip6, ip6r, ipaddress, iprange

 * ip4 input no longer accepts spurious leading whitespace

UPGRADING
=========

If upgrading from ip4r-2.0 installed outside the extension mechanism, use:

CREATE EXTENSION ip4r FROM "unpackaged2.0";

If upgrading from ip4r-1.x, use:

CREATE EXTENSION ip4r FROM unpackaged1;


RATIONALE
=========

While PostgreSQL already has builtin types 'inet' and 'cidr', the
authors of this module found that they had a number of requirements
that were not addressed by the builtin type.

Firstly and most importantly, the builtin types have no good support
for index lookups of the form (column >>= parameter), i.e. where you
have a table of IP address ranges and wish to find which ones include
a given IP address.  This requires an rtree or gist index to do
efficiently, and also requires a way to represent IP address ranges
that do not fall precisely on CIDR boundaries.

(While newer versions of PostgreSQL do now have support for gist
indexes on the inet type, the performance is very poor compared to
this module.)

Secondly, the builtin inet/cidr are somewhat overloaded with
semantics, with inet combining two distinct concepts (a netblock, and
a specific IP within that netblock). Furthermore, they are variable
length types (to support ipv6) with non-trivial overheads, and the
authors (whose applications mainly deal in large volumes of single
IPv4 addresses) wanted a more lightweight representation.

IP4R therefore supports six distinct data types:

  ip4   - a single IPv4 address
  ip4r  - an arbitrary range of IPv4 addresses
  ip6   - a single IPv6 address
  ip6r  - an arbitrary range of IPv6 addresses
  ipaddress  - a single IPv4 or IPv6 address
  iprange    - an arbitrary range of IPv4 or IPv6 addresses

Simple usage examples:

CREATE TABLE ipranges (range ip4r primary key, description text not null);
CREATE INDEX ipranges_range_idx ON ipranges USING gist (range);
INSERT INTO ipranges VALUES ('10.0.0.0/8','rfc1918 block 1');
INSERT INTO ipranges VALUES ('172.16.0.0/12','rfc1918 block 2');
INSERT INTO ipranges VALUES ('192.168.0.0/16','rfc1918 block 3');
INSERT INTO ipranges VALUES ('0.0.0.0/1','classical class A space');
INSERT INTO ipranges VALUES ('10.0.1.10-10.0.1.20','my internal network');
INSERT INTO ipranges VALUES ('127.0.0.1','localhost');

CREATE TABLE access_log (id serial primary key, ip ip4 not null);
CREATE INDEX access_log_ip_idx ON access_log (ip);
INSERT INTO access_log(ip) VALUES ('10.0.1.15');
INSERT INTO access_log(ip) VALUES ('24.1.2.3');
INSERT INTO access_log(ip) VALUES ('192.168.10.20');
INSERT INTO access_log(ip) VALUES ('127.0.0.1');

-- find all accesses from 10.0.0.0/8
SELECT * FROM access_log WHERE ip BETWEEN '10.0.0.0' AND '10.255.255.255';

-- find all applicable descriptions for all entry in the access log
-- returns multiple rows for each entry if there are overlapping ranges
SELECT id,ip,range,description FROM access_log, ipranges WHERE ip <<= range;

-- find only the most specific description for all IPs in the access log
SELECT DISTINCT ON (ip) ip,range,description
  FROM access_log, ipranges
 WHERE ip <<= range
 ORDER BY ip, @ range;


INSTALLATION
============

ip4r can be installed via the pgxs mechanism (which is now the default).
Unpack the distribution and do:

make
make install

(as with PostgreSQL itself, this requires GNU Make. The second command
will usually need to be run as root.)

PRE-9.1 SYSTEMS
===============

On versions before 9.1, or to build without extension packaging, use:

make NO_EXTENSION=1
make NO_EXTENSION=1 install

and execute the ip4r.sql file manually in the same way as for contrib
modules (see the postgres manual).


USAGE
=====

Types "ip4", "ip6", "ipaddress"
-------------------------------

"ip4" accepts input in the form 'nnn.nnn.nnn.nnn' in decimal base only
(no hex, octal, etc.).  An ip4 value is a single IP address, and is
stored as a 32-bit unsigned integer.

"ip6" accepts input in the standard hexadecimal representation for
IPv6 addresses, e.g. '2001:1234:aa55::2323'. "Mixed" format input
(using an IPv4 dotted-decimal for the last two words) is accepted. An
ip6 value is a single IP address, and is stored as two 64-bit values
for convenience. Output is represented according to the specification
in RFC 5952 (including output in mixed format for v4-mapped addresses).

"ipaddress" accepts any input which is valid for either ip4 or ip6. An
ipaddress value is a single IP address, either v4 or v6. The v4 and v6
ranges are treated as disjoint - all v4 addresses are considered lower
than all v6 addresses, and '1.2.3.4' and '::ffff:1.2.3.4' are not equal.

"ipX" will be used below to represent any of the above three types.

The following type conversions are supported:

  Source type   | Dest type  |  Form
----------------|------------|-------------------------------------------------
  ipX           |  text      |  text(ipX)  or  ipX::text  (explicit)
  text          |  ipX       |  ipX(text)  or  text::ipX  (explicit)
  ipX           |  cidr      |  cidr(ipX)  or  ipX::cidr  (assignment)
  inet          |  ipX       |  ipX(inet)  or  inet::ipX  (assignment)
  ipX           |  numeric   |  to_numeric(ipX) or  ipX::numeric (explicit)
  numeric       |  ipX       |  ipX(numeric)    or  bigint::ipX  (explicit)
  ip4           |  bigint    |  to_bigint(ip4)  or  ip4::bigint  (explicit)
  bigint        |  ip4       |  ip4(bigint)     or  bigint::ip4  (explicit)
  ip4           |  float8    |  to_double(ip4)  or  ip4::float8  (explicit)
  float8        |  ip4       |  ip4(float8)     or  float8::ip4  (explicit)
  ipX           |  varbit    |  to_bit(ipX)     or  ipX::varbit  (explicit)
  bit(32)       |  ip4       |  ip4(bit)        or  bit::ip4     (explicit)
  bit(128)      |  ip6       |  ip6(bit)        or  bit::ip6     (explicit)
  varbit        |  ipX       |  ipX(varbit)     or  varbit::ipX  (explicit)
  ipX           |  bytea     |  to_bytea(ipX)   or  ipX::bytea   (explicit)
  bytea         |  ipX       |  ipX(bytea)      or  bytea::ipX   (explicit)
  ipX           |  ipXr      |  ipXr(ipX)  or  ipX::ipXr  (implicit)
  ip4           |  ipaddress |  ipaddress(ip4)  or  ip4::ipaddress (implicit)
  ip6           |  ipaddress |  ipaddress(ip6)  or  ip6::ipaddress (implicit)
  ipaddress     |  ip4       |  ip4(ipaddress)  or  ipaddress::ip4 (assignment)
  ipaddress     |  ip6       |  ip6(ipaddress)  or  ipaddress::ip6 (assignment)

The conversions from bigint and float8 are available only for ip4, and
accept values which are exact integers in the range 0 .. 2^32-1, which
are converted to IPs in the range 0.0.0.0 - 255.255.255.255 in the
obvious way. This is useful for conversions from applications which
store IPs in numeric form, as is often done for performance in certain
other databases.

Conversions to and from the 'numeric' type are available for all
formats with the obvious behaviour.

The conversion to cidr always results in a /32 (for v4) or /128 (for v6).
The conversion from inet ignores any prefix length and just takes the
specific IP address.

An ipX value implicitly converts to either the corresponding range
type (ip4 -> ip4r, ip6 -> ip6r), or to the iprange type, producing a
range containing only the single IP address.

ipX supports the following operators with the conventional meanings:
=, <>, <, >, <=, >=, and supports ORDER BY and btree indexes in the
obvious fashion. However, the planner does not understand how to
transform a query of the form

  WHERE ipcolumn <<= value

into a btree range scan (it does this transformation for the builtin
inet type using a function which is not extensible by plugins). As a
workaround, use the following form instead:

  WHERE ipcolumn BETWEEN lower(value) AND upper(value)

which will use a btree range scan.

ipX supports the following additional operators and functions:

 family(ipX) returns integer
 | returns the value 4 or 6 depending on address family

 ip4_netmask(integer) returns ip4
 | returns an ip4 value that represents a netmask for a prefix length

 ip6_netmask(integer) returns ip6
 | returns an ip6 value that represents a netmask for a prefix length

 ipX_net_lower(ipX, integer) returns ipX
 | returns the lowest address in the cidr block of the specified prefix
 | length, containing the specified IP
 | equivalent to: network(set_masklen(cidr(ipX),integer))

 ipX_net_upper(ipX, integer) returns ipX
 | returns the highest address in the cidr block of the specified prefix
 | length, containing the specified IP
 | equivalent to: broadcast(set_masklen(cidr(ip4),integer))

  Operator        | Description
------------------|--------------------------------------------------------
 ipX + integer    | add the given integer to the IP 
 ipX - integer    | subtract the given integer from the IP 
 ipX + bigint     | add the given integer to the IP 
 ipX - bigint     | subtract the given integer from the IP 
 ipX + numeric    | add the given integer to the IP 
 ipX - numeric    | subtract the given integer from the IP 
 ipX - ipX        | (returns bigint or numeric) difference between two IPs
 ipX & ipX        | bitwise-AND the two values
 ipX | ipX        | bitwise-OR the two values
 ipX # ipX        | bitwise-XOR the two values
 ~ ipX            | bitwise-NOT the value

Arithmetic on ip4 values does not wrap below 0.0.0.0 or above
255.255.255.255 - attempting to go beyond these limits raises an
error.

More complex arithmetic on IP addresses can be performed by converting
the IPs to numeric first; the above are only intended to cover the
common cases without requiring casts.


Types "ip4r", "ip6r", "iprange"
-------------------------------

An "ip4r" value denotes a single range of one or more IPv4 addresses,
for example '192.0.2.100-192.0.2.200'. Arbitrary ranges are allowed,
though input can also be in the form of CIDR netblocks, e.g.
'192.0.2.0/24' is equivalent to '192.0.2.0-192.0.2.255'. A single
value such as '192.0.2.25' represents a range containing only that
value.

An "ip6r" value denotes a single range of one or more IPv6 addresses,
for example '2001::1234-2001::2000:0000'. Arbitrary ranges are
allowed, though input can also be in the form of CIDR netblocks, e.g.
'2001::/112' is equivalent to '2001::-2001::ffff'. A single value such
as '2001::1234' represents a range containing only that value. Output
formatting is as specified in RFC 5952.

An "iprange" value denotes either an IPv4 range or an IPv6 range, or
the special value '-' which includes all of both IPv4 and IPv6 space.
Mixing of address families is not otherwise supported.

For all of the above types, values are displayed in CIDR form if they
represent a CIDR range, otherwise in range form.

Currently, abbreviated CIDR forms for IPv4 are not accepted at all,
i.e. all octets must be supplied. For IPv6, words may only be omitted
from the address as permitted by the zero-compression rules of RFC 5952.

"ipXr" will be used below to represent any one of the above three types.

An ipXr value can be constructed from two IPs explicitly using the
function ipXr(ipX,ipX). The ends of the range can be specified in
either order.

An ipXr value can be constructed from an IP and a prefix length
using the / operator (see below). For backward compatibility, the
function names ipXr_net_prefix and ipXr_net_mask are still accepted
for this operator.

ipXr supports the following type conversions:

  Source type   | Dest type |  Form
----------------|-----------|----------------------------------------------
  ipX           |  ipXr     |  ipXr(ipX)  or  ipX::ipXr  (implicit)
  ipXr          |  text     |  text(ipXr) or  ipXr::text (explicit)
  text          |  ipXr     |  ipXr(text) or  text::ipXr (explicit)
  ipXr          |  cidr     |  cidr(ipXr) or  ipXr::cidr (explicit)
  cidr          |  ipXr     |  ipXr(cidr) or  cidr::ipXr (assignment)
  ipXr          |  varbit   |  to_bit(ipXr) or ipXr::varbit  (explicit)
  varbit        |  ip4r     |  ip4r(varbit) or varbit::ip4r  (explicit)
  varbit        |  ip6r     |  ip6r(varbit) or varbit::ip6r  (explicit)

The conversion cidr(ipXr) returns NULL if the ipXr value does not
represent a valid CIDR range.

In addition, type conversions between ip4r, ip6r and iprange are permitted
in all valid combinations.

ipXr supports the following functions:

  family(ipXr) returns integer
  |  returns 4 or 6 according to address family, or NULL for '-'::iprange

  is_cidr(ipXr) returns boolean
  |  returns TRUE if the ipXr value is a valid CIDR range

  lower(ipXr) returns ipX
  |  returns the lower end of the ipXr range, as an ipX value

  upper(ipXr) returns ipX
  |  returns the upper end of the ipXr range, as an ipX value

  cidr_split(ipXr) returns setof ipXr
  |  splits the range up into separate CIDR blocks, and returns each one
  |  as a separate row

ipXr supports the following operators:

  Operator        | Description
------------------|--------------------------------------------------------
  a = b           | exact equality
  a <> b          | exact inequality
  a < b           | note [1]
  a <= b          | note [1]
  a > b           | note [1]
  a >= b          | note [1]
  a >>= b         | a contains b or is equal to b
  a >> b          | a strictly contains b
  a <<= b         | a is contained in b or is equal to b
  a << b          | a is strictly contained in b
  a && b          | a and b overlap
  @ a             | approximate size of a (returns double)
  @@ a            | exact size of a (returns numeric)
  a / n           | construct CIDR range from address a length n
  a / b           | construct CIDR range from address a netmask b

[1]: the operators <, <=, >, >= implement an ordering for the purposes of
btree indexes, DISTINCT and ORDER BY; the ordering is not necessarily
useful for applications. The ordering used is a lexicographic ordering
of (lower,upper).

For testing whether an ipXr range contains a specified single ip, use the
>>= operator, i.e.  ipXr >>= ipX.  The implicit conversion from ipX to ipXr
handles this case.


ipXr Indexes
------------

ipXr values can be indexed in several ways.

A conventional btree index on ipXr values will work for the purposes of
unique/primary key constraints, ordering, and equality lookups (i.e.
WHERE column = value). Btree indexes are created in the usual way and
are the default index type.

However, ipXr's utility comes from its ability to use gist indexes to
support the following lookup types:

  WHERE column >>= value      (or >>)
  WHERE column <<= value      (or <<)
  WHERE column && value

These lookups require a GiST index. This can be created as follows:

CREATE INDEX indexname ON tablename USING gist (column);

It is also possible to create a functional ip4r index over a column of
'cidr' type as follows:

CREATE INDEX indexname ON tablename USING gist (iprange(cidrcolumn));

(ip4r(column) or ip6r(column) can also be used if the column is constrained
to contain only values of the specified address family)

This can then be used for queries of the form:

  WHERE iprange(cidrcolumn) >>= value    (or >>, <<=, && etc)

One advantage of this method is that the ip4r type can be dropped and
recreated without losing data. This is useful for accelerating queries
on an existing table designed without ip4r in mind.

Another idiom sometimes seen for representation of ranges of IP
addresses is for applications to create two integer columns, and do
range queries of the form:

  WHERE value BETWEEN column1 and column2

This is an attempt to get some use out of a btree index, but it performs
poorly in most cases. This can also be converted to use a functional ip4r
index as follows:

CREATE INDEX indexname ON tablename
   USING gist (ip4r(column1::ip4,column2::ip4));

and then doing queries of the form:

  WHERE ip4r(column1::ip4,column2::ip4) >>= value

This method is not usually practical for IPv6.

A common requirement is to get the longest-prefix (most specific)
match to an IP address from a table of ranges or CIDR prefixes.
This can usually be best achieved using ORDER BY @ column,
for example:

SELECT * FROM tablename
 WHERE column >>= value
 ORDER BY @ column
 LIMIT 1

The use of @ column (approximate size) is sufficient if the values are
IPv4 ranges or are always CIDR prefixes. If arbitrary IPv6 ranges are
present, then overlapping ranges with small size differences might
compare equal; in this case use ORDER BY @@ column.

When looking up multiple IPs, one can do queries of the following
form:

SELECT DISTINCT ON (ips.ip) ips.ip, ranges.range
  FROM ips, ranges
 WHERE ranges.range >>= ips.ip
 ORDER BY ips.ip, @ ranges.range


Choosing an index method
------------------------

As with any data type, the choice of what index method to use (in this
case, btree vs. GiST) is generally dictated by what comparison
operators you want to use on the data. So a condition of the form
WHERE clientip = $1 or WHERE clientip BETWEEN lower($1) AND upper($1)
would make use of a btree index, whereas a for a condition like
WHERE range >>= $1 then a GiST index would be indicated.

GiST indexes are defined by this module only for ranges of addresses
(ip4r, ip6r, iprange), so you would almost always use btree indexes
for columns storing a single address. The sole exception to this would
be if you need a multicolumn GiST index that combines an ip address
with columns of other GiST-indexable types (such as PostGIS geometry),
in which case it may make sense to cast the address to a range
containing only the single address.


AUTHORS
=======

this code by andrew@tao11.riddles.org.uk Oct 2004 - 2018
derived from 'ipr' by Steve Atkins <steve@blighty.com> August 2003
derived from the 'seg' type distributed with PostgreSQL.

Distributed under the same terms as PostgreSQL itself.

Currently maintained at:
  http://github.com/RhodiumToad/ip4r



================================================
FILE: expected/ip4r-softerr.out
================================================
-- Tests for pg16+
--valid and invalid ip4
select v.i, v.t, pg_input_is_valid(v.t,'ip4') as valid, ierr.*
  from (values (1, '1.2.3.4'),
	       (2, '0.0.0.0'),
	       (3, '255.255.255.255'),
	       -- invalid
	       (4, '1.2.3'),
	       (5, '0'),
	       (6, ' 1.2.3.4'),
	       (7, '1.2.3.4 '),
	       (8, '0.0.0.256'),
	       (9 , '0.0.256'),
	       (10, '0..255.0'),
	       (11, '+0.255.0.0'),
	       (12, '1.2.3.4-1.2.3.4')) v(i,t)
  left join lateral (select * from pg_input_error_info(v.t,'ip4')) ierr
		 on true;
 i  |        t        | valid |               message                | detail | hint | sql_error_code 
----+-----------------+-------+--------------------------------------+--------+------+----------------
  1 | 1.2.3.4         | t     |                                      |        |      | 
  2 | 0.0.0.0         | t     |                                      |        |      | 
  3 | 255.255.255.255 | t     |                                      |        |      | 
  4 | 1.2.3           | f     | invalid IP4 value: '1.2.3'           |        |      | 22023
  5 | 0               | f     | invalid IP4 value: '0'               |        |      | 22023
  6 |  1.2.3.4        | f     | invalid IP4 value: ' 1.2.3.4'        |        |      | 22023
  7 | 1.2.3.4         | f     | invalid IP4 value: '1.2.3.4 '        |        |      | 22023
  8 | 0.0.0.256       | f     | invalid IP4 value: '0.0.0.256'       |        |      | 22023
  9 | 0.0.256         | f     | invalid IP4 value: '0.0.256'         |        |      | 22023
 10 | 0..255.0        | f     | invalid IP4 value: '0..255.0'        |        |      | 22023
 11 | +0.255.0.0      | f     | invalid IP4 value: '+0.255.0.0'      |        |      | 22023
 12 | 1.2.3.4-1.2.3.4 | f     | invalid IP4 value: '1.2.3.4-1.2.3.4' |        |      | 22023
(12 rows)

--valid and invalid ip4r
select v.i, v.t, pg_input_is_valid(v.t,'ip4r') as valid, ierr.*
  from (values (1, '1.2.3.4'),
	       (2, '255.255.255.255/32'),
	       (3, '128.0.0.0/1'),
	       (4, '0.0.0.0/0'),
	       (5, '1.2.3.4-5.6.7.8'),
	       (6, '5.6.7.8-1.2.3.4'),
	       -- invalid
	       (7, '1.2.3'),
	       (8, '255.255.255.255.255.255.255.255.255'),
	       (9, '255.255.255.255.255-255.255.255.255.255'),
	       (10, '255.255.255.255-1.2.3.4.5'),
	       (11, '0.0.0.1/31'),
	       (12, '128.0.0.0/0'),
	       (13, '0.0.0.0/33'),
	       (14, '0.0.0.0/3.0'),
	       (15, '0.0.0.0/+33')
	       ) v(i,t)
  left join lateral (select * from pg_input_error_info(v.t,'ip4r')) ierr
		 on true;
 i  |                    t                    | valid |                            message                            | detail | hint | sql_error_code 
----+-----------------------------------------+-------+---------------------------------------------------------------+--------+------+----------------
  1 | 1.2.3.4                                 | t     |                                                               |        |      | 
  2 | 255.255.255.255/32                      | t     |                                                               |        |      | 
  3 | 128.0.0.0/1                             | t     |                                                               |        |      | 
  4 | 0.0.0.0/0                               | t     |                                                               |        |      | 
  5 | 1.2.3.4-5.6.7.8                         | t     |                                                               |        |      | 
  6 | 5.6.7.8-1.2.3.4                         | t     |                                                               |        |      | 
  7 | 1.2.3                                   | f     | invalid IP4R value: "1.2.3"                                   |        |      | 22023
  8 | 255.255.255.255.255.255.255.255.255     | f     | invalid IP4R value: "255.255.255.255.255.255.255.255.255"     |        |      | 22023
  9 | 255.255.255.255.255-255.255.255.255.255 | f     | invalid IP4R value: "255.255.255.255.255-255.255.255.255.255" |        |      | 22023
 10 | 255.255.255.255-1.2.3.4.5               | f     | invalid IP4R value: "255.255.255.255-1.2.3.4.5"               |        |      | 22023
 11 | 0.0.0.1/31                              | f     | invalid IP4R value: "0.0.0.1/31"                              |        |      | 22023
 12 | 128.0.0.0/0                             | f     | invalid IP4R value: "128.0.0.0/0"                             |        |      | 22023
 13 | 0.0.0.0/33                              | f     | invalid IP4R value: "0.0.0.0/33"                              |        |      | 22023
 14 | 0.0.0.0/3.0                             | f     | invalid IP4R value: "0.0.0.0/3.0"                             |        |      | 22023
 15 | 0.0.0.0/+33                             | f     | invalid IP4R value: "0.0.0.0/+33"                             |        |      | 22023
(15 rows)

--valid and invalid ip6
select v.i, v.t, pg_input_is_valid(v.t,'ip6') as valid, ierr.*
  from (values (1, '0000:0000:0000:0000:0000:0000:0000:0000'),
	       (2, '0000:0000:0000:0000:0000:0000:0000:0001'),
	       (3, '0:0:0:0:0:0:0:0'),
	       (4, '0:0:0:0:0:0:0:1'),
	       (5, '0:0:0:0:0:0:13.1.68.3'),
	       (6, '0:0:0:0:0:FFFF:129.144.52.38'),
	       (7, '0::0'),
	       (8, '1:2:3:4:5:6:1.2.3.4'),
	       -- invalid
	       (9, ''),
	       (10, '02001:0000:1234:0000:0000:C1C0:ABCD:0876'),
	       (11, '1.2.3.4:1111:2222:3333:4444::5555'),
	       (12, '123'),
	       (13, '12345::6:7:8'),
	       (14, '::1.2.256.4'),
	       (15, 'FF01::101::2'),
	       (16, 'FF02:0000:0000:0000:0000:0000:0000:0000:0001'),
	       (17, 'ldkfj')
       ) v(i,t)
  left join lateral (select * from pg_input_error_info(v.t,'ip6')) ierr
		 on true;
 i  |                      t                       | valid |                              message                              | detail | hint | sql_error_code 
----+----------------------------------------------+-------+-------------------------------------------------------------------+--------+------+----------------
  1 | 0000:0000:0000:0000:0000:0000:0000:0000      | t     |                                                                   |        |      | 
  2 | 0000:0000:0000:0000:0000:0000:0000:0001      | t     |                                                                   |        |      | 
  3 | 0:0:0:0:0:0:0:0                              | t     |                                                                   |        |      | 
  4 | 0:0:0:0:0:0:0:1                              | t     |                                                                   |        |      | 
  5 | 0:0:0:0:0:0:13.1.68.3                        | t     |                                                                   |        |      | 
  6 | 0:0:0:0:0:FFFF:129.144.52.38                 | t     |                                                                   |        |      | 
  7 | 0::0                                         | t     |                                                                   |        |      | 
  8 | 1:2:3:4:5:6:1.2.3.4                          | t     |                                                                   |        |      | 
  9 |                                              | f     | invalid IP6 value: ''                                             |        |      | 22023
 10 | 02001:0000:1234:0000:0000:C1C0:ABCD:0876     | f     | invalid IP6 value: '02001:0000:1234:0000:0000:C1C0:ABCD:0876'     |        |      | 22023
 11 | 1.2.3.4:1111:2222:3333:4444::5555            | f     | invalid IP6 value: '1.2.3.4:1111:2222:3333:4444::5555'            |        |      | 22023
 12 | 123                                          | f     | invalid IP6 value: '123'                                          |        |      | 22023
 13 | 12345::6:7:8                                 | f     | invalid IP6 value: '12345::6:7:8'                                 |        |      | 22023
 14 | ::1.2.256.4                                  | f     | invalid IP6 value: '::1.2.256.4'                                  |        |      | 22023
 15 | FF01::101::2                                 | f     | invalid IP6 value: 'FF01::101::2'                                 |        |      | 22023
 16 | FF02:0000:0000:0000:0000:0000:0000:0000:0001 | f     | invalid IP6 value: 'FF02:0000:0000:0000:0000:0000:0000:0000:0001' |        |      | 22023
 17 | ldkfj                                        | f     | invalid IP6 value: 'ldkfj'                                        |        |      | 22023
(17 rows)

--valid and invalid ip6r
select v.i, v.t, pg_input_is_valid(v.t,'ip6r') as valid, ierr.*
  from (values (1, '::'),
	       (2, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'),
	       (3, '1::2'),
	       (4, '::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'),
	       (5, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::'),
	       (6, '1::2-3::4'),
	       (7, '3::4-3::4'),
	       (8, '3::4-1::2'),
	       -- invalid
	       (9, '::-::-::'),
	       (10, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff-ffff'),
	       (11, '::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'),
	       (12, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::'),
	       (13, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128'),
	       (14, '0000:0000:0000:0000:0000:0000:0000:0001/127'),
	       (15, '0800:0000:0000:0000:0000:0000:0000:0000/4'),
	       (16, '8000:0000:0000:0000:0000:0000:0000:0000/0'),
	       (17, '::/129'),
	       (18, '::/255'),
	       (19, '::/256'),
	       (20, '::/+0'),
	       (21, '::/0-0'),
	       (22, '::-::/0')
       ) v(i,t)
  left join lateral (select * from pg_input_error_info(v.t,'ip6r')) ierr
		 on true;
 i  |                        t                         | valid |                                message                                 | detail | hint | sql_error_code 
----+--------------------------------------------------+-------+------------------------------------------------------------------------+--------+------+----------------
  1 | ::                                               | t     |                                                                        |        |      | 
  2 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff          | t     |                                                                        |        |      | 
  3 | 1::2                                             | t     |                                                                        |        |      | 
  4 | ::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff       | t     |                                                                        |        |      | 
  5 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::       | t     |                                                                        |        |      | 
  6 | 1::2-3::4                                        | t     |                                                                        |        |      | 
  7 | 3::4-3::4                                        | t     |                                                                        |        |      | 
  8 | 3::4-1::2                                        | t     |                                                                        |        |      | 
  9 | ::-::-::                                         | f     | invalid IP6R value: "::-::-::"                                         |        |      | 22023
 10 | ffff:ffff:ffff:ffff:ffff:ffff:ffff-ffff          | f     | invalid IP6R value: "ffff:ffff:ffff:ffff:ffff:ffff:ffff-ffff"          |        |      | 22023
 11 | ::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff  | f     | invalid IP6R value: "::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"  |        |      | 22023
 12 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::  | f     | invalid IP6R value: "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::"  |        |      | 22023
 13 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128 | f     | invalid IP6R value: "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128" |        |      | 22023
 14 | 0000:0000:0000:0000:0000:0000:0000:0001/127      | f     | invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/127"      |        |      | 22023
 15 | 0800:0000:0000:0000:0000:0000:0000:0000/4        | f     | invalid IP6R value: "0800:0000:0000:0000:0000:0000:0000:0000/4"        |        |      | 22023
 16 | 8000:0000:0000:0000:0000:0000:0000:0000/0        | f     | invalid IP6R value: "8000:0000:0000:0000:0000:0000:0000:0000/0"        |        |      | 22023
 17 | ::/129                                           | f     | invalid IP6R value: "::/129"                                           |        |      | 22023
 18 | ::/255                                           | f     | invalid IP6R value: "::/255"                                           |        |      | 22023
 19 | ::/256                                           | f     | invalid IP6R value: "::/256"                                           |        |      | 22023
 20 | ::/+0                                            | f     | invalid IP6R value: "::/+0"                                            |        |      | 22023
 21 | ::/0-0                                           | f     | invalid IP6R value: "::/0-0"                                           |        |      | 22023
 22 | ::-::/0                                          | f     | invalid IP6R value: "::-::/0"                                          |        |      | 22023
(22 rows)

--valid and invalid ipaddress
select v.i, v.t, pg_input_is_valid(v.t,'ipaddress') as valid, ierr.*
  from (values (1, '1.2.3.4'),
	       (2, '0.0.0.0'),
	       (3, '255.255.255.255'),
	       (4, '1::8'),
	       (5, '2001:0000:1234:0000:0000:C1C0:ABCD:0876'),
	       (6, '2001:0db8:0000:0000:0000:0000:1428:57ab'),
	       -- invalid
	       (7, '1.2.3'),
	       (8, '0'),
	       (9, ' 1.2.3.4'),
	       (10, '1.2.3.4 '),
	       (11, '0.0.0.256'),
	       (12, ''),
	       (13, '02001:0000:1234:0000:0000:C1C0:ABCD:0876'),
	       (14, '1.2.3.4:1111:2222:3333:4444::5555'),
	       (15, '::ffff:2.3.4'),
	       (16, '::ffff:257.1.2.3'),
	       (17, 'FF01::101::2'),
	       (18, 'FF02:0000:0000:0000:0000:0000:0000:0000:0001'),
	       (19, 'ldkfj')
       ) v(i,t)
  left join lateral (select * from pg_input_error_info(v.t,'ipaddress')) ierr
		 on true;
 i  |                      t                       | valid |                             message                              | detail | hint | sql_error_code 
----+----------------------------------------------+-------+------------------------------------------------------------------+--------+------+----------------
  1 | 1.2.3.4                                      | t     |                                                                  |        |      | 
  2 | 0.0.0.0                                      | t     |                                                                  |        |      | 
  3 | 255.255.255.255                              | t     |                                                                  |        |      | 
  4 | 1::8                                         | t     |                                                                  |        |      | 
  5 | 2001:0000:1234:0000:0000:C1C0:ABCD:0876      | t     |                                                                  |        |      | 
  6 | 2001:0db8:0000:0000:0000:0000:1428:57ab      | t     |                                                                  |        |      | 
  7 | 1.2.3                                        | f     | invalid IP value: '1.2.3'                                        |        |      | 22023
  8 | 0                                            | f     | invalid IP value: '0'                                            |        |      | 22023
  9 |  1.2.3.4                                     | f     | invalid IP value: ' 1.2.3.4'                                     |        |      | 22023
 10 | 1.2.3.4                                      | f     | invalid IP value: '1.2.3.4 '                                     |        |      | 22023
 11 | 0.0.0.256                                    | f     | invalid IP value: '0.0.0.256'                                    |        |      | 22023
 12 |                                              | f     | invalid IP value: ''                                             |        |      | 22023
 13 | 02001:0000:1234:0000:0000:C1C0:ABCD:0876     | f     | invalid IP value: '02001:0000:1234:0000:0000:C1C0:ABCD:0876'     |        |      | 22023
 14 | 1.2.3.4:1111:2222:3333:4444::5555            | f     | invalid IP value: '1.2.3.4:1111:2222:3333:4444::5555'            |        |      | 22023
 15 | ::ffff:2.3.4                                 | f     | invalid IP value: '::ffff:2.3.4'                                 |        |      | 22023
 16 | ::ffff:257.1.2.3                             | f     | invalid IP value: '::ffff:257.1.2.3'                             |        |      | 22023
 17 | FF01::101::2                                 | f     | invalid IP value: 'FF01::101::2'                                 |        |      | 22023
 18 | FF02:0000:0000:0000:0000:0000:0000:0000:0001 | f     | invalid IP value: 'FF02:0000:0000:0000:0000:0000:0000:0000:0001' |        |      | 22023
 19 | ldkfj                                        | f     | invalid IP value: 'ldkfj'                                        |        |      | 22023
(19 rows)

--valid and invalid iprange
select v.i, v.t, pg_input_is_valid(v.t,'iprange') as valid, ierr.*
  from (values (1, '-'),
	       (2, '1.2.3.4'),
	       (3, '255.255.255.255/32'),
	       (4, '128.0.0.0/1'),
	       (5, '0.0.0.0/0'),
	       (6, '1.2.3.4-5.6.7.8'),
	       (7, '5.6.7.8-1.2.3.4'),
	       (8, '1.2.3.4-1.2.3.4'),
	       (9, '::'),
	       (10, '1::2'),
	       (11, '::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'),
	       (12, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::'),
	       (13, '1::2-3::4'),
	       (14, '3::4-3::4'),
	       (15, '3::4-1::2'),
	       (16, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128'),
	       (17, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe/127'),
	       (18, '8000:0000:0000:0000:0000:0000:0000:0000/1'),
	       (19, '0000:0000:0000:0000:0000:0000:0000:0000/0'),
	       -- invalid
	       (20, '1.2.3'),
	       (21, '255.255.255.255.255.255.255.255.255'),
	       (22, '255.255.255.255.255-255.255.255.255.255'),
	       (23, '255.255.255.255-1.2.3.4.5'),
	       (24, '255.255.255.255-1.2.3'),
	       (25, '0.0.0.1/31'),
	       (26, '64.0.0.0/1'),
	       (27, '128.0.0.0/0'),
	       (28, '0.0.0.0/33'),
	       (29, '0.0.0.0/3.0'),
	       (30, '0.0.0.0/+33'),
	       (31, '::-::-::'),
	       (32, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff-ffff'),
	       (33, '::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'),
	       (34, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::'),
	       (35, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128'),
	       (36, '0000:0000:0000:0000:0000:0000:0000:0001/127'),
	       (37, '0800:0000:0000:0000:0000:0000:0000:0000/4'),
	       (38, '8000:0000:0000:0000:0000:0000:0000:0000/0'),
	       (39, '::/129'),
	       (40, '::/255'),
	       (41, '::/256'),
	       (42, '::/+0'),
	       (43, '::/0-0'),
	       (44, '::-::/0'),
	       (45, '-::'),
	       (46, '-1.2.3.4'),
	       (47, '1.2.3.4-')
       ) v(i,t)
  left join lateral (select * from pg_input_error_info(v.t,'iprange')) ierr
		 on true;
 i  |                        t                         | valid |                                message                                 | detail | hint | sql_error_code 
----+--------------------------------------------------+-------+------------------------------------------------------------------------+--------+------+----------------
  1 | -                                                | t     |                                                                        |        |      | 
  2 | 1.2.3.4                                          | t     |                                                                        |        |      | 
  3 | 255.255.255.255/32                               | t     |                                                                        |        |      | 
  4 | 128.0.0.0/1                                      | t     |                                                                        |        |      | 
  5 | 0.0.0.0/0                                        | t     |                                                                        |        |      | 
  6 | 1.2.3.4-5.6.7.8                                  | t     |                                                                        |        |      | 
  7 | 5.6.7.8-1.2.3.4                                  | t     |                                                                        |        |      | 
  8 | 1.2.3.4-1.2.3.4                                  | t     |                                                                        |        |      | 
  9 | ::                                               | t     |                                                                        |        |      | 
 10 | 1::2                                             | t     |                                                                        |        |      | 
 11 | ::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff       | t     |                                                                        |        |      | 
 12 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::       | t     |                                                                        |        |      | 
 13 | 1::2-3::4                                        | t     |                                                                        |        |      | 
 14 | 3::4-3::4                                        | t     |                                                                        |        |      | 
 15 | 3::4-1::2                                        | t     |                                                                        |        |      | 
 16 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128      | t     |                                                                        |        |      | 
 17 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe/127      | t     |                                                                        |        |      | 
 18 | 8000:0000:0000:0000:0000:0000:0000:0000/1        | t     |                                                                        |        |      | 
 19 | 0000:0000:0000:0000:0000:0000:0000:0000/0        | t     |                                                                        |        |      | 
 20 | 1.2.3                                            | f     | invalid IP4R value: "1.2.3"                                            |        |      | 22023
 21 | 255.255.255.255.255.255.255.255.255              | f     | invalid IP4R value: "255.255.255.255.255.255.255.255.255"              |        |      | 22023
 22 | 255.255.255.255.255-255.255.255.255.255          | f     | invalid IP4R value: "255.255.255.255.255-255.255.255.255.255"          |        |      | 22023
 23 | 255.255.255.255-1.2.3.4.5                        | f     | invalid IP4R value: "255.255.255.255-1.2.3.4.5"                        |        |      | 22023
 24 | 255.255.255.255-1.2.3                            | f     | invalid IP4R value: "255.255.255.255-1.2.3"                            |        |      | 22023
 25 | 0.0.0.1/31                                       | f     | invalid IP4R value: "0.0.0.1/31"                                       |        |      | 22023
 26 | 64.0.0.0/1                                       | f     | invalid IP4R value: "64.0.0.0/1"                                       |        |      | 22023
 27 | 128.0.0.0/0                                      | f     | invalid IP4R value: "128.0.0.0/0"                                      |        |      | 22023
 28 | 0.0.0.0/33                                       | f     | invalid IP4R value: "0.0.0.0/33"                                       |        |      | 22023
 29 | 0.0.0.0/3.0                                      | f     | invalid IP4R value: "0.0.0.0/3.0"                                      |        |      | 22023
 30 | 0.0.0.0/+33                                      | f     | invalid IP4R value: "0.0.0.0/+33"                                      |        |      | 22023
 31 | ::-::-::                                         | f     | invalid IP6R value: "::-::-::"                                         |        |      | 22023
 32 | ffff:ffff:ffff:ffff:ffff:ffff:ffff-ffff          | f     | invalid IP6R value: "ffff:ffff:ffff:ffff:ffff:ffff:ffff-ffff"          |        |      | 22023
 33 | ::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff  | f     | invalid IP6R value: "::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"  |        |      | 22023
 34 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::  | f     | invalid IP6R value: "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::"  |        |      | 22023
 35 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128 | f     | invalid IP6R value: "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128" |        |      | 22023
 36 | 0000:0000:0000:0000:0000:0000:0000:0001/127      | f     | invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/127"      |        |      | 22023
 37 | 0800:0000:0000:0000:0000:0000:0000:0000/4        | f     | invalid IP6R value: "0800:0000:0000:0000:0000:0000:0000:0000/4"        |        |      | 22023
 38 | 8000:0000:0000:0000:0000:0000:0000:0000/0        | f     | invalid IP6R value: "8000:0000:0000:0000:0000:0000:0000:0000/0"        |        |      | 22023
 39 | ::/129                                           | f     | invalid IP6R value: "::/129"                                           |        |      | 22023
 40 | ::/255                                           | f     | invalid IP6R value: "::/255"                                           |        |      | 22023
 41 | ::/256                                           | f     | invalid IP6R value: "::/256"                                           |        |      | 22023
 42 | ::/+0                                            | f     | invalid IP6R value: "::/+0"                                            |        |      | 22023
 43 | ::/0-0                                           | f     | invalid IP6R value: "::/0-0"                                           |        |      | 22023
 44 | ::-::/0                                          | f     | invalid IP6R value: "::-::/0"                                          |        |      | 22023
 45 | -::                                              | f     | invalid IP6R value: "-::"                                              |        |      | 22023
 46 | -1.2.3.4                                         | f     | invalid IP4R value: "-1.2.3.4"                                         |        |      | 22023
 47 | 1.2.3.4-                                         | f     | invalid IP4R value: "1.2.3.4-"                                         |        |      | 22023
(47 rows)

-- end


================================================
FILE: expected/ip4r-v11.out
================================================
-- Tests for pg11+
-- RANGE support
select a4,
       array_agg(a4) over (order by a4 range between 268435456 preceding and 268435456 following)
  from ipaddrs
 where a4 is not null;
       a4        |                          array_agg                          
-----------------+-------------------------------------------------------------
 12.174.29.15    | {12.174.29.15}
 33.8.16.211     | {33.8.16.211}
 55.224.125.146  | {55.224.125.146}
 73.239.169.71   | {73.239.169.71,76.178.38.194}
 76.178.38.194   | {73.239.169.71,76.178.38.194}
 96.76.124.246   | {96.76.124.246,104.175.11.72}
 104.175.11.72   | {96.76.124.246,104.175.11.72}
 163.145.90.183  | {163.145.90.183}
 189.85.58.60    | {189.85.58.60,195.58.214.186,203.156.110.93}
 195.58.214.186  | {189.85.58.60,195.58.214.186,203.156.110.93}
 203.156.110.93  | {189.85.58.60,195.58.214.186,203.156.110.93}
 223.213.219.214 | {223.213.219.214,235.64.97.205}
 235.64.97.205   | {223.213.219.214,235.64.97.205,240.116.30.226}
 240.116.30.226  | {235.64.97.205,240.116.30.226,254.251.8.237,255.226.130.53}
 254.251.8.237   | {240.116.30.226,254.251.8.237,255.226.130.53}
 255.226.130.53  | {240.116.30.226,254.251.8.237,255.226.130.53}
(16 rows)

select a4,
       array_agg(a4) over (order by a4 range between ip4 '16.0.0.0' preceding and ip4 '16.0.0.0' following)
  from ipaddrs
 where a4 is not null;
       a4        |                          array_agg                          
-----------------+-------------------------------------------------------------
 12.174.29.15    | {12.174.29.15}
 33.8.16.211     | {33.8.16.211}
 55.224.125.146  | {55.224.125.146}
 73.239.169.71   | {73.239.169.71,76.178.38.194}
 76.178.38.194   | {73.239.169.71,76.178.38.194}
 96.76.124.246   | {96.76.124.246,104.175.11.72}
 104.175.11.72   | {96.76.124.246,104.175.11.72}
 163.145.90.183  | {163.145.90.183}
 189.85.58.60    | {189.85.58.60,195.58.214.186,203.156.110.93}
 195.58.214.186  | {189.85.58.60,195.58.214.186,203.156.110.93}
 203.156.110.93  | {189.85.58.60,195.58.214.186,203.156.110.93}
 223.213.219.214 | {223.213.219.214,235.64.97.205}
 235.64.97.205   | {223.213.219.214,235.64.97.205,240.116.30.226}
 240.116.30.226  | {235.64.97.205,240.116.30.226,254.251.8.237,255.226.130.53}
 254.251.8.237   | {240.116.30.226,254.251.8.237,255.226.130.53}
 255.226.130.53  | {240.116.30.226,254.251.8.237,255.226.130.53}
(16 rows)

select a4,
       array_agg(a4) over (order by a4 range between -3 preceding and -3 following)
  from ipaddrs
 where a4 is not null;
       a4        |                          array_agg                          
-----------------+-------------------------------------------------------------
 12.174.29.15    | {12.174.29.15}
 33.8.16.211     | {33.8.16.211,55.224.125.146}
 55.224.125.146  | {33.8.16.211,55.224.125.146}
 73.239.169.71   | {73.239.169.71,76.178.38.194}
 76.178.38.194   | {73.239.169.71,76.178.38.194}
 96.76.124.246   | {96.76.124.246,104.175.11.72}
 104.175.11.72   | {96.76.124.246,104.175.11.72}
 163.145.90.183  | {163.145.90.183,189.85.58.60}
 189.85.58.60    | {163.145.90.183,189.85.58.60}
 195.58.214.186  | {195.58.214.186,203.156.110.93,223.213.219.214}
 203.156.110.93  | {195.58.214.186,203.156.110.93,223.213.219.214}
 223.213.219.214 | {195.58.214.186,203.156.110.93,223.213.219.214}
 235.64.97.205   | {235.64.97.205,240.116.30.226,254.251.8.237,255.226.130.53}
 240.116.30.226  | {235.64.97.205,240.116.30.226,254.251.8.237,255.226.130.53}
 254.251.8.237   | {235.64.97.205,240.116.30.226,254.251.8.237,255.226.130.53}
 255.226.130.53  | {235.64.97.205,240.116.30.226,254.251.8.237,255.226.130.53}
(16 rows)

select a6,
       array_agg(a6) over (order by a6 range between -10 preceding and -10 following)
  from ipaddrs
 where a6 is not null;
                   a6                    |                                                        array_agg                                                         
-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------
 73:3c34:57a:2a84:b1df:81b0:eb40:61cd    | {73:3c34:57a:2a84:b1df:81b0:eb40:61cd}
 b6:8ebc:c326:48a6:5615:a65e:e87a:25d7   | {b6:8ebc:c326:48a6:5615:a65e:e87a:25d7}
 166:b8ea:1fc5:8913:17ea:d6a0:ac2b:90e1  | {166:b8ea:1fc5:8913:17ea:d6a0:ac2b:90e1}
 227:b768:d43b:773d:6168:5133:867c:13f2  | {227:b768:d43b:773d:6168:5133:867c:13f2}
 453:2d:fbd3:191:95c6:3751:eb62:e90      | {453:2d:fbd3:191:95c6:3751:eb62:e90}
 4a6:7a28:b05b:f9b4:cc5b:9c4c:eefe:3e06  | {4a6:7a28:b05b:f9b4:cc5b:9c4c:eefe:3e06}
 550:fe90:bd02:a3ed:35a2:3254:e280:cd20  | {550:fe90:bd02:a3ed:35a2:3254:e280:cd20}
 75d:e701:5702:6087:a69a:1a2d:376e:4eb   | {75d:e701:5702:6087:a69a:1a2d:376e:4eb}
 7e1:a608:dadd:684d:679e:698b:4db:c8c2   | {7e1:a608:dadd:684d:679e:698b:4db:c8c2}
 9ec:8fec:9a0e:3f2a:66e2:9b5c:498a:1090  | {9ec:8fec:9a0e:3f2a:66e2:9b5c:498a:1090}
 a4b:4e55:7510:69b9:ba73:6550:eaa7:f16e  | {a4b:4e55:7510:69b9:ba73:6550:eaa7:f16e}
 bdb:15d3:fbaf:4bf6:194e:4d0d:4cb2:26c2  | {bdb:15d3:fbaf:4bf6:194e:4d0d:4cb2:26c2}
 cc6:3030:8e26:ed4a:ae48:4496:63c3:94d0  | {cc6:3030:8e26:ed4a:ae48:4496:63c3:94d0,ce0:f080:aff1:6780:4951:55a7:4c23:f108}
 ce0:f080:aff1:6780:4951:55a7:4c23:f108  | {cc6:3030:8e26:ed4a:ae48:4496:63c3:94d0,ce0:f080:aff1:6780:4951:55a7:4c23:f108}
 d6b:f94a:4040:ba81:2347:d486:ac79:96f7  | {d6b:f94a:4040:ba81:2347:d486:ac79:96f7}
 d9a:933a:3c47:801a:51d4:5a48:13bb:f59b  | {d9a:933a:3c47:801a:51d4:5a48:13bb:f59b}
 ded:898a:e003:6046:72e6:5584:1012:62cc  | {ded:898a:e003:6046:72e6:5584:1012:62cc}
 f47:6def:21e4:4620:3bc:9abc:8abd:aba2   | {f47:6def:21e4:4620:3bc:9abc:8abd:aba2}
 1009:d4ec:fe15:7946:eff2:6827:349e:6f0c | {1009:d4ec:fe15:7946:eff2:6827:349e:6f0c}
 10a5:994f:884d:9f98:4920:408d:1504:561d | {10a5:994f:884d:9f98:4920:408d:1504:561d}
 1378:f0c0:8ca:c76d:f062:4b7a:2573:5710  | {1378:f0c0:8ca:c76d:f062:4b7a:2573:5710}
 1395:59cf:33f6:988:1cf8:5ef3:3c2f:64dc  | {1395:59cf:33f6:988:1cf8:5ef3:3c2f:64dc}
 13d9:9e39:ff4a:875f:82a0:77bc:1559:cf8d | {13d9:9e39:ff4a:875f:82a0:77bc:1559:cf8d,13fb:9738:a243:f879:730:2b72:783f:75e9}
 13fb:9738:a243:f879:730:2b72:783f:75e9  | {13d9:9e39:ff4a:875f:82a0:77bc:1559:cf8d,13fb:9738:a243:f879:730:2b72:783f:75e9}
 14fd:6de8:95f:fade:a20c:81d3:98da:c560  | {14fd:6de8:95f:fade:a20c:81d3:98da:c560}
 1520:c2bc:8426:2927:9e12:5f90:f4b0:30e6 | {1520:c2bc:8426:2927:9e12:5f90:f4b0:30e6}
 163a:503e:a2d7:c0d8:f5ee:657e:7f23:ea52 | {163a:503e:a2d7:c0d8:f5ee:657e:7f23:ea52}
 1685:dcd3:5113:5d84:2e64:d9e2:a602:aab7 | {1685:dcd3:5113:5d84:2e64:d9e2:a602:aab7}
 1839:8d68:ec5f:a4e7:711d:124e:150b:cddf | {1839:8d68:ec5f:a4e7:711d:124e:150b:cddf}
 1863:bf8e:aef5:1ac4:f85a:6683:8f7c:d191 | {1863:bf8e:aef5:1ac4:f85a:6683:8f7c:d191}
 18e8:f97:72d0:5444:c94:99fe:4a9e:f657   | {18e8:f97:72d0:5444:c94:99fe:4a9e:f657,18eb:378d:f12f:6114:34d2:ce03:e0d8:cffc}
 18eb:378d:f12f:6114:34d2:ce03:e0d8:cffc | {18e8:f97:72d0:5444:c94:99fe:4a9e:f657,18eb:378d:f12f:6114:34d2:ce03:e0d8:cffc}
 1962:ff9f:665f:ba25:d25a:f530:a391:5ab7 | {1962:ff9f:665f:ba25:d25a:f530:a391:5ab7}
 1b96:6d23:348f:a5f2:1869:1cd5:eff5:d09a | {1b96:6d23:348f:a5f2:1869:1cd5:eff5:d09a}
 1bc2:3fea:257c:553e:eb87:d8c7:ef94:4c9  | {1bc2:3fea:257c:553e:eb87:d8c7:ef94:4c9,1be9:3504:b341:17a8:10ec:e646:b0:433}
 1be9:3504:b341:17a8:10ec:e646:b0:433    | {1bc2:3fea:257c:553e:eb87:d8c7:ef94:4c9,1be9:3504:b341:17a8:10ec:e646:b0:433}
 1c3e:17b6:1bfd:77ea:2185:9748:38d:ac80  | {1c3e:17b6:1bfd:77ea:2185:9748:38d:ac80}
 1c90:5c1b:9431:11ea:f6dd:bb7c:c57f:6cc6 | {1c90:5c1b:9431:11ea:f6dd:bb7c:c57f:6cc6}
 1cc5:18d6:116d:d727:86b:9655:f44d:4fb7  | {1cc5:18d6:116d:d727:86b:9655:f44d:4fb7}
 1dbf:c6d8:ce1a:e3e3:c9a2:8458:3674:f6b  | {1dbf:c6d8:ce1a:e3e3:c9a2:8458:3674:f6b}
 1f38:cd00:b368:80e5:7579:df75:3c50:b21b | {1f38:cd00:b368:80e5:7579:df75:3c50:b21b}
 204f:510d:e7e9:9c02:9576:48b1:bfb7:468  | {204f:510d:e7e9:9c02:9576:48b1:bfb7:468}
 21ef:74a4:2571:e430:47b1:a582:9723:9b14 | {21ef:74a4:2571:e430:47b1:a582:9723:9b14}
 2394:74d2:f34d:3801:3a23:f022:dc17:2cf  | {2394:74d2:f34d:3801:3a23:f022:dc17:2cf}
 23fd:5d2:8e6a:628:b4e:3ff2:d386:d2b0    | {23fd:5d2:8e6a:628:b4e:3ff2:d386:d2b0}
 2408:f23d:d1ac:746d:2c8f:3dd6:7ed0:5507 | {2408:f23d:d1ac:746d:2c8f:3dd6:7ed0:5507}
 25d9:67f6:f409:c774:60ad:9d6a:b95b:4ad2 | {25d9:67f6:f409:c774:60ad:9d6a:b95b:4ad2,25f0:72d:e515:bc9b:f9a2:6061:b18b:758e}
 25f0:72d:e515:bc9b:f9a2:6061:b18b:758e  | {25d9:67f6:f409:c774:60ad:9d6a:b95b:4ad2,25f0:72d:e515:bc9b:f9a2:6061:b18b:758e}
 2689:eae5:4101:f97c:628a:58fa:f0b5:159  | {2689:eae5:4101:f97c:628a:58fa:f0b5:159,26a3:7ac5:3ce2:cb2d:994d:8f10:82b6:419d,26ad:4d5b:192c:f85a:71db:38be:c6ca:19de}
 26a3:7ac5:3ce2:cb2d:994d:8f10:82b6:419d | {2689:eae5:4101:f97c:628a:58fa:f0b5:159,26a3:7ac5:3ce2:cb2d:994d:8f10:82b6:419d,26ad:4d5b:192c:f85a:71db:38be:c6ca:19de}
 26ad:4d5b:192c:f85a:71db:38be:c6ca:19de | {2689:eae5:4101:f97c:628a:58fa:f0b5:159,26a3:7ac5:3ce2:cb2d:994d:8f10:82b6:419d,26ad:4d5b:192c:f85a:71db:38be:c6ca:19de}
 28a6:2032:8a38:de85:f6f3:47bd:5124:7dc8 | {28a6:2032:8a38:de85:f6f3:47bd:5124:7dc8}
 28e7:4441:e0a4:bf30:4cf4:edb0:638d:ad72 | {28e7:4441:e0a4:bf30:4cf4:edb0:638d:ad72}
 29a4:a288:457e:57a9:bbb3:2a76:b117:b1e8 | {29a4:a288:457e:57a9:bbb3:2a76:b117:b1e8,29b2:d3c1:26c4:86b6:19b5:14dc:ab2d:bc67}
 29b2:d3c1:26c4:86b6:19b5:14dc:ab2d:bc67 | {29a4:a288:457e:57a9:bbb3:2a76:b117:b1e8,29b2:d3c1:26c4:86b6:19b5:14dc:ab2d:bc67}
 2a8a:5b38:cbdd:5d1c:e1b0:d627:f31f:285a | {2a8a:5b38:cbdd:5d1c:e1b0:d627:f31f:285a}
 2b47:da0e:8c52:cc33:afaa:f85f:f143:88c6 | {2b47:da0e:8c52:cc33:afaa:f85f:f143:88c6}
 2ee9:6428:5482:9721:9e51:ca52:ba3:99eb  | {2ee9:6428:5482:9721:9e51:ca52:ba3:99eb}
 2f48:4d4b:443c:6de6:9cbe:9766:fd5:c88b  | {2f48:4d4b:443c:6de6:9cbe:9766:fd5:c88b}
 2ff2:b6b6:ffd1:dc5f:fc2:defe:fd16:a414  | {2ff2:b6b6:ffd1:dc5f:fc2:defe:fd16:a414}
 3138:9022:3412:4cfb:fc2a:729a:651c:40f9 | {3138:9022:3412:4cfb:fc2a:729a:651c:40f9}
 318f:1162:8f48:3397:cb9a:f54e:f1e8:d05d | {318f:1162:8f48:3397:cb9a:f54e:f1e8:d05d}
 32ca:6639:c07e:c474:fa11:c83:2886:516c  | {32ca:6639:c07e:c474:fa11:c83:2886:516c}
 35f1:eb03:921c:f397:cd41:9201:f7e0:dfad | {35f1:eb03:921c:f397:cd41:9201:f7e0:dfad,35f3:d696:b49e:1a25:375:5e28:15c9:96ce}
 35f3:d696:b49e:1a25:375:5e28:15c9:96ce  | {35f1:eb03:921c:f397:cd41:9201:f7e0:dfad,35f3:d696:b49e:1a25:375:5e28:15c9:96ce}
 3902:4c48:d872:37bd:2e53:678d:3a0a:3cf6 | {3902:4c48:d872:37bd:2e53:678d:3a0a:3cf6,390b:b7a:6606:af43:233b:2e27:8336:5b2e}
 390b:b7a:6606:af43:233b:2e27:8336:5b2e  | {3902:4c48:d872:37bd:2e53:678d:3a0a:3cf6,390b:b7a:6606:af43:233b:2e27:8336:5b2e}
 39ec:d6ba:1f45:64d0:f4d2:3f0f:78e:a404  | {39ec:d6ba:1f45:64d0:f4d2:3f0f:78e:a404}
 3af7:2de9:30a7:818d:9715:3eaf:d8f7:2583 | {3af7:2de9:30a7:818d:9715:3eaf:d8f7:2583}
 3b13:802b:cfd:15ef:bab3:f337:8b00:5744  | {3b13:802b:cfd:15ef:bab3:f337:8b00:5744}
 3bc9:de98:c700:5aa:d993:223e:dad:1949   | {3bc9:de98:c700:5aa:d993:223e:dad:1949}
 4068:6d06:7463:589:3262:86d1:f1f1:f088  | {4068:6d06:7463:589:3262:86d1:f1f1:f088}
 4111:e35f:ce3:c4de:dc4e:8764:8cd:1686   | {4111:e35f:ce3:c4de:dc4e:8764:8cd:1686,4131:d8b6:82af:797d:25fd:7bd4:b94d:ce34}
 4131:d8b6:82af:797d:25fd:7bd4:b94d:ce34 | {4111:e35f:ce3:c4de:dc4e:8764:8cd:1686,4131:d8b6:82af:797d:25fd:7bd4:b94d:ce34}
 42e2:d76f:c784:7a61:67c1:b931:6f49:32c5 | {42e2:d76f:c784:7a61:67c1:b931:6f49:32c5}
 4430:8b98:82c8:3d6c:dbd6:579e:c3fc:ec9d | {4430:8b98:82c8:3d6c:dbd6:579e:c3fc:ec9d,4439:44b6:c04:de6a:c0af:cf35:d9f3:f8ee}
 4439:44b6:c04:de6a:c0af:cf35:d9f3:f8ee  | {4430:8b98:82c8:3d6c:dbd6:579e:c3fc:ec9d,4439:44b6:c04:de6a:c0af:cf35:d9f3:f8ee}
 450b:493b:a4d7:f0d3:6fe4:6da0:b550:f4ca | {450b:493b:a4d7:f0d3:6fe4:6da0:b550:f4ca}
 454c:20ee:35b9:b48b:a59f:e4bc:7b76:f228 | {454c:20ee:35b9:b48b:a59f:e4bc:7b76:f228,454e:bfa0:ed21:4983:7572:22c9:413d:d4db}
 454e:bfa0:ed21:4983:7572:22c9:413d:d4db | {454c:20ee:35b9:b48b:a59f:e4bc:7b76:f228,454e:bfa0:ed21:4983:7572:22c9:413d:d4db}
 4620:c642:9985:6a1f:6c66:50c0:2108:10d3 | {4620:c642:9985:6a1f:6c66:50c0:2108:10d3}
 4647:353:5292:8bef:e5b5:c13a:1176:deef  | {4647:353:5292:8bef:e5b5:c13a:1176:deef}
 4bd6:2076:745e:acbe:c511:3786:60be:b51d | {4bd6:2076:745e:acbe:c511:3786:60be:b51d}
 4d6a:edd6:a446:6d89:e2a3:ab27:79ec:e148 | {4d6a:edd6:a446:6d89:e2a3:ab27:79ec:e148}
 4ee3:bfaa:5f22:2c05:573e:e87c:a6c2:81e0 | {4ee3:bfaa:5f22:2c05:573e:e87c:a6c2:81e0}
 53ad:31ab:bc5e:c535:bc7c:5762:c11e:fcec | {53ad:31ab:bc5e:c535:bc7c:5762:c11e:fcec}
 53d6:7f94:6b26:59cb:9c16:2aa:9722:b8ef  | {53d6:7f94:6b26:59cb:9c16:2aa:9722:b8ef}
 5412:a54d:dbd8:8448:4728:5fb0:ec6f:4381 | {5412:a54d:dbd8:8448:4728:5fb0:ec6f:4381}
 5466:93e3:8343:3686:394:778:79ac:772    | {5466:93e3:8343:3686:394:778:79ac:772}
 54b6:4a85:c1a5:89b0:b7ff:5306:32be:d30f | {54b6:4a85:c1a5:89b0:b7ff:5306:32be:d30f}
 5637:5e57:c050:53fe:e182:697:ab46:21cc  | {5637:5e57:c050:53fe:e182:697:ab46:21cc}
 56fd:83db:3ff7:b0b:7d5:8378:a486:f20    | {56fd:83db:3ff7:b0b:7d5:8378:a486:f20}
 5721:3c79:a6ff:c8d8:5e3:c785:808:e40    | {5721:3c79:a6ff:c8d8:5e3:c785:808:e40}
 5889:8398:cb90:8df:b3d6:3f5c:72cb:cd64  | {5889:8398:cb90:8df:b3d6:3f5c:72cb:cd64}
 599b:9e01:9a22:aebf:a731:ce57:fefb:8ed  | {599b:9e01:9a22:aebf:a731:ce57:fefb:8ed}
 5a0b:33a9:3407:aa9c:f1c7:a538:2f25:bf14 | {5a0b:33a9:3407:aa9c:f1c7:a538:2f25:bf14,5a3f:b436:785f:32a4:8c86:13f8:e682:8b6a}
 5a3f:b436:785f:32a4:8c86:13f8:e682:8b6a | {5a0b:33a9:3407:aa9c:f1c7:a538:2f25:bf14,5a3f:b436:785f:32a4:8c86:13f8:e682:8b6a}
 5d63:9613:7b87:5c26:5c80:bbd3:14b5:1e63 | {5d63:9613:7b87:5c26:5c80:bbd3:14b5:1e63}
 5e52:9aa9:8f83:2a67:5959:720d:f6ba:5d42 | {5e52:9aa9:8f83:2a67:5959:720d:f6ba:5d42}
 5ee2:4fab:1073:b2f5:61c1:eea6:302f:685  | {5ee2:4fab:1073:b2f5:61c1:eea6:302f:685}
 5fa8:25bb:15e8:5b35:758c:2044:d194:1962 | {5fa8:25bb:15e8:5b35:758c:2044:d194:1962}
 61f2:afe0:d1af:18e9:5d40:7a4d:f112:2d09 | {61f2:afe0:d1af:18e9:5d40:7a4d:f112:2d09}
 6251:ab4b:3b37:d71f:6b5f:1b2d:bd55:3a3c | {6251:ab4b:3b37:d71f:6b5f:1b2d:bd55:3a3c}
 62b8:256d:637a:82bf:3b69:420:eea5:300b  | {62b8:256d:637a:82bf:3b69:420:eea5:300b}
 62db:eab9:a54e:3cea:46f3:b7c2:cb9c:6e5d | {62db:eab9:a54e:3cea:46f3:b7c2:cb9c:6e5d}
 6656:e87d:865c:3237:8d42:ff01:a82b:f308 | {6656:e87d:865c:3237:8d42:ff01:a82b:f308}
 6a93:ccd3:5002:233f:1c5f:400e:601c:75a  | {6a93:ccd3:5002:233f:1c5f:400e:601c:75a}
 6b0c:4791:ccea:c286:437e:d268:87ef:b6ad | {6b0c:4791:ccea:c286:437e:d268:87ef:b6ad}
 6e1b:5e9c:f623:6134:7754:fdac:323a:dba2 | {6e1b:5e9c:f623:6134:7754:fdac:323a:dba2}
 6e81:4a6a:d383:140d:8416:c09b:af3b:5b45 | {6e81:4a6a:d383:140d:8416:c09b:af3b:5b45,6e9d:66e:27c5:c7c4:aefe:ecfc:6568:ccf}
 6e9d:66e:27c5:c7c4:aefe:ecfc:6568:ccf   | {6e81:4a6a:d383:140d:8416:c09b:af3b:5b45,6e9d:66e:27c5:c7c4:aefe:ecfc:6568:ccf}
 6ff2:94f5:5755:164d:1301:28ce:8a04:eac0 | {6ff2:94f5:5755:164d:1301:28ce:8a04:eac0}
 72c4:104f:960c:baf1:8ef7:60d2:c58:8b03  | {72c4:104f:960c:baf1:8ef7:60d2:c58:8b03}
 7341:d21f:e576:f226:f690:a99c:6b55:9933 | {7341:d21f:e576:f226:f690:a99c:6b55:9933}
 739b:8093:31c6:a42f:a604:d5cb:1350:2d2f | {739b:8093:31c6:a42f:a604:d5cb:1350:2d2f}
 7524:1f76:fe52:991e:667b:a302:dfd5:dbd6 | {7524:1f76:fe52:991e:667b:a302:dfd5:dbd6}
 7608:50bf:a29a:6805:c760:9ae3:1216:8e4a | {7608:50bf:a29a:6805:c760:9ae3:1216:8e4a}
 78c8:1cde:4b95:55d8:b211:a95d:37e0:7d92 | {78c8:1cde:4b95:55d8:b211:a95d:37e0:7d92}
 7924:9e5b:2c7:3920:9c9f:bfb6:369d:fa4f  | {7924:9e5b:2c7:3920:9c9f:bfb6:369d:fa4f}
 798f:ea8:61f6:5d79:1656:d8d8:9b6e:57f0  | {798f:ea8:61f6:5d79:1656:d8d8:9b6e:57f0}
 79c9:d301:92cd:c774:abbb:2f7d:92c3:3ccd | {79c9:d301:92cd:c774:abbb:2f7d:92c3:3ccd,79eb:6133:5173:8f43:87d4:cb1d:906b:e8c9}
 79eb:6133:5173:8f43:87d4:cb1d:906b:e8c9 | {79c9:d301:92cd:c774:abbb:2f7d:92c3:3ccd,79eb:6133:5173:8f43:87d4:cb1d:906b:e8c9}
 7cba:a835:f850:6409:dba7:1300:f2b8:1db3 | {7cba:a835:f850:6409:dba7:1300:f2b8:1db3}
 7cdf:1ed8:690e:9e54:6f39:613e:f187:8ef2 | {7cdf:1ed8:690e:9e54:6f39:613e:f187:8ef2}
 7dcc:877b:8e07:aeb4:d891:581e:c10c:af54 | {7dcc:877b:8e07:aeb4:d891:581e:c10c:af54}
 7e1f:eb76:49c9:39f8:deb9:c447:b40c:a13d | {7e1f:eb76:49c9:39f8:deb9:c447:b40c:a13d}
 7ec8:2b00:5994:7f0f:d765:5e16:c274:5645 | {7ec8:2b00:5994:7f0f:d765:5e16:c274:5645}
 7f3d:d8ea:7a7c:8700:5b81:412f:c33a:d6ba | {7f3d:d8ea:7a7c:8700:5b81:412f:c33a:d6ba}
 7fa2:dbdb:e889:e24b:4d30:962e:89f3:676f | {7fa2:dbdb:e889:e24b:4d30:962e:89f3:676f}
 8119:1220:b888:3d8a:1250:ce77:b2b9:bdcd | {8119:1220:b888:3d8a:1250:ce77:b2b9:bdcd,8129:3e9c:70ff:1df1:f26f:86aa:c7ba:8245}
 8129:3e9c:70ff:1df1:f26f:86aa:c7ba:8245 | {8119:1220:b888:3d8a:1250:ce77:b2b9:bdcd,8129:3e9c:70ff:1df1:f26f:86aa:c7ba:8245}
 8172:4609:d700:5bd2:24a2:8f78:f1cc:c1a0 | {8172:4609:d700:5bd2:24a2:8f78:f1cc:c1a0}
 8241:abe3:7537:de41:ef5a:7d2a:9e57:833b | {8241:abe3:7537:de41:ef5a:7d2a:9e57:833b}
 828e:fa1d:9bb1:ad4c:4874:9da8:40bf:25b5 | {828e:fa1d:9bb1:ad4c:4874:9da8:40bf:25b5,8298:9399:271f:a3fe:270c:21cf:7c34:7340}
 8298:9399:271f:a3fe:270c:21cf:7c34:7340 | {828e:fa1d:9bb1:ad4c:4874:9da8:40bf:25b5,8298:9399:271f:a3fe:270c:21cf:7c34:7340}
 82ed:ac69:4ea7:5301:b005:3e17:f541:4fbc | {82ed:ac69:4ea7:5301:b005:3e17:f541:4fbc}
 8357:a24:2f6e:f909:3853:899a:68af:b48   | {8357:a24:2f6e:f909:3853:899a:68af:b48}
 8474:e00a:5b49:6e2a:5074:ecd5:cece:7dad | {8474:e00a:5b49:6e2a:5074:ecd5:cece:7dad}
 84fe:7351:7b39:349e:1bb7:e333:daec:141a | {84fe:7351:7b39:349e:1bb7:e333:daec:141a}
 8586:595:7bdd:359b:2fd9:1ffa:49ef:a947  | {8586:595:7bdd:359b:2fd9:1ffa:49ef:a947}
 86fa:3a3:6a26:5ce3:fd8d:6267:b3c:4bf0   | {86fa:3a3:6a26:5ce3:fd8d:6267:b3c:4bf0}
 874b:a74e:e292:c13:cf80:778c:35b4:d37c  | {874b:a74e:e292:c13:cf80:778c:35b4:d37c}
 88bb:cf40:1f19:c897:f001:2d56:8f4f:ac68 | {88bb:cf40:1f19:c897:f001:2d56:8f4f:ac68}
 8909:5e3:cff9:483c:1fb7:2ee2:ab05:222a  | {8909:5e3:cff9:483c:1fb7:2ee2:ab05:222a,890b:aa44:e2b1:ff61:eb7a:c4df:5a25:2eaf}
 890b:aa44:e2b1:ff61:eb7a:c4df:5a25:2eaf | {8909:5e3:cff9:483c:1fb7:2ee2:ab05:222a,890b:aa44:e2b1:ff61:eb7a:c4df:5a25:2eaf}
 8a1f:674e:63cd:f241:8f53:aec9:d8db:8e5c | {8a1f:674e:63cd:f241:8f53:aec9:d8db:8e5c}
 8b0c:b103:3302:90bb:bac:809e:9c7d:3569  | {8b0c:b103:3302:90bb:bac:809e:9c7d:3569}
 8b61:6b31:d02c:87d3:22cf:f01c:c045:b822 | {8b61:6b31:d02c:87d3:22cf:f01c:c045:b822}
 8b87:864a:8e83:6783:c552:cb07:8e96:c0e5 | {8b87:864a:8e83:6783:c552:cb07:8e96:c0e5}
 8c86:2c19:c38d:626b:b5a4:e0cb:bbaf:476b | {8c86:2c19:c38d:626b:b5a4:e0cb:bbaf:476b}
 8ec2:3493:ad95:cb7e:ae1c:8c2c:6a34:eccb | {8ec2:3493:ad95:cb7e:ae1c:8c2c:6a34:eccb,8ecc:14db:7aba:bbde:f2a7:c4bc:7a1e:c8c1}
 8ecc:14db:7aba:bbde:f2a7:c4bc:7a1e:c8c1 | {8ec2:3493:ad95:cb7e:ae1c:8c2c:6a34:eccb,8ecc:14db:7aba:bbde:f2a7:c4bc:7a1e:c8c1}
 8f7a:5e8b:f526:a8ba:8c6f:3cae:7b7e:1a5  | {8f7a:5e8b:f526:a8ba:8c6f:3cae:7b7e:1a5}
 8fa1:e604:6ad4:c318:ba8f:eaec:76be:ad4b | {8fa1:e604:6ad4:c318:ba8f:eaec:76be:ad4b,8fac:3b7e:463d:1b38:2f59:6fdf:3bef:4aaf}
 8fac:3b7e:463d:1b38:2f59:6fdf:3bef:4aaf | {8fa1:e604:6ad4:c318:ba8f:eaec:76be:ad4b,8fac:3b7e:463d:1b38:2f59:6fdf:3bef:4aaf}
 933f:d5b:d307:c3e0:5e0:b947:1cb5:6928   | {933f:d5b:d307:c3e0:5e0:b947:1cb5:6928}
 9520:88f9:9498:8a73:ac7a:dc77:4495:3dfc | {9520:88f9:9498:8a73:ac7a:dc77:4495:3dfc}
 9631:3557:7591:6ade:1882:6dad:8413:c3b3 | {9631:3557:7591:6ade:1882:6dad:8413:c3b3}
 977b:de6f:3ef9:3cad:fb02:fb07:458c:e88e | {977b:de6f:3ef9:3cad:fb02:fb07:458c:e88e}
 982a:e6d8:49bc:49a7:80b:4417:45f7:4fb7  | {982a:e6d8:49bc:49a7:80b:4417:45f7:4fb7}
 9943:4095:cf6c:bf1d:f1b4:7883:f929:a315 | {9943:4095:cf6c:bf1d:f1b4:7883:f929:a315}
 99b7:bba0:206c:6042:6778:2f3b:9a:6393   | {99b7:bba0:206c:6042:6778:2f3b:9a:6393}
 9b3d:56d7:b18e:21b9:7448:3cea:2ec:77f8  | {9b3d:56d7:b18e:21b9:7448:3cea:2ec:77f8}
 9c51:8c1b:a051:a87e:c65a:cc8:a38e:4953  | {9c51:8c1b:a051:a87e:c65a:cc8:a38e:4953}
 9d35:9c4f:517d:2391:f59c:af03:1681:6d9b | {9d35:9c4f:517d:2391:f59c:af03:1681:6d9b}
 9da1:e3ce:660a:cde4:7576:554:55cc:38ad  | {9da1:e3ce:660a:cde4:7576:554:55cc:38ad}
 9ee9:65bd:81d2:b2c6:c3c4:b36b:16a2:fc9e | {9ee9:65bd:81d2:b2c6:c3c4:b36b:16a2:fc9e}
 a0d3:f0b5:7a50:2d3e:923e:3832:76c0:b15d | {a0d3:f0b5:7a50:2d3e:923e:3832:76c0:b15d}
 a252:248:a123:3287:680f:a67c:2fcd:b2a0  | {a252:248:a123:3287:680f:a67c:2fcd:b2a0}
 a300:d184:bf44:e8f1:4a80:723c:909:f178  | {a300:d184:bf44:e8f1:4a80:723c:909:f178,a335:f1a7:be5c:b341:5325:e8d3:2631:74ae}
 a335:f1a7:be5c:b341:5325:e8d3:2631:74ae | {a300:d184:bf44:e8f1:4a80:723c:909:f178,a335:f1a7:be5c:b341:5325:e8d3:2631:74ae}
 a42d:662e:1816:1fe3:a392:9190:7d4e:f418 | {a42d:662e:1816:1fe3:a392:9190:7d4e:f418}
 a52f:f73a:413e:a43a:5000:cd8f:ef1f:3603 | {a52f:f73a:413e:a43a:5000:cd8f:ef1f:3603}
 a75b:c708:8e74:b252:f8e8:7269:c214:dc07 | {a75b:c708:8e74:b252:f8e8:7269:c214:dc07}
 a87b:8920:6e0:9c1b:92a8:3a1e:f074:1ee2  | {a87b:8920:6e0:9c1b:92a8:3a1e:f074:1ee2}
 a884:9796:ca7c:ec37:9cb4:4158:ce4c:ced5 | {a884:9796:ca7c:ec37:9cb4:4158:ce4c:ced5}
 a9e9:74a5:864a:dfeb:a5f0:4424:d294:95a1 | {a9e9:74a5:864a:dfeb:a5f0:4424:d294:95a1}
 ac4c:23a6:9c5f:8a2a:ccfc:ea69:48cd:dffc | {ac4c:23a6:9c5f:8a2a:ccfc:ea69:48cd:dffc,ac71:fd2c:4352:c28a:2f4b:3cd1:4d6f:927b}
 ac71:fd2c:4352:c28a:2f4b:3cd1:4d6f:927b | {ac4c:23a6:9c5f:8a2a:ccfc:ea69:48cd:dffc,ac71:fd2c:4352:c28a:2f4b:3cd1:4d6f:927b}
 ad73:992f:b3d8:31f7:306d:a418:fdcf:3e60 | {ad73:992f:b3d8:31f7:306d:a418:fdcf:3e60}
 ae64:d6a3:11d7:b6bc:aa3:60c6:b16f:4305  | {ae64:d6a3:11d7:b6bc:aa3:60c6:b16f:4305}
 af5a:6507:2c50:f0a8:b211:fc0d:425e:bd47 | {af5a:6507:2c50:f0a8:b211:fc0d:425e:bd47}
 afeb:a771:735e:1a18:9297:e9f4:2e53:c5e1 | {afeb:a771:735e:1a18:9297:e9f4:2e53:c5e1}
 b105:5518:a963:9a0a:d10d:b42b:dfd1:96a2 | {b105:5518:a963:9a0a:d10d:b42b:dfd1:96a2,b113:66f:e222:f032:7161:1f27:b080:2111}
 b113:66f:e222:f032:7161:1f27:b080:2111  | {b105:5518:a963:9a0a:d10d:b42b:dfd1:96a2,b113:66f:e222:f032:7161:1f27:b080:2111}
 b218:c6f2:4929:7d70:8b4d:5458:fc85:d0fc | {b218:c6f2:4929:7d70:8b4d:5458:fc85:d0fc,b237:dac3:62d7:725e:d772:c88c:af71:cec5}
 b237:dac3:62d7:725e:d772:c88c:af71:cec5 | {b218:c6f2:4929:7d70:8b4d:5458:fc85:d0fc,b237:dac3:62d7:725e:d772:c88c:af71:cec5}
 b310:3d72:ea86:6ee:45fc:d57f:4a7a:bb43  | {b310:3d72:ea86:6ee:45fc:d57f:4a7a:bb43}
 b3da:187b:cc2e:3c78:e060:aab6:63cb:1780 | {b3da:187b:cc2e:3c78:e060:aab6:63cb:1780}
 b408:9874:22a3:9f56:35f:cfd1:b00:ddac   | {b408:9874:22a3:9f56:35f:cfd1:b00:ddac}
 b48c:eccb:32f4:2b4:e2ee:e787:a16f:8647  | {b48c:eccb:32f4:2b4:e2ee:e787:a16f:8647}
 b8ef:17e2:febe:431d:9d8c:88c6:6604:a678 | {b8ef:17e2:febe:431d:9d8c:88c6:6604:a678}
 ba0d:d2d4:b5e3:573f:98f4:98e:aac1:47fa  | {ba0d:d2d4:b5e3:573f:98f4:98e:aac1:47fa}
 baf9:2948:a8a1:8865:912a:839f:45e8:78d3 | {baf9:2948:a8a1:8865:912a:839f:45e8:78d3}
 bb1b:6a20:8513:14e4:5fc6:c0e9:17df:9c0  | {bb1b:6a20:8513:14e4:5fc6:c0e9:17df:9c0}
 bc1d:d3ba:50da:14d3:f496:6847:3b91:2830 | {bc1d:d3ba:50da:14d3:f496:6847:3b91:2830}
 bc52:8171:9377:d593:1c0a:75e4:e2d:5e1a  | {bc52:8171:9377:d593:1c0a:75e4:e2d:5e1a}
 bd6f:44b9:45d3:529f:84c7:612:b25c:aaf8  | {bd6f:44b9:45d3:529f:84c7:612:b25c:aaf8}
 bdc5:94f5:8249:7120:8132:ca25:d3fc:c394 | {bdc5:94f5:8249:7120:8132:ca25:d3fc:c394}
 c0fc:f3ee:3707:19dc:62c1:5c9a:df3d:1b58 | {c0fc:f3ee:3707:19dc:62c1:5c9a:df3d:1b58}
 c2e3:4cea:30dd:cb39:c5a0:86e7:8b05:3f7  | {c2e3:4cea:30dd:cb39:c5a0:86e7:8b05:3f7}
 c36f:f4fd:4853:a07c:c25d:349f:3af4:3432 | {c36f:f4fd:4853:a07c:c25d:349f:3af4:3432}
 c504:481e:2756:3ca2:f0c:a26a:4e64:7804  | {c504:481e:2756:3ca2:f0c:a26a:4e64:7804}
 c6ff:8d3c:d2d1:ee46:65ca:27f9:cc07:8e6d | {c6ff:8d3c:d2d1:ee46:65ca:27f9:cc07:8e6d}
 c8c0:5117:331a:f029:8d24:6775:fe7d:5976 | {c8c0:5117:331a:f029:8d24:6775:fe7d:5976}
 c963:10d0:1586:d1d4:79bc:d7af:5486:43e5 | {c963:10d0:1586:d1d4:79bc:d7af:5486:43e5}
 c99c:bd43:6161:d17d:2fdd:ab61:922:ba62  | {c99c:bd43:6161:d17d:2fdd:ab61:922:ba62}
 cb2f:b8da:ba34:1c5c:4839:710a:f75b:bdd0 | {cb2f:b8da:ba34:1c5c:4839:710a:f75b:bdd0}
 cb70:a0cc:6919:db7f:8fc8:cb69:6fcc:5f5b | {cb70:a0cc:6919:db7f:8fc8:cb69:6fcc:5f5b}
 cc17:3814:d80f:41a1:1309:35d3:ea0a:d31e | {cc17:3814:d80f:41a1:1309:35d3:ea0a:d31e}
 ce47:e5eb:41f3:23af:6209:5ade:82ce:3b00 | {ce47:e5eb:41f3:23af:6209:5ade:82ce:3b00}
 cfb9:d37e:2427:af8d:b728:8f90:f54c:9141 | {cfb9:d37e:2427:af8d:b728:8f90:f54c:9141}
 d066:f25b:e8a5:4ae6:4c99:2a98:8cb7:2530 | {d066:f25b:e8a5:4ae6:4c99:2a98:8cb7:2530}
 d105:1597:c912:51c7:e5b6:f628:cae:1d0f  | {d105:1597:c912:51c7:e5b6:f628:cae:1d0f}
 d2de:7aa1:975:e510:dfa1:2a3:89bc:eedb   | {d2de:7aa1:975:e510:dfa1:2a3:89bc:eedb}
 d33e:e847:b4c6:d5ca:f75:216b:342c:3d04  | {d33e:e847:b4c6:d5ca:f75:216b:342c:3d04}
 d395:c008:43a4:48d9:15a7:ce74:6546:c56b | {d395:c008:43a4:48d9:15a7:ce74:6546:c56b}
 d452:6fb9:f2b0:d387:80ca:47d5:330f:577  | {d452:6fb9:f2b0:d387:80ca:47d5:330f:577}
 d524:77db:2a21:e05b:68c4:575c:f04b:b0b7 | {d524:77db:2a21:e05b:68c4:575c:f04b:b0b7}
 d6d1:e96c:cd2f:8396:23f2:c96d:9376:54cb | {d6d1:e96c:cd2f:8396:23f2:c96d:9376:54cb}
 d76b:986d:d38b:252a:e6a2:254e:b0f7:db24 | {d76b:986d:d38b:252a:e6a2:254e:b0f7:db24}
 d9f3:2018:6aa2:7ee4:64be:e2d:c32c:2d15  | {d9f3:2018:6aa2:7ee4:64be:e2d:c32c:2d15}
 da3e:c57c:ccc8:edbf:f66e:85a5:e252:a3a4 | {da3e:c57c:ccc8:edbf:f66e:85a5:e252:a3a4}
 da52:3791:27b8:f773:7a59:1414:6d76:bd8a | {da52:3791:27b8:f773:7a59:1414:6d76:bd8a}
 da97:ecc5:bf17:1bb2:5710:f753:604c:7cf6 | {da97:ecc5:bf17:1bb2:5710:f753:604c:7cf6}
 dc61:8bf4:4b82:90a4:8af0:6a43:a917:14ee | {dc61:8bf4:4b82:90a4:8af0:6a43:a917:14ee}
 dd3b:ad95:1e55:a555:daae:8218:99d7:7bce | {dd3b:ad95:1e55:a555:daae:8218:99d7:7bce}
 defd:c729:62b4:8959:6ad1:7b1f:5835:8ffb | {defd:c729:62b4:8959:6ad1:7b1f:5835:8ffb}
 dfe2:c097:49ae:1d60:e3db:26c1:bb5d:c4e0 | {dfe2:c097:49ae:1d60:e3db:26c1:bb5d:c4e0}
 e11c:4f21:dd57:c814:af4e:3f55:4adf:f1a0 | {e11c:4f21:dd57:c814:af4e:3f55:4adf:f1a0}
 e199:2ea0:f3b4:3a31:5d15:dfc9:68cd:c948 | {e199:2ea0:f3b4:3a31:5d15:dfc9:68cd:c948}
 e57b:76e8:3f3a:3020:a22a:38b7:9c02:5db4 | {e57b:76e8:3f3a:3020:a22a:38b7:9c02:5db4}
 e6da:dc3c:a935:a718:4744:a216:84bd:cfa9 | {e6da:dc3c:a935:a718:4744:a216:84bd:cfa9}
 e7a7:adbe:d6de:41ba:a34f:d10b:46a7:a4cf | {e7a7:adbe:d6de:41ba:a34f:d10b:46a7:a4cf}
 e86d:edb4:8702:1774:c97d:cbee:394:a083  | {e86d:edb4:8702:1774:c97d:cbee:394:a083}
 e97f:c466:f346:cf67:23e4:bd36:72be:af44 | {e97f:c466:f346:cf67:23e4:bd36:72be:af44}
 ec36:7c6d:3077:267e:399a:d47:55a4:218a  | {ec36:7c6d:3077:267e:399a:d47:55a4:218a}
 ee1d:a078:25d4:94e3:9a89:707d:6fae:7573 | {ee1d:a078:25d4:94e3:9a89:707d:6fae:7573,ee34:9ba:9281:593c:ab74:57fa:e439:e0f3}
 ee34:9ba:9281:593c:ab74:57fa:e439:e0f3  | {ee1d:a078:25d4:94e3:9a89:707d:6fae:7573,ee34:9ba:9281:593c:ab74:57fa:e439:e0f3}
 ee76:e9ac:dd2:66c1:380:5f1e:1c4d:2867   | {ee76:e9ac:dd2:66c1:380:5f1e:1c4d:2867}
 eea0:9aef:71b:3cfd:e2ad:864c:41b8:938c  | {eea0:9aef:71b:3cfd:e2ad:864c:41b8:938c}
 ef15:3aa9:3c5b:b993:5209:a130:2d37:3a64 | {ef15:3aa9:3c5b:b993:5209:a130:2d37:3a64}
 ef9a:b980:e9:d50a:d867:8a88:2cae:8aa1   | {ef9a:b980:e9:d50a:d867:8a88:2cae:8aa1}
 effb:1a90:1dd5:e52c:1d7f:c716:3744:170a | {effb:1a90:1dd5:e52c:1d7f:c716:3744:170a}
 f0a1:e730:68b9:2e1c:649a:5450:a256:4665 | {f0a1:e730:68b9:2e1c:649a:5450:a256:4665}
 f3df:f155:d5c6:d664:c93c:13fa:9d77:6bf2 | {f3df:f155:d5c6:d664:c93c:13fa:9d77:6bf2}
 f499:668f:fbb8:f0dc:8e41:d43b:c025:26a  | {f499:668f:fbb8:f0dc:8e41:d43b:c025:26a}
 f57a:a3dc:3b11:f28a:8b25:8d5b:ec2f:c729 | {f57a:a3dc:3b11:f28a:8b25:8d5b:ec2f:c729}
 f7b8:dfc:496c:9718:ae3c:5c3e:b98a:4c5f  | {f7b8:dfc:496c:9718:ae3c:5c3e:b98a:4c5f}
 fa78:68ce:4fb1:d54c:2007:1820:ffe2:8235 | {fa78:68ce:4fb1:d54c:2007:1820:ffe2:8235}
 fbb6:2d70:42eb:55ab:6235:6867:2b3:8d47  | {fbb6:2d70:42eb:55ab:6235:6867:2b3:8d47}
 fcea:f739:a97d:cefc:49c4:b3c3:c7b4:99d6 | {fcea:f739:a97d:cefc:49c4:b3c3:c7b4:99d6}
 fda3:3e75:37c5:c1f:912b:5e32:6aa9:aeb2  | {fda3:3e75:37c5:c1f:912b:5e32:6aa9:aeb2}
 ff3d:7d5b:b0fe:c30:9e6c:23e0:7b5:e9de   | {ff3d:7d5b:b0fe:c30:9e6c:23e0:7b5:e9de}
 ff4a:cbbf:695a:9e46:f27c:e1be:861f:9e7  | {ff4a:cbbf:695a:9e46:f27c:e1be:861f:9e7,ff6b:af36:5fc2:93d9:ebf3:3c62:a19f:307f}
 ff6b:af36:5fc2:93d9:ebf3:3c62:a19f:307f | {ff4a:cbbf:695a:9e46:f27c:e1be:861f:9e7,ff6b:af36:5fc2:93d9:ebf3:3c62:a19f:307f}
(256 rows)

select a6,
       array_agg(a6) over (order by a6 range between ip6 '0010::' preceding and ip6 '0010::' following)
  from ipaddrs
 where a6 is not null;
                   a6                    |                                     array_agg                                     
-----------------------------------------+-----------------------------------------------------------------------------------
 73:3c34:57a:2a84:b1df:81b0:eb40:61cd    | {73:3c34:57a:2a84:b1df:81b0:eb40:61cd}
 b6:8ebc:c326:48a6:5615:a65e:e87a:25d7   | {b6:8ebc:c326:48a6:5615:a65e:e87a:25d7}
 166:b8ea:1fc5:8913:17ea:d6a0:ac2b:90e1  | {166:b8ea:1fc5:8913:17ea:d6a0:ac2b:90e1}
 227:b768:d43b:773d:6168:5133:867c:13f2  | {227:b768:d43b:773d:6168:5133:867c:13f2}
 453:2d:fbd3:191:95c6:3751:eb62:e90      | {453:2d:fbd3:191:95c6:3751:eb62:e90}
 4a6:7a28:b05b:f9b4:cc5b:9c4c:eefe:3e06  | {4a6:7a28:b05b:f9b4:cc5b:9c4c:eefe:3e06}
 550:fe90:bd02:a3ed:35a2:3254:e280:cd20  | {550:fe90:bd02:a3ed:35a2:3254:e280:cd20}
 75d:e701:5702:6087:a69a:1a2d:376e:4eb   | {75d:e701:5702:6087:a69a:1a2d:376e:4eb}
 7e1:a608:dadd:684d:679e:698b:4db:c8c2   | {7e1:a608:dadd:684d:679e:698b:4db:c8c2}
 9ec:8fec:9a0e:3f2a:66e2:9b5c:498a:1090  | {9ec:8fec:9a0e:3f2a:66e2:9b5c:498a:1090}
 a4b:4e55:7510:69b9:ba73:6550:eaa7:f16e  | {a4b:4e55:7510:69b9:ba73:6550:eaa7:f16e}
 bdb:15d3:fbaf:4bf6:194e:4d0d:4cb2:26c2  | {bdb:15d3:fbaf:4bf6:194e:4d0d:4cb2:26c2}
 cc6:3030:8e26:ed4a:ae48:4496:63c3:94d0  | {cc6:3030:8e26:ed4a:ae48:4496:63c3:94d0}
 ce0:f080:aff1:6780:4951:55a7:4c23:f108  | {ce0:f080:aff1:6780:4951:55a7:4c23:f108}
 d6b:f94a:4040:ba81:2347:d486:ac79:96f7  | {d6b:f94a:4040:ba81:2347:d486:ac79:96f7}
 d9a:933a:3c47:801a:51d4:5a48:13bb:f59b  | {d9a:933a:3c47:801a:51d4:5a48:13bb:f59b}
 ded:898a:e003:6046:72e6:5584:1012:62cc  | {ded:898a:e003:6046:72e6:5584:1012:62cc}
 f47:6def:21e4:4620:3bc:9abc:8abd:aba2   | {f47:6def:21e4:4620:3bc:9abc:8abd:aba2}
 1009:d4ec:fe15:7946:eff2:6827:349e:6f0c | {1009:d4ec:fe15:7946:eff2:6827:349e:6f0c}
 10a5:994f:884d:9f98:4920:408d:1504:561d | {10a5:994f:884d:9f98:4920:408d:1504:561d}
 1378:f0c0:8ca:c76d:f062:4b7a:2573:5710  | {1378:f0c0:8ca:c76d:f062:4b7a:2573:5710}
 1395:59cf:33f6:988:1cf8:5ef3:3c2f:64dc  | {1395:59cf:33f6:988:1cf8:5ef3:3c2f:64dc}
 13d9:9e39:ff4a:875f:82a0:77bc:1559:cf8d | {13d9:9e39:ff4a:875f:82a0:77bc:1559:cf8d}
 13fb:9738:a243:f879:730:2b72:783f:75e9  | {13fb:9738:a243:f879:730:2b72:783f:75e9}
 14fd:6de8:95f:fade:a20c:81d3:98da:c560  | {14fd:6de8:95f:fade:a20c:81d3:98da:c560}
 1520:c2bc:8426:2927:9e12:5f90:f4b0:30e6 | {1520:c2bc:8426:2927:9e12:5f90:f4b0:30e6}
 163a:503e:a2d7:c0d8:f5ee:657e:7f23:ea52 | {163a:503e:a2d7:c0d8:f5ee:657e:7f23:ea52}
 1685:dcd3:5113:5d84:2e64:d9e2:a602:aab7 | {1685:dcd3:5113:5d84:2e64:d9e2:a602:aab7}
 1839:8d68:ec5f:a4e7:711d:124e:150b:cddf | {1839:8d68:ec5f:a4e7:711d:124e:150b:cddf}
 1863:bf8e:aef5:1ac4:f85a:6683:8f7c:d191 | {1863:bf8e:aef5:1ac4:f85a:6683:8f7c:d191}
 18e8:f97:72d0:5444:c94:99fe:4a9e:f657   | {18e8:f97:72d0:5444:c94:99fe:4a9e:f657,18eb:378d:f12f:6114:34d2:ce03:e0d8:cffc}
 18eb:378d:f12f:6114:34d2:ce03:e0d8:cffc | {18e8:f97:72d0:5444:c94:99fe:4a9e:f657,18eb:378d:f12f:6114:34d2:ce03:e0d8:cffc}
 1962:ff9f:665f:ba25:d25a:f530:a391:5ab7 | {1962:ff9f:665f:ba25:d25a:f530:a391:5ab7}
 1b96:6d23:348f:a5f2:1869:1cd5:eff5:d09a | {1b96:6d23:348f:a5f2:1869:1cd5:eff5:d09a}
 1bc2:3fea:257c:553e:eb87:d8c7:ef94:4c9  | {1bc2:3fea:257c:553e:eb87:d8c7:ef94:4c9}
 1be9:3504:b341:17a8:10ec:e646:b0:433    | {1be9:3504:b341:17a8:10ec:e646:b0:433}
 1c3e:17b6:1bfd:77ea:2185:9748:38d:ac80  | {1c3e:17b6:1bfd:77ea:2185:9748:38d:ac80}
 1c90:5c1b:9431:11ea:f6dd:bb7c:c57f:6cc6 | {1c90:5c1b:9431:11ea:f6dd:bb7c:c57f:6cc6}
 1cc5:18d6:116d:d727:86b:9655:f44d:4fb7  | {1cc5:18d6:116d:d727:86b:9655:f44d:4fb7}
 1dbf:c6d8:ce1a:e3e3:c9a2:8458:3674:f6b  | {1dbf:c6d8:ce1a:e3e3:c9a2:8458:3674:f6b}
 1f38:cd00:b368:80e5:7579:df75:3c50:b21b | {1f38:cd00:b368:80e5:7579:df75:3c50:b21b}
 204f:510d:e7e9:9c02:9576:48b1:bfb7:468  | {204f:510d:e7e9:9c02:9576:48b1:bfb7:468}
 21ef:74a4:2571:e430:47b1:a582:9723:9b14 | {21ef:74a4:2571:e430:47b1:a582:9723:9b14}
 2394:74d2:f34d:3801:3a23:f022:dc17:2cf  | {2394:74d2:f34d:3801:3a23:f022:dc17:2cf}
 23fd:5d2:8e6a:628:b4e:3ff2:d386:d2b0    | {23fd:5d2:8e6a:628:b4e:3ff2:d386:d2b0,2408:f23d:d1ac:746d:2c8f:3dd6:7ed0:5507}
 2408:f23d:d1ac:746d:2c8f:3dd6:7ed0:5507 | {23fd:5d2:8e6a:628:b4e:3ff2:d386:d2b0,2408:f23d:d1ac:746d:2c8f:3dd6:7ed0:5507}
 25d9:67f6:f409:c774:60ad:9d6a:b95b:4ad2 | {25d9:67f6:f409:c774:60ad:9d6a:b95b:4ad2}
 25f0:72d:e515:bc9b:f9a2:6061:b18b:758e  | {25f0:72d:e515:bc9b:f9a2:6061:b18b:758e}
 2689:eae5:4101:f97c:628a:58fa:f0b5:159  | {2689:eae5:4101:f97c:628a:58fa:f0b5:159}
 26a3:7ac5:3ce2:cb2d:994d:8f10:82b6:419d | {26a3:7ac5:3ce2:cb2d:994d:8f10:82b6:419d,26ad:4d5b:192c:f85a:71db:38be:c6ca:19de}
 26ad:4d5b:192c:f85a:71db:38be:c6ca:19de | {26a3:7ac5:3ce2:cb2d:994d:8f10:82b6:419d,26ad:4d5b:192c:f85a:71db:38be:c6ca:19de}
 28a6:2032:8a38:de85:f6f3:47bd:5124:7dc8 | {28a6:2032:8a38:de85:f6f3:47bd:5124:7dc8}
 28e7:4441:e0a4:bf30:4cf4:edb0:638d:ad72 | {28e7:4441:e0a4:bf30:4cf4:edb0:638d:ad72}
 29a4:a288:457e:57a9:bbb3:2a76:b117:b1e8 | {29a4:a288:457e:57a9:bbb3:2a76:b117:b1e8,29b2:d3c1:26c4:86b6:19b5:14dc:ab2d:bc67}
 29b2:d3c1:26c4:86b6:19b5:14dc:ab2d:bc67 | {29a4:a288:457e:57a9:bbb3:2a76:b117:b1e8,29b2:d3c1:26c4:86b6:19b5:14dc:ab2d:bc67}
 2a8a:5b38:cbdd:5d1c:e1b0:d627:f31f:285a | {2a8a:5b38:cbdd:5d1c:e1b0:d627:f31f:285a}
 2b47:da0e:8c52:cc33:afaa:f85f:f143:88c6 | {2b47:da0e:8c52:cc33:afaa:f85f:f143:88c6}
 2ee9:6428:5482:9721:9e51:ca52:ba3:99eb  | {2ee9:6428:5482:9721:9e51:ca52:ba3:99eb}
 2f48:4d4b:443c:6de6:9cbe:9766:fd5:c88b  | {2f48:4d4b:443c:6de6:9cbe:9766:fd5:c88b}
 2ff2:b6b6:ffd1:dc5f:fc2:defe:fd16:a414  | {2ff2:b6b6:ffd1:dc5f:fc2:defe:fd16:a414}
 3138:9022:3412:4cfb:fc2a:729a:651c:40f9 | {3138:9022:3412:4cfb:fc2a:729a:651c:40f9}
 318f:1162:8f48:3397:cb9a:f54e:f1e8:d05d | {318f:1162:8f48:3397:cb9a:f54e:f1e8:d05d}
 32ca:6639:c07e:c474:fa11:c83:2886:516c  | {32ca:6639:c07e:c474:fa11:c83:2886:516c}
 35f1:eb03:921c:f397:cd41:9201:f7e0:dfad | {35f1:eb03:921c:f397:cd41:9201:f7e0:dfad,35f3:d696:b49e:1a25:375:5e28:15c9:96ce}
 35f3:d696:b49e:1a25:375:5e28:15c9:96ce  | {35f1:eb03:921c:f397:cd41:9201:f7e0:dfad,35f3:d696:b49e:1a25:375:5e28:15c9:96ce}
 3902:4c48:d872:37bd:2e53:678d:3a0a:3cf6 | {3902:4c48:d872:37bd:2e53:678d:3a0a:3cf6,390b:b7a:6606:af43:233b:2e27:8336:5b2e}
 390b:b7a:6606:af43:233b:2e27:8336:5b2e  | {3902:4c48:d872:37bd:2e53:678d:3a0a:3cf6,390b:b7a:6606:af43:233b:2e27:8336:5b2e}
 39ec:d6ba:1f45:64d0:f4d2:3f0f:78e:a404  | {39ec:d6ba:1f45:64d0:f4d2:3f0f:78e:a404}
 3af7:2de9:30a7:818d:9715:3eaf:d8f7:2583 | {3af7:2de9:30a7:818d:9715:3eaf:d8f7:2583}
 3b13:802b:cfd:15ef:bab3:f337:8b00:5744  | {3b13:802b:cfd:15ef:bab3:f337:8b00:5744}
 3bc9:de98:c700:5aa:d993:223e:dad:1949   | {3bc9:de98:c700:5aa:d993:223e:dad:1949}
 4068:6d06:7463:589:3262:86d1:f1f1:f088  | {4068:6d06:7463:589:3262:86d1:f1f1:f088}
 4111:e35f:ce3:c4de:dc4e:8764:8cd:1686   | {4111:e35f:ce3:c4de:dc4e:8764:8cd:1686}
 4131:d8b6:82af:797d:25fd:7bd4:b94d:ce34 | {4131:d8b6:82af:797d:25fd:7bd4:b94d:ce34}
 42e2:d76f:c784:7a61:67c1:b931:6f49:32c5 | {42e2:d76f:c784:7a61:67c1:b931:6f49:32c5}
 4430:8b98:82c8:3d6c:dbd6:579e:c3fc:ec9d | {4430:8b98:82c8:3d6c:dbd6:579e:c3fc:ec9d,4439:44b6:c04:de6a:c0af:cf35:d9f3:f8ee}
 4439:44b6:c04:de6a:c0af:cf35:d9f3:f8ee  | {4430:8b98:82c8:3d6c:dbd6:579e:c3fc:ec9d,4439:44b6:c04:de6a:c0af:cf35:d9f3:f8ee}
 450b:493b:a4d7:f0d3:6fe4:6da0:b550:f4ca | {450b:493b:a4d7:f0d3:6fe4:6da0:b550:f4ca}
 454c:20ee:35b9:b48b:a59f:e4bc:7b76:f228 | {454c:20ee:35b9:b48b:a59f:e4bc:7b76:f228,454e:bfa0:ed21:4983:7572:22c9:413d:d4db}
 454e:bfa0:ed21:4983:7572:22c9:413d:d4db | {454c:20ee:35b9:b48b:a59f:e4bc:7b76:f228,454e:bfa0:ed21:4983:7572:22c9:413d:d4db}
 4620:c642:9985:6a1f:6c66:50c0:2108:10d3 | {4620:c642:9985:6a1f:6c66:50c0:2108:10d3}
 4647:353:5292:8bef:e5b5:c13a:1176:deef  | {4647:353:5292:8bef:e5b5:c13a:1176:deef}
 4bd6:2076:745e:acbe:c511:3786:60be:b51d | {4bd6:2076:745e:acbe:c511:3786:60be:b51d}
 4d6a:edd6:a446:6d89:e2a3:ab27:79ec:e148 | {4d6a:edd6:a446:6d89:e2a3:ab27:79ec:e148}
 4ee3:bfaa:5f22:2c05:573e:e87c:a6c2:81e0 | {4ee3:bfaa:5f22:2c05:573e:e87c:a6c2:81e0}
 53ad:31ab:bc5e:c535:bc7c:5762:c11e:fcec | {53ad:31ab:bc5e:c535:bc7c:5762:c11e:fcec}
 53d6:7f94:6b26:59cb:9c16:2aa:9722:b8ef  | {53d6:7f94:6b26:59cb:9c16:2aa:9722:b8ef}
 5412:a54d:dbd8:8448:4728:5fb0:ec6f:4381 | {5412:a54d:dbd8:8448:4728:5fb0:ec6f:4381}
 5466:93e3:8343:3686:394:778:79ac:772    | {5466:93e3:8343:3686:394:778:79ac:772}
 54b6:4a85:c1a5:89b0:b7ff:5306:32be:d30f | {54b6:4a85:c1a5:89b0:b7ff:5306:32be:d30f}
 5637:5e57:c050:53fe:e182:697:ab46:21cc  | {5637:5e57:c050:53fe:e182:697:ab46:21cc}
 56fd:83db:3ff7:b0b:7d5:8378:a486:f20    | {56fd:83db:3ff7:b0b:7d5:8378:a486:f20}
 5721:3c79:a6ff:c8d8:5e3:c785:808:e40    | {5721:3c79:a6ff:c8d8:5e3:c785:808:e40}
 5889:8398:cb90:8df:b3d6:3f5c:72cb:cd64  | {5889:8398:cb90:8df:b3d6:3f5c:72cb:cd64}
 599b:9e01:9a22:aebf:a731:ce57:fefb:8ed  | {599b:9e01:9a22:aebf:a731:ce57:fefb:8ed}
 5a0b:33a9:3407:aa9c:f1c7:a538:2f25:bf14 | {5a0b:33a9:3407:aa9c:f1c7:a538:2f25:bf14}
 5a3f:b436:785f:32a4:8c86:13f8:e682:8b6a | {5a3f:b436:785f:32a4:8c86:13f8:e682:8b6a}
 5d63:9613:7b87:5c26:5c80:bbd3:14b5:1e63 | {5d63:9613:7b87:5c26:5c80:bbd3:14b5:1e63}
 5e52:9aa9:8f83:2a67:5959:720d:f6ba:5d42 | {5e52:9aa9:8f83:2a67:5959:720d:f6ba:5d42}
 5ee2:4fab:1073:b2f5:61c1:eea6:302f:685  | {5ee2:4fab:1073:b2f5:61c1:eea6:302f:685}
 5fa8:25bb:15e8:5b35:758c:2044:d194:1962 | {5fa8:25bb:15e8:5b35:758c:2044:d194:1962}
 61f2:afe0:d1af:18e9:5d40:7a4d:f112:2d09 | {61f2:afe0:d1af:18e9:5d40:7a4d:f112:2d09}
 6251:ab4b:3b37:d71f:6b5f:1b2d:bd55:3a3c | {6251:ab4b:3b37:d71f:6b5f:1b2d:bd55:3a3c}
 62b8:256d:637a:82bf:3b69:420:eea5:300b  | {62b8:256d:637a:82bf:3b69:420:eea5:300b}
 62db:eab9:a54e:3cea:46f3:b7c2:cb9c:6e5d | {62db:eab9:a54e:3cea:46f3:b7c2:cb9c:6e5d}
 6656:e87d:865c:3237:8d42:ff01:a82b:f308 | {6656:e87d:865c:3237:8d42:ff01:a82b:f308}
 6a93:ccd3:5002:233f:1c5f:400e:601c:75a  | {6a93:ccd3:5002:233f:1c5f:400e:601c:75a}
 6b0c:4791:ccea:c286:437e:d268:87ef:b6ad | {6b0c:4791:ccea:c286:437e:d268:87ef:b6ad}
 6e1b:5e9c:f623:6134:7754:fdac:323a:dba2 | {6e1b:5e9c:f623:6134:7754:fdac:323a:dba2}
 6e81:4a6a:d383:140d:8416:c09b:af3b:5b45 | {6e81:4a6a:d383:140d:8416:c09b:af3b:5b45}
 6e9d:66e:27c5:c7c4:aefe:ecfc:6568:ccf   | {6e9d:66e:27c5:c7c4:aefe:ecfc:6568:ccf}
 6ff2:94f5:5755:164d:1301:28ce:8a04:eac0 | {6ff2:94f5:5755:164d:1301:28ce:8a04:eac0}
 72c4:104f:960c:baf1:8ef7:60d2:c58:8b03  | {72c4:104f:960c:baf1:8ef7:60d2:c58:8b03}
 7341:d21f:e576:f226:f690:a99c:6b55:9933 | {7341:d21f:e576:f226:f690:a99c:6b55:9933}
 739b:8093:31c6:a42f:a604:d5cb:1350:2d2f | {739b:8093:31c6:a42f:a604:d5cb:1350:2d2f}
 7524:1f76:fe52:991e:667b:a302:dfd5:dbd6 | {7524:1f76:fe52:991e:667b:a302:dfd5:dbd6}
 7608:50bf:a29a:6805:c760:9ae3:1216:8e4a | {7608:50bf:a29a:6805:c760:9ae3:1216:8e4a}
 78c8:1cde:4b95:55d8:b211:a95d:37e0:7d92 | {78c8:1cde:4b95:55d8:b211:a95d:37e0:7d92}
 7924:9e5b:2c7:3920:9c9f:bfb6:369d:fa4f  | {7924:9e5b:2c7:3920:9c9f:bfb6:369d:fa4f}
 798f:ea8:61f6:5d79:1656:d8d8:9b6e:57f0  | {798f:ea8:61f6:5d79:1656:d8d8:9b6e:57f0}
 79c9:d301:92cd:c774:abbb:2f7d:92c3:3ccd | {79c9:d301:92cd:c774:abbb:2f7d:92c3:3ccd}
 79eb:6133:5173:8f43:87d4:cb1d:906b:e8c9 | {79eb:6133:5173:8f43:87d4:cb1d:906b:e8c9}
 7cba:a835:f850:6409:dba7:1300:f2b8:1db3 | {7cba:a835:f850:6409:dba7:1300:f2b8:1db3}
 7cdf:1ed8:690e:9e54:6f39:613e:f187:8ef2 | {7cdf:1ed8:690e:9e54:6f39:613e:f187:8ef2}
 7dcc:877b:8e07:aeb4:d891:581e:c10c:af54 | {7dcc:877b:8e07:aeb4:d891:581e:c10c:af54}
 7e1f:eb76:49c9:39f8:deb9:c447:b40c:a13d | {7e1f:eb76:49c9:39f8:deb9:c447:b40c:a13d}
 7ec8:2b00:5994:7f0f:d765:5e16:c274:5645 | {7ec8:2b00:5994:7f0f:d765:5e16:c274:5645}
 7f3d:d8ea:7a7c:8700:5b81:412f:c33a:d6ba | {7f3d:d8ea:7a7c:8700:5b81:412f:c33a:d6ba}
 7fa2:dbdb:e889:e24b:4d30:962e:89f3:676f | {7fa2:dbdb:e889:e24b:4d30:962e:89f3:676f}
 8119:1220:b888:3d8a:1250:ce77:b2b9:bdcd | {8119:1220:b888:3d8a:1250:ce77:b2b9:bdcd}
 8129:3e9c:70ff:1df1:f26f:86aa:c7ba:8245 | {8129:3e9c:70ff:1df1:f26f:86aa:c7ba:8245}
 8172:4609:d700:5bd2:24a2:8f78:f1cc:c1a0 | {8172:4609:d700:5bd2:24a2:8f78:f1cc:c1a0}
 8241:abe3:7537:de41:ef5a:7d2a:9e57:833b | {8241:abe3:7537:de41:ef5a:7d2a:9e57:833b}
 828e:fa1d:9bb1:ad4c:4874:9da8:40bf:25b5 | {828e:fa1d:9bb1:ad4c:4874:9da8:40bf:25b5,8298:9399:271f:a3fe:270c:21cf:7c34:7340}
 8298:9399:271f:a3fe:270c:21cf:7c34:7340 | {828e:fa1d:9bb1:ad4c:4874:9da8:40bf:25b5,8298:9399:271f:a3fe:270c:21cf:7c34:7340}
 82ed:ac69:4ea7:5301:b005:3e17:f541:4fbc | {82ed:ac69:4ea7:5301:b005:3e17:f541:4fbc}
 8357:a24:2f6e:f909:3853:899a:68af:b48   | {8357:a24:2f6e:f909:3853:899a:68af:b48}
 8474:e00a:5b49:6e2a:5074:ecd5:cece:7dad | {8474:e00a:5b49:6e2a:5074:ecd5:cece:7dad}
 84fe:7351:7b39:349e:1bb7:e333:daec:141a | {84fe:7351:7b39:349e:1bb7:e333:daec:141a}
 8586:595:7bdd:359b:2fd9:1ffa:49ef:a947  | {8586:595:7bdd:359b:2fd9:1ffa:49ef:a947}
 86fa:3a3:6a26:5ce3:fd8d:6267:b3c:4bf0   | {86fa:3a3:6a26:5ce3:fd8d:6267:b3c:4bf0}
 874b:a74e:e292:c13:cf80:778c:35b4:d37c  | {874b:a74e:e292:c13:cf80:778c:35b4:d37c}
 88bb:cf40:1f19:c897:f001:2d56:8f4f:ac68 | {88bb:cf40:1f19:c897:f001:2d56:8f4f:ac68}
 8909:5e3:cff9:483c:1fb7:2ee2:ab05:222a  | {8909:5e3:cff9:483c:1fb7:2ee2:ab05:222a,890b:aa44:e2b1:ff61:eb7a:c4df:5a25:2eaf}
 890b:aa44:e2b1:ff61:eb7a:c4df:5a25:2eaf | {8909:5e3:cff9:483c:1fb7:2ee2:ab05:222a,890b:aa44:e2b1:ff61:eb7a:c4df:5a25:2eaf}
 8a1f:674e:63cd:f241:8f53:aec9:d8db:8e5c | {8a1f:674e:63cd:f241:8f53:aec9:d8db:8e5c}
 8b0c:b103:3302:90bb:bac:809e:9c7d:3569  | {8b0c:b103:3302:90bb:bac:809e:9c7d:3569}
 8b61:6b31:d02c:87d3:22cf:f01c:c045:b822 | {8b61:6b31:d02c:87d3:22cf:f01c:c045:b822}
 8b87:864a:8e83:6783:c552:cb07:8e96:c0e5 | {8b87:864a:8e83:6783:c552:cb07:8e96:c0e5}
 8c86:2c19:c38d:626b:b5a4:e0cb:bbaf:476b | {8c86:2c19:c38d:626b:b5a4:e0cb:bbaf:476b}
 8ec2:3493:ad95:cb7e:ae1c:8c2c:6a34:eccb | {8ec2:3493:ad95:cb7e:ae1c:8c2c:6a34:eccb,8ecc:14db:7aba:bbde:f2a7:c4bc:7a1e:c8c1}
 8ecc:14db:7aba:bbde:f2a7:c4bc:7a1e:c8c1 | {8ec2:3493:ad95:cb7e:ae1c:8c2c:6a34:eccb,8ecc:14db:7aba:bbde:f2a7:c4bc:7a1e:c8c1}
 8f7a:5e8b:f526:a8ba:8c6f:3cae:7b7e:1a5  | {8f7a:5e8b:f526:a8ba:8c6f:3cae:7b7e:1a5}
 8fa1:e604:6ad4:c318:ba8f:eaec:76be:ad4b | {8fa1:e604:6ad4:c318:ba8f:eaec:76be:ad4b,8fac:3b7e:463d:1b38:2f59:6fdf:3bef:4aaf}
 8fac:3b7e:463d:1b38:2f59:6fdf:3bef:4aaf | {8fa1:e604:6ad4:c318:ba8f:eaec:76be:ad4b,8fac:3b7e:463d:1b38:2f59:6fdf:3bef:4aaf}
 933f:d5b:d307:c3e0:5e0:b947:1cb5:6928   | {933f:d5b:d307:c3e0:5e0:b947:1cb5:6928}
 9520:88f9:9498:8a73:ac7a:dc77:4495:3dfc | {9520:88f9:9498:8a73:ac7a:dc77:4495:3dfc}
 9631:3557:7591:6ade:1882:6dad:8413:c3b3 | {9631:3557:7591:6ade:1882:6dad:8413:c3b3}
 977b:de6f:3ef9:3cad:fb02:fb07:458c:e88e | {977b:de6f:3ef9:3cad:fb02:fb07:458c:e88e}
 982a:e6d8:49bc:49a7:80b:4417:45f7:4fb7  | {982a:e6d8:49bc:49a7:80b:4417:45f7:4fb7}
 9943:4095:cf6c:bf1d:f1b4:7883:f929:a315 | {9943:4095:cf6c:bf1d:f1b4:7883:f929:a315}
 99b7:bba0:206c:6042:6778:2f3b:9a:6393   | {99b7:bba0:206c:6042:6778:2f3b:9a:6393}
 9b3d:56d7:b18e:21b9:7448:3cea:2ec:77f8  | {9b3d:56d7:b18e:21b9:7448:3cea:2ec:77f8}
 9c51:8c1b:a051:a87e:c65a:cc8:a38e:4953  | {9c51:8c1b:a051:a87e:c65a:cc8:a38e:4953}
 9d35:9c4f:517d:2391:f59c:af03:1681:6d9b | {9d35:9c4f:517d:2391:f59c:af03:1681:6d9b}
 9da1:e3ce:660a:cde4:7576:554:55cc:38ad  | {9da1:e3ce:660a:cde4:7576:554:55cc:38ad}
 9ee9:65bd:81d2:b2c6:c3c4:b36b:16a2:fc9e | {9ee9:65bd:81d2:b2c6:c3c4:b36b:16a2:fc9e}
 a0d3:f0b5:7a50:2d3e:923e:3832:76c0:b15d | {a0d3:f0b5:7a50:2d3e:923e:3832:76c0:b15d}
 a252:248:a123:3287:680f:a67c:2fcd:b2a0  | {a252:248:a123:3287:680f:a67c:2fcd:b2a0}
 a300:d184:bf44:e8f1:4a80:723c:909:f178  | {a300:d184:bf44:e8f1:4a80:723c:909:f178}
 a335:f1a7:be5c:b341:5325:e8d3:2631:74ae | {a335:f1a7:be5c:b341:5325:e8d3:2631:74ae}
 a42d:662e:1816:1fe3:a392:9190:7d4e:f418 | {a42d:662e:1816:1fe3:a392:9190:7d4e:f418}
 a52f:f73a:413e:a43a:5000:cd8f:ef1f:3603 | {a52f:f73a:413e:a43a:5000:cd8f:ef1f:3603}
 a75b:c708:8e74:b252:f8e8:7269:c214:dc07 | {a75b:c708:8e74:b252:f8e8:7269:c214:dc07}
 a87b:8920:6e0:9c1b:92a8:3a1e:f074:1ee2  | {a87b:8920:6e0:9c1b:92a8:3a1e:f074:1ee2,a884:9796:ca7c:ec37:9cb4:4158:ce4c:ced5}
 a884:9796:ca7c:ec37:9cb4:4158:ce4c:ced5 | {a87b:8920:6e0:9c1b:92a8:3a1e:f074:1ee2,a884:9796:ca7c:ec37:9cb4:4158:ce4c:ced5}
 a9e9:74a5:864a:dfeb:a5f0:4424:d294:95a1 | {a9e9:74a5:864a:dfeb:a5f0:4424:d294:95a1}
 ac4c:23a6:9c5f:8a2a:ccfc:ea69:48cd:dffc | {ac4c:23a6:9c5f:8a2a:ccfc:ea69:48cd:dffc}
 ac71:fd2c:4352:c28a:2f4b:3cd1:4d6f:927b | {ac71:fd2c:4352:c28a:2f4b:3cd1:4d6f:927b}
 ad73:992f:b3d8:31f7:306d:a418:fdcf:3e60 | {ad73:992f:b3d8:31f7:306d:a418:fdcf:3e60}
 ae64:d6a3:11d7:b6bc:aa3:60c6:b16f:4305  | {ae64:d6a3:11d7:b6bc:aa3:60c6:b16f:4305}
 af5a:6507:2c50:f0a8:b211:fc0d:425e:bd47 | {af5a:6507:2c50:f0a8:b211:fc0d:425e:bd47}
 afeb:a771:735e:1a18:9297:e9f4:2e53:c5e1 | {afeb:a771:735e:1a18:9297:e9f4:2e53:c5e1}
 b105:5518:a963:9a0a:d10d:b42b:dfd1:96a2 | {b105:5518:a963:9a0a:d10d:b42b:dfd1:96a2,b113:66f:e222:f032:7161:1f27:b080:2111}
 b113:66f:e222:f032:7161:1f27:b080:2111  | {b105:5518:a963:9a0a:d10d:b42b:dfd1:96a2,b113:66f:e222:f032:7161:1f27:b080:2111}
 b218:c6f2:4929:7d70:8b4d:5458:fc85:d0fc | {b218:c6f2:4929:7d70:8b4d:5458:fc85:d0fc}
 b237:dac3:62d7:725e:d772:c88c:af71:cec5 | {b237:dac3:62d7:725e:d772:c88c:af71:cec5}
 b310:3d72:ea86:6ee:45fc:d57f:4a7a:bb43  | {b310:3d72:ea86:6ee:45fc:d57f:4a7a:bb43}
 b3da:187b:cc2e:3c78:e060:aab6:63cb:1780 | {b3da:187b:cc2e:3c78:e060:aab6:63cb:1780}
 b408:9874:22a3:9f56:35f:cfd1:b00:ddac   | {b408:9874:22a3:9f56:35f:cfd1:b00:ddac}
 b48c:eccb:32f4:2b4:e2ee:e787:a16f:8647  | {b48c:eccb:32f4:2b4:e2ee:e787:a16f:8647}
 b8ef:17e2:febe:431d:9d8c:88c6:6604:a678 | {b8ef:17e2:febe:431d:9d8c:88c6:6604:a678}
 ba0d:d2d4:b5e3:573f:98f4:98e:aac1:47fa  | {ba0d:d2d4:b5e3:573f:98f4:98e:aac1:47fa}
 baf9:2948:a8a1:8865:912a:839f:45e8:78d3 | {baf9:2948:a8a1:8865:912a:839f:45e8:78d3}
 bb1b:6a20:8513:14e4:5fc6:c0e9:17df:9c0  | {bb1b:6a20:8513:14e4:5fc6:c0e9:17df:9c0}
 bc1d:d3ba:50da:14d3:f496:6847:3b91:2830 | {bc1d:d3ba:50da:14d3:f496:6847:3b91:2830}
 bc52:8171:9377:d593:1c0a:75e4:e2d:5e1a  | {bc52:8171:9377:d593:1c0a:75e4:e2d:5e1a}
 bd6f:44b9:45d3:529f:84c7:612:b25c:aaf8  | {bd6f:44b9:45d3:529f:84c7:612:b25c:aaf8}
 bdc5:94f5:8249:7120:8132:ca25:d3fc:c394 | {bdc5:94f5:8249:7120:8132:ca25:d3fc:c394}
 c0fc:f3ee:3707:19dc:62c1:5c9a:df3d:1b58 | {c0fc:f3ee:3707:19dc:62c1:5c9a:df3d:1b58}
 c2e3:4cea:30dd:cb39:c5a0:86e7:8b05:3f7  | {c2e3:4cea:30dd:cb39:c5a0:86e7:8b05:3f7}
 c36f:f4fd:4853:a07c:c25d:349f:3af4:3432 | {c36f:f4fd:4853:a07c:c25d:349f:3af4:3432}
 c504:481e:2756:3ca2:f0c:a26a:4e64:7804  | {c504:481e:2756:3ca2:f0c:a26a:4e64:7804}
 c6ff:8d3c:d2d1:ee46:65ca:27f9:cc07:8e6d | {c6ff:8d3c:d2d1:ee46:65ca:27f9:cc07:8e6d}
 c8c0:5117:331a:f029:8d24:6775:fe7d:5976 | {c8c0:5117:331a:f029:8d24:6775:fe7d:5976}
 c963:10d0:1586:d1d4:79bc:d7af:5486:43e5 | {c963:10d0:1586:d1d4:79bc:d7af:5486:43e5}
 c99c:bd43:6161:d17d:2fdd:ab61:922:ba62  | {c99c:bd43:6161:d17d:2fdd:ab61:922:ba62}
 cb2f:b8da:ba34:1c5c:4839:710a:f75b:bdd0 | {cb2f:b8da:ba34:1c5c:4839:710a:f75b:bdd0}
 cb70:a0cc:6919:db7f:8fc8:cb69:6fcc:5f5b | {cb70:a0cc:6919:db7f:8fc8:cb69:6fcc:5f5b}
 cc17:3814:d80f:41a1:1309:35d3:ea0a:d31e | {cc17:3814:d80f:41a1:1309:35d3:ea0a:d31e}
 ce47:e5eb:41f3:23af:6209:5ade:82ce:3b00 | {ce47:e5eb:41f3:23af:6209:5ade:82ce:3b00}
 cfb9:d37e:2427:af8d:b728:8f90:f54c:9141 | {cfb9:d37e:2427:af8d:b728:8f90:f54c:9141}
 d066:f25b:e8a5:4ae6:4c99:2a98:8cb7:2530 | {d066:f25b:e8a5:4ae6:4c99:2a98:8cb7:2530}
 d105:1597:c912:51c7:e5b6:f628:cae:1d0f  | {d105:1597:c912:51c7:e5b6:f628:cae:1d0f}
 d2de:7aa1:975:e510:dfa1:2a3:89bc:eedb   | {d2de:7aa1:975:e510:dfa1:2a3:89bc:eedb}
 d33e:e847:b4c6:d5ca:f75:216b:342c:3d04  | {d33e:e847:b4c6:d5ca:f75:216b:342c:3d04}
 d395:c008:43a4:48d9:15a7:ce74:6546:c56b | {d395:c008:43a4:48d9:15a7:ce74:6546:c56b}
 d452:6fb9:f2b0:d387:80ca:47d5:330f:577  | {d452:6fb9:f2b0:d387:80ca:47d5:330f:577}
 d524:77db:2a21:e05b:68c4:575c:f04b:b0b7 | {d524:77db:2a21:e05b:68c4:575c:f04b:b0b7}
 d6d1:e96c:cd2f:8396:23f2:c96d:9376:54cb | {d6d1:e96c:cd2f:8396:23f2:c96d:9376:54cb}
 d76b:986d:d38b:252a:e6a2:254e:b0f7:db24 | {d76b:986d:d38b:252a:e6a2:254e:b0f7:db24}
 d9f3:2018:6aa2:7ee4:64be:e2d:c32c:2d15  | {d9f3:2018:6aa2:7ee4:64be:e2d:c32c:2d15}
 da3e:c57c:ccc8:edbf:f66e:85a5:e252:a3a4 | {da3e:c57c:ccc8:edbf:f66e:85a5:e252:a3a4}
 da52:3791:27b8:f773:7a59:1414:6d76:bd8a | {da52:3791:27b8:f773:7a59:1414:6d76:bd8a}
 da97:ecc5:bf17:1bb2:5710:f753:604c:7cf6 | {da97:ecc5:bf17:1bb2:5710:f753:604c:7cf6}
 dc61:8bf4:4b82:90a4:8af0:6a43:a917:14ee | {dc61:8bf4:4b82:90a4:8af0:6a43:a917:14ee}
 dd3b:ad95:1e55:a555:daae:8218:99d7:7bce | {dd3b:ad95:1e55:a555:daae:8218:99d7:7bce}
 defd:c729:62b4:8959:6ad1:7b1f:5835:8ffb | {defd:c729:62b4:8959:6ad1:7b1f:5835:8ffb}
 dfe2:c097:49ae:1d60:e3db:26c1:bb5d:c4e0 | {dfe2:c097:49ae:1d60:e3db:26c1:bb5d:c4e0}
 e11c:4f21:dd57:c814:af4e:3f55:4adf:f1a0 | {e11c:4f21:dd57:c814:af4e:3f55:4adf:f1a0}
 e199:2ea0:f3b4:3a31:5d15:dfc9:68cd:c948 | {e199:2ea0:f3b4:3a31:5d15:dfc9:68cd:c948}
 e57b:76e8:3f3a:3020:a22a:38b7:9c02:5db4 | {e57b:76e8:3f3a:3020:a22a:38b7:9c02:5db4}
 e6da:dc3c:a935:a718:4744:a216:84bd:cfa9 | {e6da:dc3c:a935:a718:4744:a216:84bd:cfa9}
 e7a7:adbe:d6de:41ba:a34f:d10b:46a7:a4cf | {e7a7:adbe:d6de:41ba:a34f:d10b:46a7:a4cf}
 e86d:edb4:8702:1774:c97d:cbee:394:a083  | {e86d:edb4:8702:1774:c97d:cbee:394:a083}
 e97f:c466:f346:cf67:23e4:bd36:72be:af44 | {e97f:c466:f346:cf67:23e4:bd36:72be:af44}
 ec36:7c6d:3077:267e:399a:d47:55a4:218a  | {ec36:7c6d:3077:267e:399a:d47:55a4:218a}
 ee1d:a078:25d4:94e3:9a89:707d:6fae:7573 | {ee1d:a078:25d4:94e3:9a89:707d:6fae:7573}
 ee34:9ba:9281:593c:ab74:57fa:e439:e0f3  | {ee34:9ba:9281:593c:ab74:57fa:e439:e0f3}
 ee76:e9ac:dd2:66c1:380:5f1e:1c4d:2867   | {ee76:e9ac:dd2:66c1:380:5f1e:1c4d:2867}
 eea0:9aef:71b:3cfd:e2ad:864c:41b8:938c  | {eea0:9aef:71b:3cfd:e2ad:864c:41b8:938c}
 ef15:3aa9:3c5b:b993:5209:a130:2d37:3a64 | {ef15:3aa9:3c5b:b993:5209:a130:2d37:3a64}
 ef9a:b980:e9:d50a:d867:8a88:2cae:8aa1   | {ef9a:b980:e9:d50a:d867:8a88:2cae:8aa1}
 effb:1a90:1dd5:e52c:1d7f:c716:3744:170a | {effb:1a90:1dd5:e52c:1d7f:c716:3744:170a}
 f0a1:e730:68b9:2e1c:649a:5450:a256:4665 | {f0a1:e730:68b9:2e1c:649a:5450:a256:4665}
 f3df:f155:d5c6:d664:c93c:13fa:9d77:6bf2 | {f3df:f155:d5c6:d664:c93c:13fa:9d77:6bf2}
 f499:668f:fbb8:f0dc:8e41:d43b:c025:26a  | {f499:668f:fbb8:f0dc:8e41:d43b:c025:26a}
 f57a:a3dc:3b11:f28a:8b25:8d5b:ec2f:c729 | {f57a:a3dc:3b11:f28a:8b25:8d5b:ec2f:c729}
 f7b8:dfc:496c:9718:ae3c:5c3e:b98a:4c5f  | {f7b8:dfc:496c:9718:ae3c:5c3e:b98a:4c5f}
 fa78:68ce:4fb1:d54c:2007:1820:ffe2:8235 | {fa78:68ce:4fb1:d54c:2007:1820:ffe2:8235}
 fbb6:2d70:42eb:55ab:6235:6867:2b3:8d47  | {fbb6:2d70:42eb:55ab:6235:6867:2b3:8d47}
 fcea:f739:a97d:cefc:49c4:b3c3:c7b4:99d6 | {fcea:f739:a97d:cefc:49c4:b3c3:c7b4:99d6}
 fda3:3e75:37c5:c1f:912b:5e32:6aa9:aeb2  | {fda3:3e75:37c5:c1f:912b:5e32:6aa9:aeb2}
 ff3d:7d5b:b0fe:c30:9e6c:23e0:7b5:e9de   | {ff3d:7d5b:b0fe:c30:9e6c:23e0:7b5:e9de,ff4a:cbbf:695a:9e46:f27c:e1be:861f:9e7}
 ff4a:cbbf:695a:9e46:f27c:e1be:861f:9e7  | {ff3d:7d5b:b0fe:c30:9e6c:23e0:7b5:e9de,ff4a:cbbf:695a:9e46:f27c:e1be:861f:9e7}
 ff6b:af36:5fc2:93d9:ebf3:3c62:a19f:307f | {ff6b:af36:5fc2:93d9:ebf3:3c62:a19f:307f}
(256 rows)

-- errors
select a4,
       array_agg(a4) over (order by a4 range between -33 preceding and -33 following)
  from ipaddrs
 where a4 is not null;
ERROR:  invalid preceding or following size in window function
DETAIL:  Offset value -33 is outside the range -32 to 4294967295
select a6,
       array_agg(a6) over (order by a6 range between -129 preceding and -129 following)
  from ipaddrs
 where a6 is not null;
ERROR:  invalid preceding or following size in window function
DETAIL:  Offset value -129 is outside the range -128 to 2^63-1
-- end


================================================
FILE: expected/ip4r.out
================================================
--
/*CUT-HERE*/
CREATE EXTENSION ip4r;
-- Check whether any of our opclasses fail amvalidate
DO $d$
  DECLARE
    r record;
  BEGIN
    IF current_setting('server_version_num')::integer >= 90600 THEN
      FOR r IN SELECT amname,
                      CASE amname WHEN 'btree' THEN 6
		                  WHEN 'hash' THEN 6
				  WHEN 'gist' THEN 3
				  ELSE 0 END as expected,
		      count(nullif(amvalidate(opc.oid),false)) as actual
                 FROM pg_opclass opc
                      LEFT JOIN pg_am am ON am.oid = opcmethod
                WHERE opcintype IN ('ip4'::regtype,
                                    'ip4r'::regtype,
                                    'ip6'::regtype,
                                    'ip6r'::regtype,
                                    'ipaddress'::regtype,
                                    'iprange'::regtype)
                GROUP BY amname
                ORDER BY amname
      LOOP
         IF r.expected IS DISTINCT FROM r.actual THEN
           RAISE INFO '% % operator classes did not validate', r.expected - r.actual, r.amname;
         END IF;
      END LOOP;
    END IF;
  END;
$d$;
/*CUT-END*/
\set VERBOSITY terse
SET extra_float_digits = 0;
--
-- Valid and invalid addresses
--
--valid ip4
select '1.2.3.4'::ip4;
   ip4   
---------
 1.2.3.4
(1 row)

select '0.0.0.0'::ip4;
   ip4   
---------
 0.0.0.0
(1 row)

select '255.255.255.255'::ip4;
       ip4       
-----------------
 255.255.255.255
(1 row)

select '0.0.0.255'::ip4;
    ip4    
-----------
 0.0.0.255
(1 row)

select '0.0.255.0'::ip4;
    ip4    
-----------
 0.0.255.0
(1 row)

select '0.255.0.0'::ip4;
    ip4    
-----------
 0.255.0.0
(1 row)

select '255.0.0.0'::ip4;
    ip4    
-----------
 255.0.0.0
(1 row)

select '192.168.123.210'::ip4;
       ip4       
-----------------
 192.168.123.210
(1 row)

select '127.0.0.1'::ip4;
    ip4    
-----------
 127.0.0.1
(1 row)

--invalid ip4
select '1.2.3'::ip4;
ERROR:  invalid IP4 value: '1.2.3' at character 8
select '0'::ip4;
ERROR:  invalid IP4 value: '0' at character 8
select ' 1.2.3.4'::ip4;
ERROR:  invalid IP4 value: ' 1.2.3.4' at character 8
select '1.2.3.4 '::ip4;
ERROR:  invalid IP4 value: '1.2.3.4 ' at character 8
select '0.0.0.256'::ip4;
ERROR:  invalid IP4 value: '0.0.0.256' at character 8
select '0.0.256'::ip4;
ERROR:  invalid IP4 value: '0.0.256' at character 8
select '0..255.0'::ip4;
ERROR:  invalid IP4 value: '0..255.0' at character 8
select '+0.255.0.0'::ip4;
ERROR:  invalid IP4 value: '+0.255.0.0' at character 8
select '1.2.3.4-1.2.3.4'::ip4;
ERROR:  invalid IP4 value: '1.2.3.4-1.2.3.4' at character 8
-- valid ip6
select '0000:0000:0000:0000:0000:0000:0000:0000'::ip6;
 ip6 
-----
 ::
(1 row)

select '0000:0000:0000:0000:0000:0000:0000:0001'::ip6;
 ip6 
-----
 ::1
(1 row)

select '0:0:0:0:0:0:0:0'::ip6;
 ip6 
-----
 ::
(1 row)

select '0:0:0:0:0:0:0:1'::ip6;
 ip6 
-----
 ::1
(1 row)

select '0:0:0:0:0:0:13.1.68.3'::ip6;
     ip6     
-------------
 ::13.1.68.3
(1 row)

select '0:0:0:0:0:FFFF:129.144.52.38'::ip6;
         ip6          
----------------------
 ::ffff:129.144.52.38
(1 row)

select '0::0'::ip6;
 ip6 
-----
 ::
(1 row)

select '1:2:3:4:5:6:1.2.3.4'::ip6;
         ip6         
---------------------
 1:2:3:4:5:6:102:304
(1 row)

select '1:2:3:4:5:6:7:8'::ip6;
       ip6       
-----------------
 1:2:3:4:5:6:7:8
(1 row)

select '1:2:3:4:5:6::'::ip6;
      ip6      
---------------
 1:2:3:4:5:6::
(1 row)

select '1:2:3:4:5:6::8'::ip6;
       ip6       
-----------------
 1:2:3:4:5:6:0:8
(1 row)

select '1:2:3:4:5::'::ip6;
     ip6     
-------------
 1:2:3:4:5::
(1 row)

select '1:2:3:4:5::1.2.3.4'::ip6;
         ip6         
---------------------
 1:2:3:4:5:0:102:304
(1 row)

select '1:2:3:4:5::7:8'::ip6;
       ip6       
-----------------
 1:2:3:4:5:0:7:8
(1 row)

select '1:2:3:4:5::8'::ip6;
     ip6      
--------------
 1:2:3:4:5::8
(1 row)

select '1:2:3:4::'::ip6;
    ip6    
-----------
 1:2:3:4::
(1 row)

select '1:2:3:4::1.2.3.4'::ip6;
       ip6        
------------------
 1:2:3:4::102:304
(1 row)

select '1:2:3:4::5:1.2.3.4'::ip6;
         ip6         
---------------------
 1:2:3:4:0:5:102:304
(1 row)

select '1:2:3:4::7:8'::ip6;
     ip6      
--------------
 1:2:3:4::7:8
(1 row)

select '1:2:3:4::8'::ip6;
    ip6     
------------
 1:2:3:4::8
(1 row)

select '1:2:3::'::ip6;
   ip6   
---------
 1:2:3::
(1 row)

select '1:2:3::1.2.3.4'::ip6;
      ip6       
----------------
 1:2:3::102:304
(1 row)

select '1:2:3::5:1.2.3.4'::ip6;
       ip6        
------------------
 1:2:3::5:102:304
(1 row)

select '1:2:3::7:8'::ip6;
    ip6     
------------
 1:2:3::7:8
(1 row)

select '1:2:3::8'::ip6;
   ip6    
----------
 1:2:3::8
(1 row)

select '1:2::'::ip6;
  ip6  
-------
 1:2::
(1 row)

select '1:2::1.2.3.4'::ip6;
     ip6      
--------------
 1:2::102:304
(1 row)

select '1:2::5:1.2.3.4'::ip6;
      ip6       
----------------
 1:2::5:102:304
(1 row)

select '1:2::7:8'::ip6;
   ip6    
----------
 1:2::7:8
(1 row)

select '1:2::8'::ip6;
  ip6   
--------
 1:2::8
(1 row)

select '1::'::ip6;
 ip6 
-----
 1::
(1 row)

select '1::1.2.3.4'::ip6;
    ip6     
------------
 1::102:304
(1 row)

select '1::2:3'::ip6;
  ip6   
--------
 1::2:3
(1 row)

select '1::2:3:4'::ip6;
   ip6    
----------
 1::2:3:4
(1 row)

select '1::2:3:4:5'::ip6;
    ip6     
------------
 1::2:3:4:5
(1 row)

select '1::2:3:4:5:6'::ip6;
     ip6      
--------------
 1::2:3:4:5:6
(1 row)

select '1::2:3:4:5:6:7'::ip6;
       ip6       
-----------------
 1:0:2:3:4:5:6:7
(1 row)

select '1::5:1.2.3.4'::ip6;
     ip6      
--------------
 1::5:102:304
(1 row)

select '1::5:11.22.33.44'::ip6;
      ip6      
---------------
 1::5:b16:212c
(1 row)

select '1::7:8'::ip6;
  ip6   
--------
 1::7:8
(1 row)

select '1::8'::ip6;
 ip6  
------
 1::8
(1 row)

select '2001:0000:1234:0000:0000:C1C0:ABCD:0876'::ip6;
            ip6             
----------------------------
 2001:0:1234::c1c0:abcd:876
(1 row)

select '2001:0db8:0000:0000:0000:0000:1428:57ab'::ip6;
         ip6         
---------------------
 2001:db8::1428:57ab
(1 row)

select '2001:0db8:0000:0000:0000::1428:57ab'::ip6;
         ip6         
---------------------
 2001:db8::1428:57ab
(1 row)

select '2001:0db8:0:0:0:0:1428:57ab'::ip6;
         ip6         
---------------------
 2001:db8::1428:57ab
(1 row)

select '2001:0db8:0:0::1428:57ab'::ip6;
         ip6         
---------------------
 2001:db8::1428:57ab
(1 row)

select '2001:0db8:1234:0000:0000:0000:0000:0000'::ip6;
       ip6       
-----------------
 2001:db8:1234::
(1 row)

select '2001:0db8:1234::'::ip6;
       ip6       
-----------------
 2001:db8:1234::
(1 row)

select '2001:0db8:1234:ffff:ffff:ffff:ffff:ffff'::ip6;
                  ip6                   
----------------------------------------
 2001:db8:1234:ffff:ffff:ffff:ffff:ffff
(1 row)

select '2001:0db8:85a3:0000:0000:8a2e:0370:7334'::ip6;
             ip6              
------------------------------
 2001:db8:85a3::8a2e:370:7334
(1 row)

select '2001:0db8::1428:57ab'::ip6;
         ip6         
---------------------
 2001:db8::1428:57ab
(1 row)

select '2001:10::'::ip6;
    ip6    
-----------
 2001:10::
(1 row)

select '2001::'::ip6;
  ip6   
--------
 2001::
(1 row)

select '2001:DB8:0:0:8:800:200C:417A'::ip6;
            ip6            
---------------------------
 2001:db8::8:800:200c:417a
(1 row)

select '2001:DB8::8:800:200C:417A'::ip6;
            ip6            
---------------------------
 2001:db8::8:800:200c:417a
(1 row)

select '2001:db8:85a3:0:0:8a2e:370:7334'::ip6;
             ip6              
------------------------------
 2001:db8:85a3::8a2e:370:7334
(1 row)

select '2001:db8:85a3::8a2e:370:7334'::ip6;
             ip6              
------------------------------
 2001:db8:85a3::8a2e:370:7334
(1 row)

select '2001:db8::'::ip6;
    ip6     
------------
 2001:db8::
(1 row)

select '2001:db8::'::ip6;
    ip6     
------------
 2001:db8::
(1 row)

select '2001:db8::1428:57ab'::ip6;
         ip6         
---------------------
 2001:db8::1428:57ab
(1 row)

select '2001:db8:a::123'::ip6;
       ip6       
-----------------
 2001:db8:a::123
(1 row)

select '2002::'::ip6;
  ip6   
--------
 2002::
(1 row)

select '2::10'::ip6;
  ip6  
-------
 2::10
(1 row)

select '3ffe:0b00:0000:0000:0001:0000:0000:000a'::ip6;
        ip6        
-------------------
 3ffe:b00::1:0:0:a
(1 row)

select '::'::ip6;
 ip6 
-----
 ::
(1 row)

select '::1'::ip6;
 ip6 
-----
 ::1
(1 row)

select '::127.0.0.1'::ip6;
     ip6     
-------------
 ::127.0.0.1
(1 row)

select '::13.1.68.3'::ip6;
     ip6     
-------------
 ::13.1.68.3
(1 row)

select '::2:3'::ip6;
    ip6    
-----------
 ::0.2.0.3
(1 row)

select '::2:3:4'::ip6;
   ip6   
---------
 ::2:3:4
(1 row)

select '::2:3:4:5'::ip6;
    ip6    
-----------
 ::2:3:4:5
(1 row)

select '::2:3:4:5:6'::ip6;
     ip6     
-------------
 ::2:3:4:5:6
(1 row)

select '::2:3:4:5:6:7'::ip6;
      ip6      
---------------
 ::2:3:4:5:6:7
(1 row)

select '::2:3:4:5:6:7:8'::ip6;
       ip6       
-----------------
 0:2:3:4:5:6:7:8
(1 row)

select '::8'::ip6;
 ip6 
-----
 ::8
(1 row)

select '::FFFF:129.144.52.38'::ip6;
         ip6          
----------------------
 ::ffff:129.144.52.38
(1 row)

select '::ffff:0:0'::ip6;
      ip6       
----------------
 ::ffff:0.0.0.0
(1 row)

select '::ffff:0:192.168.1.1'::ip6;
         ip6          
----------------------
 ::ffff:0:192.168.1.1
(1 row)

select '::ffff:1:1.2.3.4'::ip6;
       ip6        
------------------
 ::ffff:1:102:304
(1 row)

select '::ffff:0c22:384e'::ip6;
        ip6         
--------------------
 ::ffff:12.34.56.78
(1 row)

select '::ffff:12.34.56.78'::ip6;
        ip6         
--------------------
 ::ffff:12.34.56.78
(1 row)

select '::ffff:192.0.2.128'::ip6;
        ip6         
--------------------
 ::ffff:192.0.2.128
(1 row)

select '::ffff:192.168.1.1'::ip6;
        ip6         
--------------------
 ::ffff:192.168.1.1
(1 row)

select '::ffff:192.168.1.26'::ip6;
         ip6         
---------------------
 ::ffff:192.168.1.26
(1 row)

select '::ffff:c000:280'::ip6;
        ip6         
--------------------
 ::ffff:192.0.2.128
(1 row)

select 'FF01:0:0:0:0:0:0:101'::ip6;
    ip6    
-----------
 ff01::101
(1 row)

select 'FF01::101'::ip6;
    ip6    
-----------
 ff01::101
(1 row)

select 'FF02:0000:0000:0000:0000:0000:0000:0001'::ip6;
   ip6   
---------
 ff02::1
(1 row)

select 'fc00::'::ip6;
  ip6   
--------
 fc00::
(1 row)

select 'fe80:0000:0000:0000:0204:61ff:fe9d:f156'::ip6;
           ip6            
--------------------------
 fe80::204:61ff:fe9d:f156
(1 row)

select 'fe80:0:0:0:204:61ff:254.157.241.86'::ip6;
           ip6            
--------------------------
 fe80::204:61ff:fe9d:f156
(1 row)

select 'fe80:0:0:0:204:61ff:fe9d:f156'::ip6;
           ip6            
--------------------------
 fe80::204:61ff:fe9d:f156
(1 row)

select 'fe80::'::ip6;
  ip6   
--------
 fe80::
(1 row)

select 'fe80::1'::ip6;
   ip6   
---------
 fe80::1
(1 row)

select 'fe80::204:61ff:254.157.241.86'::ip6;
           ip6            
--------------------------
 fe80::204:61ff:fe9d:f156
(1 row)

select 'fe80::204:61ff:fe9d:f156'::ip6;
           ip6            
--------------------------
 fe80::204:61ff:fe9d:f156
(1 row)

select 'fe80::217:f2ff:254.7.237.98'::ip6;
           ip6            
--------------------------
 fe80::217:f2ff:fe07:ed62
(1 row)

select 'fe80::217:f2ff:fe07:ed62'::ip6;
           ip6            
--------------------------
 fe80::217:f2ff:fe07:ed62
(1 row)

select 'ff02::1'::ip6;
   ip6   
---------
 ff02::1
(1 row)

-- invalid ip6
select ''::ip6;
ERROR:  invalid IP6 value: '' at character 8
select '02001:0000:1234:0000:0000:C1C0:ABCD:0876'::ip6;
ERROR:  invalid IP6 value: '02001:0000:1234:0000:0000:C1C0:ABCD:0876' at character 8
select '1.2.3.4:1111:2222:3333:4444::5555'::ip6;
ERROR:  invalid IP6 value: '1.2.3.4:1111:2222:3333:4444::5555' at character 8
select '1.2.3.4:1111:2222:3333::5555'::ip6;
ERROR:  invalid IP6 value: '1.2.3.4:1111:2222:3333::5555' at character 8
select '1.2.3.4:1111:2222::5555'::ip6;
ERROR:  invalid IP6 value: '1.2.3.4:1111:2222::5555' at character 8
select '1.2.3.4:1111::5555'::ip6;
ERROR:  invalid IP6 value: '1.2.3.4:1111::5555' at character 8
select '1.2.3.4::'::ip6;
ERROR:  invalid IP6 value: '1.2.3.4::' at character 8
select '1.2.3.4::5555'::ip6;
ERROR:  invalid IP6 value: '1.2.3.4::5555' at character 8
select '1111:'::ip6;
ERROR:  invalid IP6 value: '1111:' at character 8
select '1111:2222:3333:4444::5555:'::ip6;
ERROR:  invalid IP6 value: '1111:2222:3333:4444::5555:' at character 8
select '1111:2222:3333::5555:'::ip6;
ERROR:  invalid IP6 value: '1111:2222:3333::5555:' at character 8
select '1111:2222::5555:'::ip6;
ERROR:  invalid IP6 value: '1111:2222::5555:' at character 8
select '1111::5555:'::ip6;
ERROR:  invalid IP6 value: '1111::5555:' at character 8
select '123'::ip6;
ERROR:  invalid IP6 value: '123' at character 8
select '12345::6:7:8'::ip6;
ERROR:  invalid IP6 value: '12345::6:7:8' at character 8
select '127.0.0.1'::ip6;
ERROR:  invalid IP6 value: '127.0.0.1' at character 8
select '1:2:3:4:5:6:7:8:9'::ip6;
ERROR:  invalid IP6 value: '1:2:3:4:5:6:7:8:9' at character 8
select '1:2:3::4:5:6:7:8:9'::ip6;
ERROR:  invalid IP6 value: '1:2:3::4:5:6:7:8:9' at character 8
select '1:2:3::4:5::7:8'::ip6;
ERROR:  invalid IP6 value: '1:2:3::4:5::7:8' at character 8
select '1::1.2.256.4'::ip6;
ERROR:  invalid IP6 value: '1::1.2.256.4' at character 8
select '1::1.2.3.256'::ip6;
ERROR:  invalid IP6 value: '1::1.2.3.256' at character 8
select '1::1.2.3.300'::ip6;
ERROR:  invalid IP6 value: '1::1.2.3.300' at character 8
select '1::1.2.3.900'::ip6;
ERROR:  invalid IP6 value: '1::1.2.3.900' at character 8
select '1::1.2.300.4'::ip6;
ERROR:  invalid IP6 value: '1::1.2.300.4' at character 8
select '1::1.2.900.4'::ip6;
ERROR:  invalid IP6 value: '1::1.2.900.4' at character 8
select '1::1.256.3.4'::ip6;
ERROR:  invalid IP6 value: '1::1.256.3.4' at character 8
select '1::1.300.3.4'::ip6;
ERROR:  invalid IP6 value: '1::1.300.3.4' at character 8
select '1::1.900.3.4'::ip6;
ERROR:  invalid IP6 value: '1::1.900.3.4' at character 8
select '1::256.2.3.4'::ip6;
ERROR:  invalid IP6 value: '1::256.2.3.4' at character 8
select '1::260.2.3.4'::ip6;
ERROR:  invalid IP6 value: '1::260.2.3.4' at character 8
select '1::2::3'::ip6;
ERROR:  invalid IP6 value: '1::2::3' at character 8
select '1::300.2.3.4'::ip6;
ERROR:  invalid IP6 value: '1::300.2.3.4' at character 8
select '1::300.300.300.300'::ip6;
ERROR:  invalid IP6 value: '1::300.300.300.300' at character 8
select '1::3000.30.30.30'::ip6;
ERROR:  invalid IP6 value: '1::3000.30.30.30' at character 8
select '1::400.2.3.4'::ip6;
ERROR:  invalid IP6 value: '1::400.2.3.4' at character 8
select '1::5:1.2.256.4'::ip6;
ERROR:  invalid IP6 value: '1::5:1.2.256.4' at character 8
select '1::5:1.2.3.256'::ip6;
ERROR:  invalid IP6 value: '1::5:1.2.3.256' at character 8
select '1::5:1.2.3.300'::ip6;
ERROR:  invalid IP6 value: '1::5:1.2.3.300' at character 8
select '1::5:1.2.3.900'::ip6;
ERROR:  invalid IP6 value: '1::5:1.2.3.900' at character 8
select '1::5:1.2.300.4'::ip6;
ERROR:  invalid IP6 value: '1::5:1.2.300.4' at character 8
select '1::5:1.2.900.4'::ip6;
ERROR:  invalid IP6 value: '1::5:1.2.900.4' at character 8
select '1::5:1.256.3.4'::ip6;
ERROR:  invalid IP6 value: '1::5:1.256.3.4' at character 8
select '1::5:1.300.3.4'::ip6;
ERROR:  invalid IP6 value: '1::5:1.300.3.4' at character 8
select '1::5:1.900.3.4'::ip6;
ERROR:  invalid IP6 value: '1::5:1.900.3.4' at character 8
select '1::5:256.2.3.4'::ip6;
ERROR:  invalid IP6 value: '1::5:256.2.3.4' at character 8
select '1::5:260.2.3.4'::ip6;
ERROR:  invalid IP6 value: '1::5:260.2.3.4' at character 8
select '1::5:300.2.3.4'::ip6;
ERROR:  invalid IP6 value: '1::5:300.2.3.4' at character 8
select '1::5:300.300.300.300'::ip6;
ERROR:  invalid IP6 value: '1::5:300.300.300.300' at character 8
select '1::5:3000.30.30.30'::ip6;
ERROR:  invalid IP6 value: '1::5:3000.30.30.30' at character 8
select '1::5:400.2.3.4'::ip6;
ERROR:  invalid IP6 value: '1::5:400.2.3.4' at character 8
select '1::5:900.2.3.4'::ip6;
ERROR:  invalid IP6 value: '1::5:900.2.3.4' at character 8
select '1::900.2.3.4'::ip6;
ERROR:  invalid IP6 value: '1::900.2.3.4' at character 8
select '1:::3:4:5'::ip6;
ERROR:  invalid IP6 value: '1:::3:4:5' at character 8
select '2001:0000:1234: 0000:0000:C1C0:ABCD:0876'::ip6;
ERROR:  invalid IP6 value: '2001:0000:1234: 0000:0000:C1C0:ABCD:0876' at character 8
select '2001:0000:1234:0000:00001:C1C0:ABCD:0876'::ip6;
ERROR:  invalid IP6 value: '2001:0000:1234:0000:00001:C1C0:ABCD:0876' at character 8
select '2001:0000:1234:0000:0000:C1C0:ABCD:0876 0'::ip6;
ERROR:  invalid IP6 value: '2001:0000:1234:0000:0000:C1C0:ABCD:0876 0' at character 8
select '2001::FFD3::57ab'::ip6;
ERROR:  invalid IP6 value: '2001::FFD3::57ab' at character 8
select '2001:DB8:0:0:8:800:200C:417A:221'::ip6;
ERROR:  invalid IP6 value: '2001:DB8:0:0:8:800:200C:417A:221' at character 8
select '2001:db8:85a3::8a2e:37023:7334'::ip6;
ERROR:  invalid IP6 value: '2001:db8:85a3::8a2e:37023:7334' at character 8
select '2001:db8:85a3::8a2e:370k:7334'::ip6;
ERROR:  invalid IP6 value: '2001:db8:85a3::8a2e:370k:7334' at character 8
select '3ffe:0b00:0000:0001:0000:0000:000a'::ip6;
ERROR:  invalid IP6 value: '3ffe:0b00:0000:0001:0000:0000:000a' at character 8
select '3ffe:b00::1::a'::ip6;
ERROR:  invalid IP6 value: '3ffe:b00::1::a' at character 8
select ':'::ip6;
ERROR:  invalid IP6 value: ':' at character 8
select ':1111:2222:3333:4444::5555'::ip6;
ERROR:  invalid IP6 value: ':1111:2222:3333:4444::5555' at character 8
select ':1111:2222:3333::5555'::ip6;
ERROR:  invalid IP6 value: ':1111:2222:3333::5555' at character 8
select ':1111:2222::5555'::ip6;
ERROR:  invalid IP6 value: ':1111:2222::5555' at character 8
select ':1111::5555'::ip6;
ERROR:  invalid IP6 value: ':1111::5555' at character 8
select '::1.2.256.4'::ip6;
ERROR:  invalid IP6 value: '::1.2.256.4' at character 8
select '::1.2.3.256'::ip6;
ERROR:  invalid IP6 value: '::1.2.3.256' at character 8
select '::1.2.3.300'::ip6;
ERROR:  invalid IP6 value: '::1.2.3.300' at character 8
select '::1.2.3.900'::ip6;
ERROR:  invalid IP6 value: '::1.2.3.900' at character 8
select '::1.2.300.4'::ip6;
ERROR:  invalid IP6 value: '::1.2.300.4' at character 8
select '::1.2.900.4'::ip6;
ERROR:  invalid IP6 value: '::1.2.900.4' at character 8
select '::1.256.3.4'::ip6;
ERROR:  invalid IP6 value: '::1.256.3.4' at character 8
select '::1.300.3.4'::ip6;
ERROR:  invalid IP6 value: '::1.300.3.4' at character 8
select '::1.900.3.4'::ip6;
ERROR:  invalid IP6 value: '::1.900.3.4' at character 8
select '::1111:2222:3333:4444:5555:6666::'::ip6;
ERROR:  invalid IP6 value: '::1111:2222:3333:4444:5555:6666::' at character 8
select '::256.2.3.4'::ip6;
ERROR:  invalid IP6 value: '::256.2.3.4' at character 8
select '::260.2.3.4'::ip6;
ERROR:  invalid IP6 value: '::260.2.3.4' at character 8
select '::300.2.3.4'::ip6;
ERROR:  invalid IP6 value: '::300.2.3.4' at character 8
select '::300.300.300.300'::ip6;
ERROR:  invalid IP6 value: '::300.300.300.300' at character 8
select '::3000.30.30.30'::ip6;
ERROR:  invalid IP6 value: '::3000.30.30.30' at character 8
select '::400.2.3.4'::ip6;
ERROR:  invalid IP6 value: '::400.2.3.4' at character 8
select '::5555:'::ip6;
ERROR:  invalid IP6 value: '::5555:' at character 8
select '::900.2.3.4'::ip6;
ERROR:  invalid IP6 value: '::900.2.3.4' at character 8
select ':::'::ip6;
ERROR:  invalid IP6 value: ':::' at character 8
select ':::5555'::ip6;
ERROR:  invalid IP6 value: ':::5555' at character 8
select '::ffff:2.3.4'::ip6;
ERROR:  invalid IP6 value: '::ffff:2.3.4' at character 8
select '::ffff:257.1.2.3'::ip6;
ERROR:  invalid IP6 value: '::ffff:257.1.2.3' at character 8
select 'FF01::101::2'::ip6;
ERROR:  invalid IP6 value: 'FF01::101::2' at character 8
select 'FF02:0000:0000:0000:0000:0000:0000:0000:0001'::ip6;
ERROR:  invalid IP6 value: 'FF02:0000:0000:0000:0000:0000:0000:0000:0001' at character 8
select 'ldkfj'::ip6;
ERROR:  invalid IP6 value: 'ldkfj' at character 8
-- valid ip4r
select '1.2.3.4'::ip4r;
  ip4r   
---------
 1.2.3.4
(1 row)

select '255.255.255.255/32'::ip4r;
      ip4r       
-----------------
 255.255.255.255
(1 row)

select '255.255.255.254/31'::ip4r;
        ip4r        
--------------------
 255.255.255.254/31
(1 row)

select '255.255.255.252/30'::ip4r;
        ip4r        
--------------------
 255.255.255.252/30
(1 row)

select '255.255.255.248/29'::ip4r;
        ip4r        
--------------------
 255.255.255.248/29
(1 row)

select '255.255.255.240/28'::ip4r;
        ip4r        
--------------------
 255.255.255.240/28
(1 row)

select '255.255.255.224/27'::ip4r;
        ip4r        
--------------------
 255.255.255.224/27
(1 row)

select '255.255.255.192/26'::ip4r;
        ip4r        
--------------------
 255.255.255.192/26
(1 row)

select '255.255.255.128/25'::ip4r;
        ip4r        
--------------------
 255.255.255.128/25
(1 row)

select '255.255.255.0/24'::ip4r;
       ip4r       
------------------
 255.255.255.0/24
(1 row)

select '255.255.254.0/23'::ip4r;
       ip4r       
------------------
 255.255.254.0/23
(1 row)

select '255.255.252.0/22'::ip4r;
       ip4r       
------------------
 255.255.252.0/22
(1 row)

select '255.255.248.0/21'::ip4r;
       ip4r       
------------------
 255.255.248.0/21
(1 row)

select '255.255.240.0/20'::ip4r;
       ip4r       
------------------
 255.255.240.0/20
(1 row)

select '255.255.224.0/19'::ip4r;
       ip4r       
------------------
 255.255.224.0/19
(1 row)

select '255.255.192.0/18'::ip4r;
       ip4r       
------------------
 255.255.192.0/18
(1 row)

select '255.255.128.0/17'::ip4r;
       ip4r       
------------------
 255.255.128.0/17
(1 row)

select '255.255.0.0/16'::ip4r;
      ip4r      
----------------
 255.255.0.0/16
(1 row)

select '255.254.0.0/15'::ip4r;
      ip4r      
----------------
 255.254.0.0/15
(1 row)

select '255.252.0.0/14'::ip4r;
      ip4r      
----------------
 255.252.0.0/14
(1 row)

select '255.248.0.0/13'::ip4r;
      ip4r      
----------------
 255.248.0.0/13
(1 row)

select '255.240.0.0/12'::ip4r;
      ip4r      
----------------
 255.240.0.0/12
(1 row)

select '255.224.0.0/11'::ip4r;
      ip4r      
----------------
 255.224.0.0/11
(1 row)

select '255.192.0.0/10'::ip4r;
      ip4r      
----------------
 255.192.0.0/10
(1 row)

select '255.128.0.0/9'::ip4r;
     ip4r      
---------------
 255.128.0.0/9
(1 row)

select '255.0.0.0/8'::ip4r;
    ip4r     
-------------
 255.0.0.0/8
(1 row)

select '254.0.0.0/7'::ip4r;
    ip4r     
-------------
 254.0.0.0/7
(1 row)

select '252.0.0.0/6'::ip4r;
    ip4r     
-------------
 252.0.0.0/6
(1 row)

select '248.0.0.0/5'::ip4r;
    ip4r     
-------------
 248.0.0.0/5
(1 row)

select '240.0.0.0/4'::ip4r;
    ip4r     
-------------
 240.0.0.0/4
(1 row)

select '224.0.0.0/3'::ip4r;
    ip4r     
-------------
 224.0.0.0/3
(1 row)

select '192.0.0.0/2'::ip4r;
    ip4r     
-------------
 192.0.0.0/2
(1 row)

select '128.0.0.0/1'::ip4r;
    ip4r     
-------------
 128.0.0.0/1
(1 row)

select '0.0.0.0/0'::ip4r;
   ip4r    
-----------
 0.0.0.0/0
(1 row)

select '1.2.3.4-5.6.7.8'::ip4r;
      ip4r       
-----------------
 1.2.3.4-5.6.7.8
(1 row)

select '5.6.7.8-1.2.3.4'::ip4r;
      ip4r       
-----------------
 1.2.3.4-5.6.7.8
(1 row)

select '1.2.3.4-1.2.3.4'::ip4r;
  ip4r   
---------
 1.2.3.4
(1 row)

-- invalid ip4r
select '1.2.3'::ip4r;
ERROR:  invalid IP4R value: "1.2.3" at character 8
select '255.255.255.255.255.255.255.255.255'::ip4r;
ERROR:  invalid IP4R value: "255.255.255.255.255.255.255.255.255" at character 8
select '255.255.255.255.255-255.255.255.255.255'::ip4r;
ERROR:  invalid IP4R value: "255.255.255.255.255-255.255.255.255.255" at character 8
select '255.255.255.255-1.2.3.4.5'::ip4r;
ERROR:  invalid IP4R value: "255.255.255.255-1.2.3.4.5" at character 8
select '255.255.255.255-1.2.3'::ip4r;
ERROR:  invalid IP4R value: "255.255.255.255-1.2.3" at character 8
select '0.0.0.1/31'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/31" at character 8
select '0.0.0.1/30'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/30" at character 8
select '0.0.0.1/29'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/29" at character 8
select '0.0.0.1/28'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/28" at character 8
select '0.0.0.1/27'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/27" at character 8
select '0.0.0.1/26'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/26" at character 8
select '0.0.0.1/25'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/25" at character 8
select '0.0.0.1/24'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/24" at character 8
select '0.0.0.1/23'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/23" at character 8
select '0.0.0.1/22'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/22" at character 8
select '0.0.0.1/21'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/21" at character 8
select '0.0.0.1/20'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/20" at character 8
select '0.0.0.1/19'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/19" at character 8
select '0.0.0.1/18'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/18" at character 8
select '0.0.0.1/17'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/17" at character 8
select '0.0.0.1/16'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/16" at character 8
select '0.0.0.1/15'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/15" at character 8
select '0.0.0.1/14'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/14" at character 8
select '0.0.0.1/13'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/13" at character 8
select '0.0.0.1/12'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/12" at character 8
select '0.0.0.1/11'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/11" at character 8
select '0.0.0.1/10'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/10" at character 8
select '0.0.0.1/9'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/9" at character 8
select '0.0.0.1/8'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/8" at character 8
select '0.0.0.1/7'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/7" at character 8
select '0.0.0.1/6'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/6" at character 8
select '0.0.0.1/5'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/5" at character 8
select '0.0.0.1/4'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/4" at character 8
select '0.0.0.1/3'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/3" at character 8
select '0.0.0.1/2'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/2" at character 8
select '0.0.0.1/1'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/1" at character 8
select '0.0.0.1/0'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.1/0" at character 8
select '0.0.0.2/30'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.2/30" at character 8
select '0.0.0.4/29'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.4/29" at character 8
select '0.0.0.8/28'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.8/28" at character 8
select '0.0.0.16/27'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.16/27" at character 8
select '0.0.0.32/26'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.32/26" at character 8
select '0.0.0.64/25'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.64/25" at character 8
select '0.0.0.128/24'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.128/24" at character 8
select '0.0.1.0/23'::ip4r;
ERROR:  invalid IP4R value: "0.0.1.0/23" at character 8
select '0.0.2.0/22'::ip4r;
ERROR:  invalid IP4R value: "0.0.2.0/22" at character 8
select '0.0.4.0/21'::ip4r;
ERROR:  invalid IP4R value: "0.0.4.0/21" at character 8
select '0.0.8.0/20'::ip4r;
ERROR:  invalid IP4R value: "0.0.8.0/20" at character 8
select '0.0.16.0/19'::ip4r;
ERROR:  invalid IP4R value: "0.0.16.0/19" at character 8
select '0.0.32.0/18'::ip4r;
ERROR:  invalid IP4R value: "0.0.32.0/18" at character 8
select '0.0.64.0/17'::ip4r;
ERROR:  invalid IP4R value: "0.0.64.0/17" at character 8
select '0.0.128.0/16'::ip4r;
ERROR:  invalid IP4R value: "0.0.128.0/16" at character 8
select '0.1.0.0/15'::ip4r;
ERROR:  invalid IP4R value: "0.1.0.0/15" at character 8
select '0.2.0.0/14'::ip4r;
ERROR:  invalid IP4R value: "0.2.0.0/14" at character 8
select '0.4.0.0/13'::ip4r;
ERROR:  invalid IP4R value: "0.4.0.0/13" at character 8
select '0.8.0.0/12'::ip4r;
ERROR:  invalid IP4R value: "0.8.0.0/12" at character 8
select '0.16.0.0/11'::ip4r;
ERROR:  invalid IP4R value: "0.16.0.0/11" at character 8
select '0.32.0.0/10'::ip4r;
ERROR:  invalid IP4R value: "0.32.0.0/10" at character 8
select '0.64.0.0/9'::ip4r;
ERROR:  invalid IP4R value: "0.64.0.0/9" at character 8
select '0.128.0.0/8'::ip4r;
ERROR:  invalid IP4R value: "0.128.0.0/8" at character 8
select '1.0.0.0/7'::ip4r;
ERROR:  invalid IP4R value: "1.0.0.0/7" at character 8
select '2.0.0.0/6'::ip4r;
ERROR:  invalid IP4R value: "2.0.0.0/6" at character 8
select '4.0.0.0/5'::ip4r;
ERROR:  invalid IP4R value: "4.0.0.0/5" at character 8
select '8.0.0.0/4'::ip4r;
ERROR:  invalid IP4R value: "8.0.0.0/4" at character 8
select '16.0.0.0/3'::ip4r;
ERROR:  invalid IP4R value: "16.0.0.0/3" at character 8
select '32.0.0.0/2'::ip4r;
ERROR:  invalid IP4R value: "32.0.0.0/2" at character 8
select '64.0.0.0/1'::ip4r;
ERROR:  invalid IP4R value: "64.0.0.0/1" at character 8
select '128.0.0.0/0'::ip4r;
ERROR:  invalid IP4R value: "128.0.0.0/0" at character 8
select '0.0.0.0/33'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.0/33" at character 8
select '0.0.0.0/3.0'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.0/3.0" at character 8
select '0.0.0.0/+33'::ip4r;
ERROR:  invalid IP4R value: "0.0.0.0/+33" at character 8
-- valid ip6r
select '::'::ip6r;
 ip6r 
------
 ::
(1 row)

select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'::ip6r;
                  ip6r                   
-----------------------------------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
(1 row)

select '1::2'::ip6r;
 ip6r 
------
 1::2
(1 row)

select '::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'::ip6r;
 ip6r 
------
 ::/0
(1 row)

select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::'::ip6r;
 ip6r 
------
 ::/0
(1 row)

select '1::2-3::4'::ip6r;
   ip6r    
-----------
 1::2-3::4
(1 row)

select '3::4-3::4'::ip6r;
 ip6r 
------
 3::4
(1 row)

select '3::4-1::2'::ip6r;
   ip6r    
-----------
 1::2-3::4
(1 row)

select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128'::ip6r;
                  ip6r                   
-----------------------------------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
(1 row)

select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe/127'::ip6r;
                    ip6r                     
---------------------------------------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe/127
(1 row)

select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffc/126'::ip6r;
                    ip6r                     
---------------------------------------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffc/126
(1 row)

select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff8/125'::ip6r;
                    ip6r                     
---------------------------------------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff8/125
(1 row)

select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0/124'::ip6r;
                    ip6r                     
---------------------------------------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0/124
(1 row)

select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ff00/120'::ip6r;
                    ip6r                     
---------------------------------------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ff00/120
(1 row)

select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:f000/116'::ip6r;
                    ip6r                     
---------------------------------------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:f000/116
(1 row)

select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:0000/112'::ip6r;
                   ip6r                   
------------------------------------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:0/112
(1 row)

select 'ffff:ffff:ffff:ffff:ffff:ffff:0000:0000/96'::ip6r;
                ip6r                
------------------------------------
 ffff:ffff:ffff:ffff:ffff:ffff::/96
(1 row)

select 'ffff:ffff:ffff:ffff:ffff:0000:0000:0000/80'::ip6r;
             ip6r              
-------------------------------
 ffff:ffff:ffff:ffff:ffff::/80
(1 row)

select 'ffff:ffff:ffff:ffff:fff0:0000:0000:0000/76'::ip6r;
             ip6r              
-------------------------------
 ffff:ffff:ffff:ffff:fff0::/76
(1 row)

select 'ffff:ffff:ffff:ffff:ff00:0000:0000:0000/72'::ip6r;
             ip6r              
-------------------------------
 ffff:ffff:ffff:ffff:ff00::/72
(1 row)

select 'ffff:ffff:ffff:ffff:f000:0000:0000:0000/68'::ip6r;
             ip6r              
-------------------------------
 ffff:ffff:ffff:ffff:f000::/68
(1 row)

select 'ffff:ffff:ffff:ffff:e000:0000:0000:0000/67'::ip6r;
             ip6r              
-------------------------------
 ffff:ffff:ffff:ffff:e000::/67
(1 row)

select 'ffff:ffff:ffff:ffff:c000:0000:0000:0000/66'::ip6r;
             ip6r              
-------------------------------
 ffff:ffff:ffff:ffff:c000::/66
(1 row)

select 'ffff:ffff:ffff:ffff:8000:0000:0000:0000/65'::ip6r;
             ip6r              
-------------------------------
 ffff:ffff:ffff:ffff:8000::/65
(1 row)

select 'ffff:ffff:ffff:ffff:0000:0000:0000:0000/64'::ip6r;
           ip6r           
--------------------------
 ffff:ffff:ffff:ffff::/64
(1 row)

select 'ffff:ffff:ffff:fffe:0000:0000:0000:0000/63'::ip6r;
           ip6r           
--------------------------
 ffff:ffff:ffff:fffe::/63
(1 row)

select 'ffff:ffff:ffff:fffc:0000:0000:0000:0000/62'::ip6r;
           ip6r           
--------------------------
 ffff:ffff:ffff:fffc::/62
(1 row)

select 'ffff:ffff:ffff:fff8:0000:0000:0000:0000/61'::ip6r;
           ip6r           
--------------------------
 ffff:ffff:ffff:fff8::/61
(1 row)

select 'ffff:ffff:ffff:fff0:0000:0000:0000:0000/60'::ip6r;
           ip6r           
--------------------------
 ffff:ffff:ffff:fff0::/60
(1 row)

select 'ffff:ffff:ffff:ff00:0000:0000:0000:0000/56'::ip6r;
           ip6r           
--------------------------
 ffff:ffff:ffff:ff00::/56
(1 row)

select 'ffff:ffff:ffff:f000:0000:0000:0000:0000/52'::ip6r;
           ip6r           
--------------------------
 ffff:ffff:ffff:f000::/52
(1 row)

select 'ffff:ffff:ffff:0000:0000:0000:0000:0000/48'::ip6r;
        ip6r         
---------------------
 ffff:ffff:ffff::/48
(1 row)

select 'ffff:ffff:0000:0000:0000:0000:0000:0000/32'::ip6r;
      ip6r      
----------------
 ffff:ffff::/32
(1 row)

select 'ffff:0000:0000:0000:0000:0000:0000:0000/16'::ip6r;
   ip6r    
-----------
 ffff::/16
(1 row)

select 'fff0:0000:0000:0000:0000:0000:0000:0000/12'::ip6r;
   ip6r    
-----------
 fff0::/12
(1 row)

select 'ff00:0000:0000:0000:0000:0000:0000:0000/8'::ip6r;
   ip6r   
----------
 ff00::/8
(1 row)

select 'f000:0000:0000:0000:0000:0000:0000:0000/4'::ip6r;
   ip6r   
----------
 f000::/4
(1 row)

select 'e000:0000:0000:0000:0000:0000:0000:0000/3'::ip6r;
   ip6r   
----------
 e000::/3
(1 row)

select 'c000:0000:0000:0000:0000:0000:0000:0000/2'::ip6r;
   ip6r   
----------
 c000::/2
(1 row)

select '8000:0000:0000:0000:0000:0000:0000:0000/1'::ip6r;
   ip6r   
----------
 8000::/1
(1 row)

select '0000:0000:0000:0000:0000:0000:0000:0000/0'::ip6r;
 ip6r 
------
 ::/0
(1 row)

-- invalid ip6r
select '::-::-::'::ip6r;
ERROR:  invalid IP6R value: "::-::-::" at character 8
select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff-ffff'::ip6r;
ERROR:  invalid IP6R value: "ffff:ffff:ffff:ffff:ffff:ffff:ffff-ffff" at character 8
select '::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'::ip6r;
ERROR:  invalid IP6R value: "::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" at character 8
select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::'::ip6r;
ERROR:  invalid IP6R value: "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::" at character 8
select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128'::ip6r;
ERROR:  invalid IP6R value: "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0001/127'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/127" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0001/120'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/120" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0001/112'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/112" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0001/96'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/96" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0001/80'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/80" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0001/64'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/64" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0001/48'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/48" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0001/32'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/32" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0001/16'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/16" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0001/8'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/8" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0001/4'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/4" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0001/0'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0001/0" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0008/124'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0008/124" at character 8
select '0000:0000:0000:0000:0000:0000:0000:0080/120'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:0080/120" at character 8
select '0000:0000:0000:0000:0000:0000:0000:8000/112'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:0000:8000/112" at character 8
select '0000:0000:0000:0000:0000:0000:8000:0000/96'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:0000:8000:0000/96" at character 8
select '0000:0000:0000:0000:0000:8000:0000:0000/80'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:0000:8000:0000:0000/80" at character 8
select '0000:0000:0000:0000:8000:0000:0000:0000/64'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:0000:8000:0000:0000:0000/64" at character 8
select '0000:0000:0000:8000:0000:0000:0000:0000/48'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:0000:8000:0000:0000:0000:0000/48" at character 8
select '0000:0000:8000:0000:0000:0000:0000:0000/32'::ip6r;
ERROR:  invalid IP6R value: "0000:0000:8000:0000:0000:0000:0000:0000/32" at character 8
select '0000:8000:0000:0000:0000:0000:0000:0000/16'::ip6r;
ERROR:  invalid IP6R value: "0000:8000:0000:0000:0000:0000:0000:0000/16" at character 8
select '0080:0000:0000:0000:0000:0000:0000:0000/8'::ip6r;
ERROR:  invalid IP6R value: "0080:0000:0000:0000:0000:0000:0000:0000/8" at character 8
select '0800:0000:0000:0000:0000:0000:0000:0000/4'::ip6r;
ERROR:  invalid IP6R value: "0800:0000:0000:0000:0000:0000:0000:0000/4" at character 8
select '8000:0000:0000:0000:0000:0000:0000:0000/0'::ip6r;
ERROR:  invalid IP6R value: "8000:0000:0000:0000:0000:0000:0000:0000/0" at character 8
select '::/129'::ip6r;
ERROR:  invalid IP6R value: "::/129" at character 8
select '::/255'::ip6r;
ERROR:  invalid IP6R value: "::/255" at character 8
select '::/256'::ip6r;
ERROR:  invalid IP6R value: "::/256" at character 8
select '::/+0'::ip6r;
ERROR:  invalid IP6R value: "::/+0" at character 8
select '::/0-0'::ip6r;
ERROR:  invalid IP6R value: "::/0-0" at character 8
select '::-::/0'::ip6r;
ERROR:  invalid IP6R value: "::-::/0" at character 8
-- valid ipaddress
select a, family(a) from (select '1.2.3.4'::ipaddress as a) s1;
    a    | family 
---------+--------
 1.2.3.4 |      4
(1 row)

select a, family(a) from (select '0.0.0.0'::ipaddress as a) s1;
    a    | family 
---------+--------
 0.0.0.0 |      4
(1 row)

select a, family(a) from (select '255.255.255.255'::ipaddress as a) s1;
        a        | family 
-----------------+--------
 255.255.255.255 |      4
(1 row)

select a, family(a) from (select '0.0.0.255'::ipaddress as a) s1;
     a     | family 
-----------+--------
 0.0.0.255 |      4
(1 row)

select a, family(a) from (select '0.0.255.0'::ipaddress as a) s1;
     a     | family 
-----------+--------
 0.0.255.0 |      4
(1 row)

select a, family(a) from (select '0.255.0.0'::ipaddress as a) s1;
     a     | family 
-----------+--------
 0.255.0.0 |      4
(1 row)

select a, family(a) from (select '255.0.0.0'::ipaddress as a) s1;
     a     | family 
-----------+--------
 255.0.0.0 |      4
(1 row)

select a, family(a) from (select '192.168.123.210'::ipaddress as a) s1;
        a        | family 
-----------------+--------
 192.168.123.210 |      4
(1 row)

select a, family(a) from (select '127.0.0.1'::ipaddress as a) s1;
     a     | family 
-----------+--------
 127.0.0.1 |      4
(1 row)

select a, family(a) from (select '0000:0000:0000:0000:0000:0000:0000:0000'::ipaddress as a) s1;
 a  | family 
----+--------
 :: |      6
(1 row)

select a, family(a) from (select '0000:0000:0000:0000:0000:0000:0000:0001'::ipaddress as a) s1;
  a  | family 
-----+--------
 ::1 |      6
(1 row)

select a, family(a) from (select '0:0:0:0:0:0:0:0'::ipaddress as a) s1;
 a  | family 
----+--------
 :: |      6
(1 row)

select a, family(a) from (select '0:0:0:0:0:0:0:1'::ipaddress as a) s1;
  a  | family 
-----+--------
 ::1 |      6
(1 row)

select a, family(a) from (select '0:0:0:0:0:0:13.1.68.3'::ipaddress as a) s1;
      a      | family 
-------------+--------
 ::13.1.68.3 |      6
(1 row)

select a, family(a) from (select '0:0:0:0:0:FFFF:129.144.52.38'::ipaddress as a) s1;
          a           | family 
----------------------+--------
 ::ffff:129.144.52.38 |      6
(1 row)

select a, family(a) from (select '0::0'::ipaddress as a) s1;
 a  | family 
----+--------
 :: |      6
(1 row)

select a, family(a) from (select '1:2:3:4:5:6:1.2.3.4'::ipaddress as a) s1;
          a          | family 
---------------------+--------
 1:2:3:4:5:6:102:304 |      6
(1 row)

select a, family(a) from (select '1:2:3:4:5:6:7:8'::ipaddress as a) s1;
        a        | family 
-----------------+--------
 1:2:3:4:5:6:7:8 |      6
(1 row)

select a, family(a) from (select '1:2:3:4:5:6::'::ipaddress as a) s1;
       a       | family 
---------------+--------
 1:2:3:4:5:6:: |      6
(1 row)

select a, family(a) from (select '1:2:3:4:5:6::8'::ipaddress as a) s1;
        a        | family 
-----------------+--------
 1:2:3:4:5:6:0:8 |      6
(1 row)

select a, family(a) from (select '1:2:3:4:5::'::ipaddress as a) s1;
      a      | family 
-------------+--------
 1:2:3:4:5:: |      6
(1 row)

select a, family(a) from (select '1:2:3:4:5::1.2.3.4'::ipaddress as a) s1;
          a          | family 
---------------------+--------
 1:2:3:4:5:0:102:304 |      6
(1 row)

select a, family(a) from (select '1:2:3:4:5::7:8'::ipaddress as a) s1;
        a        | family 
-----------------+--------
 1:2:3:4:5:0:7:8 |      6
(1 row)

select a, family(a) from (select '1:2:3:4:5::8'::ipaddress as a) s1;
      a       | family 
--------------+--------
 1:2:3:4:5::8 |      6
(1 row)

select a, family(a) from (select '1:2:3:4::'::ipaddress as a) s1;
     a     | family 
-----------+--------
 1:2:3:4:: |      6
(1 row)

select a, family(a) from (select '1:2:3:4::1.2.3.4'::ipaddress as a) s1;
        a         | family 
------------------+--------
 1:2:3:4::102:304 |      6
(1 row)

select a, family(a) from (select '1:2:3:4::5:1.2.3.4'::ipaddress as a) s1;
          a          | family 
---------------------+--------
 1:2:3:4:0:5:102:304 |      6
(1 row)

select a, family(a) from (select '1:2:3:4::7:8'::ipaddress as a) s1;
      a       | family 
--------------+--------
 1:2:3:4::7:8 |      6
(1 row)

select a, family(a) from (select '1:2:3:4::8'::ipaddress as a) s1;
     a      | family 
------------+--------
 1:2:3:4::8 |      6
(1 row)

select a, family(a) from (select '1:2:3::'::ipaddress as a) s1;
    a    | family 
---------+--------
 1:2:3:: |      6
(1 row)

select a, family(a) from (select '1:2:3::1.2.3.4'::ipaddress as a) s1;
       a        | family 
----------------+--------
 1:2:3::102:304 |      6
(1 row)

select a, family(a) from (select '1:2:3::5:1.2.3.4'::ipaddress as a) s1;
        a         | family 
------------------+--------
 1:2:3::5:102:304 |      6
(1 row)

select a, family(a) from (select '1:2:3::7:8'::ipaddress as a) s1;
     a      | family 
------------+--------
 1:2:3::7:8 |      6
(1 row)

select a, family(a) from (select '1:2:3::8'::ipaddress as a) s1;
    a     | family 
----------+--------
 1:2:3::8 |      6
(1 row)

select a, family(a) from (select '1:2::'::ipaddress as a) s1;
   a   | family 
-------+--------
 1:2:: |      6
(1 row)

select a, family(a) from (select '1:2::1.2.3.4'::ipaddress as a) s1;
      a       | family 
--------------+--------
 1:2::102:304 |      6
(1 row)

select a, family(a) from (select '1:2::5:1.2.3.4'::ipaddress as a) s1;
       a        | family 
----------------+--------
 1:2::5:102:304 |      6
(1 row)

select a, family(a) from (select '1:2::7:8'::ipaddress as a) s1;
    a     | family 
----------+--------
 1:2::7:8 |      6
(1 row)

select a, family(a) from (select '1:2::8'::ipaddress as a) s1;
   a    | family 
--------+--------
 1:2::8 |      6
(1 row)

select a, family(a) from (select '1::'::ipaddress as a) s1;
  a  | family 
-----+--------
 1:: |      6
(1 row)

select a, family(a) from (select '1::1.2.3.4'::ipaddress as a) s1;
     a      | family 
------------+--------
 1::102:304 |      6
(1 row)

select a, family(a) from (select '1::2:3'::ipaddress as a) s1;
   a    | family 
--------+--------
 1::2:3 |      6
(1 row)

select a, family(a) from (select '1::2:3:4'::ipaddress as a) s1;
    a     | family 
----------+--------
 1::2:3:4 |      6
(1 row)

select a, family(a) from (select '1::2:3:4:5'::ipaddress as a) s1;
     a      | family 
------------+--------
 1::2:3:4:5 |      6
(1 row)

select a, family(a) from (select '1::2:3:4:5:6'::ipaddress as a) s1;
      a       | family 
--------------+--------
 1::2:3:4:5:6 |      6
(1 row)

select a, family(a) from (select '1::2:3:4:5:6:7'::ipaddress as a) s1;
        a        | family 
-----------------+--------
 1:0:2:3:4:5:6:7 |      6
(1 row)

select a, family(a) from (select '1::5:1.2.3.4'::ipaddress as a) s1;
      a       | family 
--------------+--------
 1::5:102:304 |      6
(1 row)

select a, family(a) from (select '1::5:11.22.33.44'::ipaddress as a) s1;
       a       | family 
---------------+--------
 1::5:b16:212c |      6
(1 row)

select a, family(a) from (select '1::7:8'::ipaddress as a) s1;
   a    | family 
--------+--------
 1::7:8 |      6
(1 row)

select a, family(a) from (select '1::8'::ipaddress as a) s1;
  a   | family 
------+--------
 1::8 |      6
(1 row)

select a, family(a) from (select '2001:0000:1234:0000:0000:C1C0:ABCD:0876'::ipaddress as a) s1;
             a              | family 
----------------------------+--------
 2001:0:1234::c1c0:abcd:876 |      6
(1 row)

select a, family(a) from (select '2001:0db8:0000:0000:0000:0000:1428:57ab'::ipaddress as a) s1;
          a          | family 
---------------------+--------
 2001:db8::1428:57ab |      6
(1 row)

select a, family(a) from (select '2001:0db8:0000:0000:0000::1428:57ab'::ipaddress as a) s1;
          a          | family 
---------------------+--------
 2001:db8::1428:57ab |      6
(1 row)

select a, family(a) from (select '2001:0db8:0:0:0:0:1428:57ab'::ipaddress as a) s1;
          a          | family 
---------------------+--------
 2001:db8::1428:57ab |      6
(1 row)

select a, family(a) from (select '2001:0db8:0:0::1428:57ab'::ipaddress as a) s1;
          a          | family 
---------------------+--------
 2001:db8::1428:57ab |      6
(1 row)

select a, family(a) from (select '2001:0db8:1234:0000:0000:0000:0000:0000'::ipaddress as a) s1;
        a        | family 
-----------------+--------
 2001:db8:1234:: |      6
(1 row)

select a, family(a) from (select '2001:0db8:1234::'::ipaddress as a) s1;
        a        | family 
-----------------+--------
 2001:db8:1234:: |      6
(1 row)

select a, family(a) from (select '2001:0db8:1234:ffff:ffff:ffff:ffff:ffff'::ipaddress as a) s1;
                   a                    | family 
----------------------------------------+--------
 2001:db8:1234:ffff:ffff:ffff:ffff:ffff |      6
(1 row)

select a, family(a) from (select '2001:0db8:85a3:0000:0000:8a2e:0370:7334'::ipaddress as a) s1;
              a               | family 
------------------------------+--------
 2001:db8:85a3::8a2e:370:7334 |      6
(1 row)

select a, family(a) from (select '2001:0db8::1428:57ab'::ipaddress as a) s1;
          a          | family 
---------------------+--------
 2001:db8::1428:57ab |      6
(1 row)

select a, family(a) from (select '2001:10::'::ipaddress as a) s1;
     a     | family 
-----------+--------
 2001:10:: |      6
(1 row)

select a, family(a) from (select '2001::'::ipaddress as a) s1;
   a    | family 
--------+--------
 2001:: |      6
(1 row)

select a, family(a) from (select '2001:DB8:0:0:8:800:200C:417A'::ipaddress as a) s1;
             a             | family 
---------------------------+--------
 2001:db8::8:800:200c:417a |      6
(1 row)

select a, family(a) from (select '2001:DB8::8:800:200C:417A'::ipaddress as a) s1;
             a             | family 
---------------------------+--------
 2001:db8::8:800:200c:417a |      6
(1 row)

select a, family(a) from (select '2001:db8:85a3:0:0:8a2e:370:7334'::ipaddress as a) s1;
              a               | family 
------------------------------+--------
 2001:db8:85a3::8a2e:370:7334 |      6
(1 row)

select a, family(a) from (select '2001:db8:85a3::8a2e:370:7334'::ipaddress as a) s1;
              a               | family 
------------------------------+--------
 2001:db8:85a3::8a2e:370:7334 |      6
(1 row)

select a, family(a) from (select '2001:db8::'::ipaddress as a) s1;
     a      | family 
------------+--------
 2001:db8:: |      6
(1 row)

select a, family(a) from (select '2001:db8::'::ipaddress as a) s1;
     a      | family 
------------+--------
 2001:db8:: |      6
(1 row)

select a, family(a) from (select '2001:db8::1428:57ab'::ipaddress as a) s1;
          a          | family 
---------------------+--------
 2001:db8::1428:57ab |      6
(1 row)

select a, family(a) from (select '2001:db8:a::123'::ipaddress as a) s1;
        a        | family 
-----------------+--------
 2001:db8:a::123 |      6
(1 row)

select a, family(a) from (select '2002::'::ipaddress as a) s1;
   a    | family 
--------+--------
 2002:: |      6
(1 row)

select a, family(a) from (select '2::10'::ipaddress as a) s1;
   a   | family 
-------+--------
 2::10 |      6
(1 row)

select a, family(a) from (select '3ffe:0b00:0000:0000:0001:0000:0000:000a'::ipaddress as a) s1;
         a         | family 
-------------------+--------
 3ffe:b00::1:0:0:a |      6
(1 row)

select a, family(a) from (select '::'::ipaddress as a) s1;
 a  | family 
----+--------
 :: |      6
(1 row)

select a, family(a) from (select '::1'::ipaddress as a) s1;
  a  | family 
-----+--------
 ::1 |      6
(1 row)

select a, family(a) from (select '::127.0.0.1'::ipaddress as a) s1;
      a      | family 
-------------+--------
 ::127.0.0.1 |      6
(1 row)

select a, family(a) from (select '::13.1.68.3'::ipaddress as a) s1;
      a      | family 
-------------+--------
 ::13.1.68.3 |      6
(1 row)

select a, family(a) from (select '::2:3'::ipaddress as a) s1;
     a     | family 
-----------+--------
 ::0.2.0.3 |      6
(1 row)

select a, family(a) from (select '::2:3:4'::ipaddress as a) s1;
    a    | family 
---------+--------
 ::2:3:4 |      6
(1 row)

select a, family(a) from (select '::2:3:4:5'::ipaddress as a) s1;
     a     | family 
-----------+--------
 ::2:3:4:5 |      6
(1 row)

select a, family(a) from (select '::2:3:4:5:6'::ipaddress as a) s1;
      a      | family 
-------------+--------
 ::2:3:4:5:6 |      6
(1 row)

select a, family(a) from (select '::2:3:4:5:6:7'::ipaddress as a) s1;
       a       | family 
---------------+--------
 ::2:3:4:5:6:7 |      6
(1 row)

select a, family(a) from (select '::2:3:4:5:6:7:8'::ipaddress as a) s1;
        a        | family 
-----------------+--------
 0:2:3:4:5:6:7:8 |      6
(1 row)

select a, family(a) from (select '::8'::ipaddress as a) s1;
  a  | family 
-----+--------
 ::8 |      6
(1 row)

select a, family(a) from (select '::FFFF:129.144.52.38'::ipaddress as a) s1;
          a           | family 
----------------------+--------
 ::ffff:129.144.52.38 |      6
(1 row)

select a, family(a) from (select '::ffff:0:0'::ipaddress as a) s1;
       a        | family 
----------------+--------
 ::ffff:0.0.0.0 |      6
(1 row)

select a, family(a) from (select '::ffff:0:192.168.1.1'::ipaddress as a) s1;
          a           | family 
----------------------+--------
 ::ffff:0:192.168.1.1 |      6
(1 row)

select a, family(a) from (select '::ffff:1:1.2.3.4'::ipaddress as a) s1;
        a         | family 
------------------+--------
 ::ffff:1:102:304 |      6
(1 row)

select a, family(a) from (select '::ffff:0c22:384e'::ipaddress as a) s1;
         a          | family 
--------------------+--------
 ::ffff:12.34.56.78 |      6
(1 row)

select a, family(a) from (select '::ffff:12.34.56.78'::ipaddress as a) s1;
         a          | family 
--------------------+--------
 ::ffff:12.34.56.78 |      6
(1 row)

select a, family(a) from (select '::ffff:192.0.2.128'::ipaddress as a) s1;
         a          | family 
--------------------+--------
 ::ffff:192.0.2.128 |      6
(1 row)

select a, family(a) from (select '::ffff:192.168.1.1'::ipaddress as a) s1;
         a          | family 
--------------------+--------
 ::ffff:192.168.1.1 |      6
(1 row)

select a, family(a) from (select '::ffff:192.168.1.26'::ipaddress as a) s1;
          a          | family 
---------------------+--------
 ::ffff:192.168.1.26 |      6
(1 row)

select a, family(a) from (select '::ffff:c000:280'::ipaddress as a) s1;
         a          | family 
--------------------+--------
 ::ffff:192.0.2.128 |      6
(1 row)

select a, family(a) from (select 'FF01:0:0:0:0:0:0:101'::ipaddress as a) s1;
     a     | family 
-----------+--------
 ff01::101 |      6
(1 row)

select a, family(a) from (select 'FF01::101'::ipaddress as a) s1;
     a     | family 
-----------+--------
 ff01::101 |      6
(1 row)

select a, family(a) from (select 'FF02:0000:0000:0000:0000:0000:0000:0001'::ipaddress as a) s1;
    a    | family 
---------+--------
 ff02::1 |      6
(1 row)

select a, family(a) from (select 'fc00::'::ipaddress as a) s1;
   a    | family 
--------+--------
 fc00:: |      6
(1 row)

select a, family(a) from (select 'fe80:0000:0000:0000:0204:61ff:fe9d:f156'::ipaddress as a) s1;
            a             | family 
--------------------------+--------
 fe80::204:61ff:fe9d:f156 |      6
(1 row)

select a, family(a) from (select 'fe80:0:0:0:204:61ff:254.157.241.86'::ipaddress as a) s1;
            a             | family 
--------------------------+--------
 fe80::204:61ff:fe9d:f156 |      6
(1 row)

select a, family(a) from (select 'fe80:0:0:0:204:61ff:fe9d:f156'::ipaddress as a) s1;
            a             | family 
--------------------------+--------
 fe80::204:61ff:fe9d:f156 |      6
(1 row)

select a, family(a) from (select 'fe80::'::ipaddress as a) s1;
   a    | family 
--------+--------
 fe80:: |      6
(1 row)

select a, family(a) from (select 'fe80::1'::ipaddress as a) s1;
    a    | family 
---------+--------
 fe80::1 |      6
(1 row)

select a, family(a) from (select 'fe80::204:61ff:254.157.241.86'::ipaddress as a) s1;
            a             | family 
--------------------------+--------
 fe80::204:61ff:fe9d:f156 |      6
(1 row)

select a, family(a) from (select 'fe80::204:61ff:fe9d:f156'::ipaddress as a) s1;
            a             | family 
--------------------------+--------
 fe80::204:61ff:fe9d:f156 |      6
(1 row)

select a, family(a) from (select 'fe80::217:f2ff:254.7.237.98'::ipaddress as a) s1;
            a             | family 
--------------------------+--------
 fe80::217:f2ff:fe07:ed62 |      6
(1 row)

select a, family(a) from (select 'fe80::217:f2ff:fe07:ed62'::ipaddress as a) s1;
            a             | family 
--------------------------+--------
 fe80::217:f2ff:fe07:ed62 |      6
(1 row)

select a, family(a) from (select 'ff02::1'::ipaddress as a) s1;
    a    | family 
---------+--------
 ff02::1 |      6
(1 row)

-- invalid ipaddress
select '1.2.3'::ipaddress;
ERROR:  invalid IP value: '1.2.3' at character 8
select '0'::ipaddress;
ERROR:  invalid IP value: '0' at character 8
select ' 1.2.3.4'::ipaddress;
ERROR:  invalid IP value: ' 1.2.3.4' at character 8
select '1.2.3.4 '::ipaddress;
ERROR:  invalid IP value: '1.2.3.4 ' at character 8
select '0.0.0.256'::ipaddress;
ERROR:  invalid IP value: '0.0.0.256' at character 8
select '0.0.256'::ipaddress;
ERROR:  invalid IP value: '0.0.256' at character 8
select '0..255.0'::ipaddress;
ERROR:  invalid IP value: '0..255.0' at character 8
select '+0.255.0.0'::ipaddress;
ERROR:  invalid IP value: '+0.255.0.0' at character 8
select '1.2.3.4-1.2.3.4'::ipaddress;
ERROR:  invalid IP value: '1.2.3.4-1.2.3.4' at character 8
select ''::ipaddress;
ERROR:  invalid IP value: '' at character 8
select '02001:0000:1234:0000:0000:C1C0:ABCD:0876'::ipaddress;
ERROR:  invalid IP value: '02001:0000:1234:0000:0000:C1C0:ABCD:0876' at character 8
select '1.2.3.4:1111:2222:3333:4444::5555'::ipaddress;
ERROR:  invalid IP value: '1.2.3.4:1111:2222:3333:4444::5555' at character 8
select '1.2.3.4:1111:2222:3333::5555'::ipaddress;
ERROR:  invalid IP value: '1.2.3.4:1111:2222:3333::5555' at character 8
select '1.2.3.4:1111:2222::5555'::ipaddress;
ERROR:  invalid IP value: '1.2.3.4:1111:2222::5555' at character 8
select '1.2.3.4:1111::5555'::ipaddress;
ERROR:  invalid IP value: '1.2.3.4:1111::5555' at character 8
select '1.2.3.4::'::ipaddress;
ERROR:  invalid IP value: '1.2.3.4::' at character 8
select '1.2.3.4::5555'::ipaddress;
ERROR:  invalid IP value: '1.2.3.4::5555' at character 8
select '1111:'::ipaddress;
ERROR:  invalid IP value: '1111:' at character 8
select '1111:2222:3333:4444::5555:'::ipaddress;
ERROR:  invalid IP value: '1111:2222:3333:4444::5555:' at character 8
select '1111:2222:3333::5555:'::ipaddress;
ERROR:  invalid IP value: '1111:2222:3333::5555:' at character 8
select '1111:2222::5555:'::ipaddress;
ERROR:  invalid IP value: '1111:2222::5555:' at character 8
select '1111::5555:'::ipaddress;
ERROR:  invalid IP value: '1111::5555:' at character 8
select '123'::ipaddress;
ERROR:  invalid IP value: '123' at character 8
select '12345::6:7:8'::ipaddress;
ERROR:  invalid IP value: '12345::6:7:8' at character 8
select '1:2:3:4:5:6:7:8:9'::ipaddress;
ERROR:  invalid IP value: '1:2:3:4:5:6:7:8:9' at character 8
select '1:2:3::4:5:6:7:8:9'::ipaddress;
ERROR:  invalid IP value: '1:2:3::4:5:6:7:8:9' at character 8
select '1:2:3::4:5::7:8'::ipaddress;
ERROR:  invalid IP value: '1:2:3::4:5::7:8' at character 8
select '1::1.2.256.4'::ipaddress;
ERROR:  invalid IP value: '1::1.2.256.4' at character 8
select '1::1.2.3.256'::ipaddress;
ERROR:  invalid IP value: '1::1.2.3.256' at character 8
select '1::1.2.3.300'::ipaddress;
ERROR:  invalid IP value: '1::1.2.3.300' at character 8
select '1::1.2.3.900'::ipaddress;
ERROR:  invalid IP value: '1::1.2.3.900' at character 8
select '1::1.2.300.4'::ipaddress;
ERROR:  invalid IP value: '1::1.2.300.4' at character 8
select '1::1.2.900.4'::ipaddress;
ERROR:  invalid IP value: '1::1.2.900.4' at character 8
select '1::1.256.3.4'::ipaddress;
ERROR:  invalid IP value: '1::1.256.3.4' at character 8
select '1::1.300.3.4'::ipaddress;
ERROR:  invalid IP value: '1::1.300.3.4' at character 8
select '1::1.900.3.4'::ipaddress;
ERROR:  invalid IP value: '1::1.900.3.4' at character 8
select '1::256.2.3.4'::ipaddress;
ERROR:  invalid IP value: '1::256.2.3.4' at character 8
select '1::260.2.3.4'::ipaddress;
ERROR:  invalid IP value: '1::260.2.3.4' at character 8
select '1::2::3'::ipaddress;
ERROR:  invalid IP value: '1::2::3' at character 8
select '1::300.2.3.4'::ipaddress;
ERROR:  invalid IP value: '1::300.2.3.4' at character 8
select '1::300.300.300.300'::ipaddress;
ERROR:  invalid IP value: '1::300.300.300.300' at character 8
select '1::3000.30.30.30'::ipaddress;
ERROR:  invalid IP value: '1::3000.30.30.30' at character 8
select '1::400.2.3.4'::ipaddress;
ERROR:  invalid IP value: '1::400.2.3.4' at character 8
select '1::5:1.2.256.4'::ipaddress;
ERROR:  invalid IP value: '1::5:1.2.256.4' at character 8
select '1::5:1.2.3.256'::ipaddress;
ERROR:  invalid IP value: '1::5:1.2.3.256' at character 8
select '1::5:1.2.3.300'::ipaddress;
ERROR:  invalid IP value: '1::5:1.2.3.300' at character 8
select '1::5:1.2.3.900'::ipaddress;
ERROR:  invalid IP value: '1::5:1.2.3.900' at character 8
select '1::5:1.2.300.4'::ipaddress;
ERROR:  invalid IP value: '1::5:1.2.300.4' at character 8
select '1::5:1.2.900.4'::ipaddress;
ERROR:  invalid IP value: '1::5:1.2.900.4' at character 8
select '1::5:1.256.3.4'::ipaddress;
ERROR:  invalid IP value: '1::5:1.256.3.4' at character 8
select '1::5:1.300.3.4'::ipaddress;
ERROR:  invalid IP value: '1::5:1.300.3.4' at character 8
select '1::5:1.900.3.4'::ipaddress;
ERROR:  invalid IP value: '1::5:1.900.3.4' at character 8
select '1::5:256.2.3.4'::ipaddress;
ERROR:  invalid IP value: '1::5:256.2.3.4' at character 8
select '1::5:260.2.3.4'::ipaddress;
ERROR:  invalid IP value: '1::5:260.2.3.4' at character 8
select '1::5:300.2.3.4'::ipaddress;
ERROR:  invalid IP value: '1::5:300.2.3.4' at character 8
select '1::5:300.300.300.300'::ipaddress;
ERROR:  invalid IP value: '1::5:300.300.300.300' at character 8
select '1::5:3000.30.30.30'::ipaddress;
ERROR:  invalid IP value: '1::5:3000.30.30.30' at character 8
select '1::5:400.2.3.4'::ipaddress;
ERROR:  invalid IP value: '1::5:400.2.3.4' at character 8
select '1::5:900.2.3.4'::ipaddress;
ERROR:  invalid IP value: '1::5:900.2.3.4' at character 8
select '1::900.2.3.4'::ipaddress;
ERROR:  invalid IP value: '1::900.2.3.4' at character 8
select '1:::3:4:5'::ipaddress;
ERROR:  invalid IP value: '1:::3:4:5' at character 8
select '2001:0000:1234: 0000:0000:C1C0:ABCD:0876'::ipaddress;
ERROR:  invalid IP value: '2001:0000:1234: 0000:0000:C1C0:ABCD:0876' at character 8
select '2001:0000:1234:0000:00001:C1C0:ABCD:0876'::ipaddress;
ERROR:  invalid IP value: '2001:0000:1234:0000:00001:C1C0:ABCD:0876' at character 8
select '2001:0000:1234:0000:0000:C1C0:ABCD:0876 0'::ipaddress;
ERROR:  invalid IP value: '2001:0000:1234:0000:0000:C1C0:ABCD:0876 0' at character 8
select '2001::FFD3::57ab'::ipaddress;
ERROR:  invalid IP value: '2001::FFD3::57ab' at character 8
select '2001:DB8:0:0:8:800:200C:417A:221'::ipaddress;
ERROR:  invalid IP value: '2001:DB8:0:0:8:800:200C:417A:221' at character 8
select '2001:db8:85a3::8a2e:37023:7334'::ipaddress;
ERROR:  invalid IP value: '2001:db8:85a3::8a2e:37023:7334' at character 8
select '2001:db8:85a3::8a2e:370k:7334'::ipaddress;
ERROR:  invalid IP value: '2001:db8:85a3::8a2e:370k:7334' at character 8
select '3ffe:0b00:0000:0001:0000:0000:000a'::ipaddress;
ERROR:  invalid IP value: '3ffe:0b00:0000:0001:0000:0000:000a' at character 8
select '3ffe:b00::1::a'::ipaddress;
ERROR:  invalid IP value: '3ffe:b00::1::a' at character 8
select ':'::ipaddress;
ERROR:  invalid IP value: ':' at character 8
select ':1111:2222:3333:4444::5555'::ipaddress;
ERROR:  invalid IP value: ':1111:2222:3333:4444::5555' at character 8
select ':1111:2222:3333::5555'::ipaddress;
ERROR:  invalid IP value: ':1111:2222:3333::5555' at character 8
select ':1111:2222::5555'::ipaddress;
ERROR:  invalid IP value: ':1111:2222::5555' at character 8
select ':1111::5555'::ipaddress;
ERROR:  invalid IP value: ':1111::5555' at character 8
select '::1.2.256.4'::ipaddress;
ERROR:  invalid IP value: '::1.2.256.4' at character 8
select '::1.2.3.256'::ipaddress;
ERROR:  invalid IP value: '::1.2.3.256' at character 8
select '::1.2.3.300'::ipaddress;
ERROR:  invalid IP value: '::1.2.3.300' at character 8
select '::1.2.3.900'::ipaddress;
ERROR:  invalid IP value: '::1.2.3.900' at character 8
select '::1.2.300.4'::ipaddress;
ERROR:  invalid IP value: '::1.2.300.4' at character 8
select '::1.2.900.4'::ipaddress;
ERROR:  invalid IP value: '::1.2.900.4' at character 8
select '::1.256.3.4'::ipaddress;
ERROR:  invalid IP value: '::1.256.3.4' at character 8
select '::1.300.3.4'::ipaddress;
ERROR:  invalid IP value: '::1.300.3.4' at character 8
select '::1.900.3.4'::ipaddress;
ERROR:  invalid IP value: '::1.900.3.4' at character 8
select '::1111:2222:3333:4444:5555:6666::'::ipaddress;
ERROR:  invalid IP value: '::1111:2222:3333:4444:5555:6666::' at character 8
select '::256.2.3.4'::ipaddress;
ERROR:  invalid IP value: '::256.2.3.4' at character 8
select '::260.2.3.4'::ipaddress;
ERROR:  invalid IP value: '::260.2.3.4' at character 8
select '::300.2.3.4'::ipaddress;
ERROR:  invalid IP value: '::300.2.3.4' at character 8
select '::300.300.300.300'::ipaddress;
ERROR:  invalid IP value: '::300.300.300.300' at character 8
select '::3000.30.30.30'::ipaddress;
ERROR:  invalid IP value: '::3000.30.30.30' at character 8
select '::400.2.3.4'::ipaddress;
ERROR:  invalid IP value: '::400.2.3.4' at character 8
select '::5555:'::ipaddress;
ERROR:  invalid IP value: '::5555:' at character 8
select '::900.2.3.4'::ipaddress;
ERROR:  invalid IP value: '::900.2.3.4' at character 8
select ':::'::ipaddress;
ERROR:  invalid IP value: ':::' at character 8
select ':::5555'::ipaddress;
ERROR:  invalid IP value: ':::5555' at character 8
select '::ffff:2.3.4'::ipaddress;
ERROR:  invalid IP value: '::ffff:2.3.4' at character 8
select '::ffff:257.1.2.3'::ipaddress;
ERROR:  invalid IP value: '::ffff:257.1.2.3' at character 8
select 'FF01::101::2'::ipaddress;
ERROR:  invalid IP value: 'FF01::101::2' at character 8
select 'FF02:0000:0000:0000:0000:0000:0000:0000:0001'::ipaddress;
ERROR:  invalid IP value: 'FF02:0000:0000:0000:0000:0000:0000:0000:0001' at character 8
select 'ldkfj'::ipaddress;
ERROR:  invalid IP value: 'ldkfj' at character 8
-- valid iprange
select r, family(r), iprange_size(r) from (select '-'::iprange as r) s;
 r | family |     iprange_size     
---+--------+----------------------
 - |        | 6.80564733841877e+38
(1 row)

select r, family(r), iprange_size(r) from (select '1.2.3.4'::iprange as r) s;
    r    | family | iprange_size 
---------+--------+--------------
 1.2.3.4 |      4 |            1
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.255.255/32'::iprange as r) s;
        r        | family | iprange_size 
-----------------+--------+--------------
 255.255.255.255 |      4 |            1
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.255.254/31'::iprange as r) s;
         r          | family | iprange_size 
--------------------+--------+--------------
 255.255.255.254/31 |      4 |            2
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.255.252/30'::iprange as r) s;
         r          | family | iprange_size 
--------------------+--------+--------------
 255.255.255.252/30 |      4 |            4
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.255.248/29'::iprange as r) s;
         r          | family | iprange_size 
--------------------+--------+--------------
 255.255.255.248/29 |      4 |            8
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.255.240/28'::iprange as r) s;
         r          | family | iprange_size 
--------------------+--------+--------------
 255.255.255.240/28 |      4 |           16
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.255.224/27'::iprange as r) s;
         r          | family | iprange_size 
--------------------+--------+--------------
 255.255.255.224/27 |      4 |           32
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.255.192/26'::iprange as r) s;
         r          | family | iprange_size 
--------------------+--------+--------------
 255.255.255.192/26 |      4 |           64
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.255.128/25'::iprange as r) s;
         r          | family | iprange_size 
--------------------+--------+--------------
 255.255.255.128/25 |      4 |          128
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.255.0/24'::iprange as r) s;
        r         | family | iprange_size 
------------------+--------+--------------
 255.255.255.0/24 |      4 |          256
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.254.0/23'::iprange as r) s;
        r         | family | iprange_size 
------------------+--------+--------------
 255.255.254.0/23 |      4 |          512
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.252.0/22'::iprange as r) s;
        r         | family | iprange_size 
------------------+--------+--------------
 255.255.252.0/22 |      4 |         1024
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.248.0/21'::iprange as r) s;
        r         | family | iprange_size 
------------------+--------+--------------
 255.255.248.0/21 |      4 |         2048
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.240.0/20'::iprange as r) s;
        r         | family | iprange_size 
------------------+--------+--------------
 255.255.240.0/20 |      4 |         4096
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.224.0/19'::iprange as r) s;
        r         | family | iprange_size 
------------------+--------+--------------
 255.255.224.0/19 |      4 |         8192
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.192.0/18'::iprange as r) s;
        r         | family | iprange_size 
------------------+--------+--------------
 255.255.192.0/18 |      4 |        16384
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.128.0/17'::iprange as r) s;
        r         | family | iprange_size 
------------------+--------+--------------
 255.255.128.0/17 |      4 |        32768
(1 row)

select r, family(r), iprange_size(r) from (select '255.255.0.0/16'::iprange as r) s;
       r        | family | iprange_size 
----------------+--------+--------------
 255.255.0.0/16 |      4 |        65536
(1 row)

select r, family(r), iprange_size(r) from (select '255.254.0.0/15'::iprange as r) s;
       r        | family | iprange_size 
----------------+--------+--------------
 255.254.0.0/15 |      4 |       131072
(1 row)

select r, family(r), iprange_size(r) from (select '255.252.0.0/14'::iprange as r) s;
       r        | family | iprange_size 
----------------+--------+--------------
 255.252.0.0/14 |      4 |       262144
(1 row)

select r, family(r), iprange_size(r) from (select '255.248.0.0/13'::iprange as r) s;
       r        | family | iprange_size 
----------------+--------+--------------
 255.248.0.0/13 |      4 |       524288
(1 row)

select r, family(r), iprange_size(r) from (select '255.240.0.0/12'::iprange as r) s;
       r        | family | iprange_size 
----------------+--------+--------------
 255.240.0.0/12 |      4 |      1048576
(1 row)

select r, family(r), iprange_size(r) from (select '255.224.0.0/11'::iprange as r) s;
       r        | family | iprange_size 
----------------+--------+--------------
 255.224.0.0/11 |      4 |      2097152
(1 row)

select r, family(r), iprange_size(r) from (select '255.192.0.0/10'::iprange as r) s;
       r        | family | iprange_size 
----------------+--------+--------------
 255.192.0.0/10 |      4 |      4194304
(1 row)

select r, family(r), iprange_size(r) from (select '255.128.0.0/9'::iprange as r) s;
       r       | family | iprange_size 
---------------+--------+--------------
 255.128.0.0/9 |      4 |      8388608
(1 row)

select r, family(r), iprange_size(r) from (select '255.0.0.0/8'::iprange as r) s;
      r      | family | iprange_size 
-------------+--------+--------------
 255.0.0.0/8 |      4 |     16777216
(1 row)

select r, family(r), iprange_size(r) from (select '254.0.0.0/7'::iprange as r) s;
      r      | family | iprange_size 
-------------+--------+--------------
 254.0.0.0/7 |      4 |     33554432
(1 row)

select r, family(r), iprange_size(r) from (select '252.0.0.0/6'::iprange as r) s;
      r      | family | iprange_size 
-------------+--------+--------------
 252.0.0.0/6 |      4 |     67108864
(1 row)

select r, family(r), iprange_size(r) from (select '248.0.0.0/5'::iprange as r) s;
      r      | family | iprange_size 
-------------+--------+--------------
 248.0.0.0/5 |      4 |    134217728
(1 row)

select r, family(r), iprange_size(r) from (select '240.0.0.0/4'::iprange as r) s;
      r      | family | iprange_size 
-------------+--------+--------------
 240.0.0.0/4 |      4 |    268435456
(1 row)

select r, family(r), iprange_size(r) from (select '224.0.0.0/3'::iprange as r) s;
      r      | family | iprange_size 
-------------+--------+--------------
 224.0.0.0/3 |      4 |    536870912
(1 row)

select r, family(r), iprange_size(r) from (select '192.0.0.0/2'::iprange as r) s;
      r      | family | iprange_size 
-------------+--------+--------------
 192.0.0.0/2 |      4 |   1073741824
(1 row)

select r, family(r), iprange_size(r) from (select '128.0.0.0/1'::iprange as r) s;
      r      | family | iprange_size 
-------------+--------+--------------
 128.0.0.0/1 |      4 |   2147483648
(1 row)

select r, family(r), iprange_size(r) from (select '0.0.0.0/0'::iprange as r) s;
     r     | family | iprange_size 
-----------+--------+--------------
 0.0.0.0/0 |      4 |   4294967296
(1 row)

select r, family(r), iprange_size(r) from (select '1.2.3.4-5.6.7.8'::iprange as r) s;
        r        | family | iprange_size 
-----------------+--------+--------------
 1.2.3.4-5.6.7.8 |      4 |     67372037
(1 row)

select r, family(r), iprange_size(r) from (select '5.6.7.8-1.2.3.4'::iprange as r) s;
        r        | family | iprange_size 
-----------------+--------+--------------
 1.2.3.4-5.6.7.8 |      4 |     67372037
(1 row)

select r, family(r), iprange_size(r) from (select '1.2.3.4-1.2.3.4'::iprange as r) s;
    r    | family | iprange_size 
---------+--------+--------------
 1.2.3.4 |      4 |            1
(1 row)

select r, family(r), iprange_size(r) from (select '::'::iprange as r) s;
 r  | family | iprange_size 
----+--------+--------------
 :: |      6 |            1
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'::iprange as r) s;
                    r                    | family | iprange_size 
-----------------------------------------+--------+--------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff |      6 |            1
(1 row)

select r, family(r), iprange_size(r) from (select '1::2'::iprange as r) s;
  r   | family | iprange_size 
------+--------+--------------
 1::2 |      6 |            1
(1 row)

select r, family(r), iprange_size(r) from (select '::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'::iprange as r) s;
  r   | family |     iprange_size     
------+--------+----------------------
 ::/0 |      6 | 3.40282366920938e+38
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff-::'::iprange as r) s;
  r   | family |     iprange_size     
------+--------+----------------------
 ::/0 |      6 | 3.40282366920938e+38
(1 row)

select r, family(r), iprange_size(r) from (select '1::2-3::4'::iprange as r) s;
     r     | family |     iprange_size     
-----------+--------+----------------------
 1::2-3::4 |      6 | 1.03845937170697e+34
(1 row)

select r, family(r), iprange_size(r) from (select '3::4-3::4'::iprange as r) s;
  r   | family | iprange_size 
------+--------+--------------
 3::4 |      6 |            1
(1 row)

select r, family(r), iprange_size(r) from (select '3::4-1::2'::iprange as r) s;
     r     | family |     iprange_size     
-----------+--------+----------------------
 1::2-3::4 |      6 | 1.03845937170697e+34
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128'::iprange as r) s;
                    r                    | family | iprange_size 
-----------------------------------------+--------+--------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff |      6 |            1
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe/127'::iprange as r) s;
                      r                      | family | iprange_size 
---------------------------------------------+--------+--------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe/127 |      6 |            2
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffc/126'::iprange as r) s;
                      r                      | family | iprange_size 
---------------------------------------------+--------+--------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffc/126 |      6 |            4
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff8/125'::iprange as r) s;
                      r                      | family | iprange_size 
---------------------------------------------+--------+--------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff8/125 |      6 |            8
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0/124'::iprange as r) s;
                      r                      | family | iprange_size 
---------------------------------------------+--------+--------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0/124 |      6 |           16
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ff00/120'::iprange as r) s;
                      r                      | family | iprange_size 
---------------------------------------------+--------+--------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ff00/120 |      6 |          256
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:f000/116'::iprange as r) s;
                      r                      | family | iprange_size 
---------------------------------------------+--------+--------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:f000/116 |      6 |         4096
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:0000/112'::iprange as r) s;
                    r                     | family | iprange_size 
------------------------------------------+--------+--------------
 ffff:ffff:ffff:ffff:ffff:ffff:ffff:0/112 |      6 |        65536
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ffff:ffff:0000:0000/96'::iprange as r) s;
                 r                  | family | iprange_size 
------------------------------------+--------+--------------
 ffff:ffff:ffff:ffff:ffff:ffff::/96 |      6 |   4294967296
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ffff:0000:0000:0000/80'::iprange as r) s;
               r               | family |  iprange_size   
-------------------------------+--------+-----------------
 ffff:ffff:ffff:ffff:ffff::/80 |      6 | 281474976710656
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:fff0:0000:0000:0000/76'::iprange as r) s;
               r               | family |    iprange_size     
-------------------------------+--------+---------------------
 ffff:ffff:ffff:ffff:fff0::/76 |      6 | 4.5035996273705e+15
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:ff00:0000:0000:0000/72'::iprange as r) s;
               r               | family |     iprange_size     
-------------------------------+--------+----------------------
 ffff:ffff:ffff:ffff:ff00::/72 |      6 | 7.20575940379279e+16
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:f000:0000:0000:0000/68'::iprange as r) s;
               r               | family |     iprange_size     
-------------------------------+--------+----------------------
 ffff:ffff:ffff:ffff:f000::/68 |      6 | 1.15292150460685e+18
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:e000:0000:0000:0000/67'::iprange as r) s;
               r               | family |     iprange_size     
-------------------------------+--------+----------------------
 ffff:ffff:ffff:ffff:e000::/67 |      6 | 2.30584300921369e+18
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:c000:0000:0000:0000/66'::iprange as r) s;
               r               | family |     iprange_size     
-------------------------------+--------+----------------------
 ffff:ffff:ffff:ffff:c000::/66 |      6 | 4.61168601842739e+18
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:8000:0000:0000:0000/65'::iprange as r) s;
               r               | family |     iprange_size     
-------------------------------+--------+----------------------
 ffff:ffff:ffff:ffff:8000::/65 |      6 | 9.22337203685478e+18
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ffff:0000:0000:0000:0000/64'::iprange as r) s;
            r             | family |     iprange_size     
--------------------------+--------+----------------------
 ffff:ffff:ffff:ffff::/64 |      6 | 1.84467440737096e+19
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:fffe:0000:0000:0000:0000/63'::iprange as r) s;
            r             | family |     iprange_size     
--------------------------+--------+----------------------
 ffff:ffff:ffff:fffe::/63 |      6 | 3.68934881474191e+19
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:fffc:0000:0000:0000:0000/62'::iprange as r) s;
            r             | family |     iprange_size     
--------------------------+--------+----------------------
 ffff:ffff:ffff:fffc::/62 |      6 | 7.37869762948382e+19
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:fff8:0000:0000:0000:0000/61'::iprange as r) s;
            r             | family |     iprange_size     
--------------------------+--------+----------------------
 ffff:ffff:ffff:fff8::/61 |      6 | 1.47573952589676e+20
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:fff0:0000:0000:0000:0000/60'::iprange as r) s;
            r             | family |     iprange_size     
--------------------------+--------+----------------------
 ffff:ffff:ffff:fff0::/60 |      6 | 2.95147905179353e+20
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:ff00:0000:0000:0000:0000/56'::iprange as r) s;
            r             | family |     iprange_size     
--------------------------+--------+----------------------
 ffff:ffff:ffff:ff00::/56 |      6 | 4.72236648286965e+21
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:f000:0000:0000:0000:0000/52'::iprange as r) s;
            r             | family |     iprange_size     
--------------------------+--------+----------------------
 ffff:ffff:ffff:f000::/52 |      6 | 7.55578637259143e+22
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:ffff:0000:0000:0000:0000:0000/48'::iprange as r) s;
          r          | family |     iprange_size     
---------------------+--------+----------------------
 ffff:ffff:ffff::/48 |      6 | 1.20892581961463e+24
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:ffff:0000:0000:0000:0000:0000:0000/32'::iprange as r) s;
       r        | family |     iprange_size     
----------------+--------+----------------------
 ffff:ffff::/32 |      6 | 7.92281625142643e+28
(1 row)

select r, family(r), iprange_size(r) from (select 'ffff:0000:0000:0000:0000:0000:0000:0000/16'::iprange as r) s;
     r     | family |     iprange_size     
-----------+--------+----------------------
 ffff::/16 |      6 | 5.19229685853483e+33
(1 row)

select r, family(r), iprange_size(r) from (select 'fff0:0000:0000:0000:0000:0000:0000:0000/12'::iprange as r) s;
     r     | family |     iprange_size     
-----------+--------+----------------------
 fff0::/12 |      6 | 8.30767497365572e+34
(1 row)

select r, family(r), iprange_size(r) from (select 'ff00:0000:0000:0000:0000:0000:0000:0000/8'::iprange as r) s;
    r     | family |     iprange_size     
----------+--------+----------------------
 ff00::/8 |      6 | 1.32922799578492e+36
(1 row)

select r, family(r), iprange_size(r) from (select 'f000:0000:0000:0000:0000:0000:0000:0000/4'::iprange as r) s;
    r     | family |     iprange_size     
----------+--------+----------------------
 f000::/4 |      6 | 2.12676479325587e+37
(1 row)

select r, family(r), iprange_size(r) from (select 'e000:0000:0000:0000:0000:0000:0000:0000/3'::iprange as r) s;
    r     | family |     iprange_size     
----------+--------+----------------------
 e000::/3 |      6 | 4.25352958651173e+37
(1 row)

select r, family(r), iprange_size(r) from (select 'c000:0000:0000:0000:0000:0000:0000:0000/2'::iprange as r) s;
    r     | family |     iprange_size     
----------+--------+----------------------
 c000::/2 |      6 | 8.50705917302346e+37
(1 row)

select r, family(r), iprange_size(r) from (select '8000:0000:0000:0000:0000:0000:0000:0000/1'::iprange as r) s;
    r     | family |     iprange_size     
----------+--------+----------------------
 8000::/1 |      6 | 1.70141183460469e+38
(1 row)

select r, family(r), iprange_size(r) from (select '0000:0000:0000:0000:0000:0000:0000:0000/0'::iprange as r) s;
  r   | family |     iprange_size     
------+--------+----------------------
 ::/0 |      6 | 3.40282366920938e+38
(1 row)

-- invalid iprange
select '1.2.3'::iprange;
ERROR:  invalid IP4R value: "1.2.3" at character 8
select '255.255.255.255.255.255.255.255.255'::iprange;
ERROR:  invalid IP4R value: "255.255.255.255.255.255.255.255.255" at character 8
select '255.255.255.255.255-255.255.255.255.255'::iprange;
ERROR:  invalid IP4R value: "255.255.255.255.255-255.255.255.255.255" at character 8
select '255.255.255.255-1.2.3.4.5'::iprange;
ERROR:  invalid IP4R value: "255.255.255.255-1.2.3.4.5" at character 8
select '255.255.255.255-1.2.3'::iprange;
ERROR:  invalid IP4R value: "255.255.255.255-1.2.3" at character 8
select '0.0.0.1/31'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/31" at character 8
select '0.0.0.1/30'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/30" at character 8
select '0.0.0.1/29'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/29" at character 8
select '0.0.0.1/28'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/28" at character 8
select '0.0.0.1/27'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/27" at character 8
select '0.0.0.1/26'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/26" at character 8
select '0.0.0.1/25'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/25" at character 8
select '0.0.0.1/24'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/24" at character 8
select '0.0.0.1/23'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/23" at character 8
select '0.0.0.1/22'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/22" at character 8
select '0.0.0.1/21'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/21" at character 8
select '0.0.0.1/20'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/20" at character 8
select '0.0.0.1/19'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/19" at character 8
select '0.0.0.1/18'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/18" at character 8
select '0.0.0.1/17'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/17" at character 8
select '0.0.0.1/16'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/16" at character 8
select '0.0.0.1/15'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/15" at character 8
select '0.0.0.1/14'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/14" at character 8
select '0.0.0.1/13'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/13" at character 8
select '0.0.0.1/12'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/12" at character 8
select '0.0.0.1/11'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/11" at character 8
select '0.0.0.1/10'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/10" at character 8
select '0.0.0.1/9'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/9" at character 8
select '0.0.0.1/8'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/8" at character 8
select '0.0.0.1/7'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/7" at character 8
select '0.0.0.1/6'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/6" at character 8
select '0.0.0.1/5'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/5" at character 8
select '0.0.0.1/4'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/4" at character 8
select '0.0.0.1/3'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/3" at character 8
select '0.0.0.1/2'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/2" at character 8
select '0.0.0.1/1'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/1" at character 8
select '0.0.0.1/0'::iprange;
ERROR:  invalid IP4R value: "0.0.0.1/0" at character 8
select '0.0.0.2/30'::iprange;
ERROR:  invalid IP4R value: "0.0.0.2/30" at character 8
select '0.0.0.4/29'::iprange;
ERROR:  invalid IP4R value: "0.0.0.4/29" at character 8
select '0.0.0.8/28'::iprange;
ERROR:  invalid IP4R value: "0.0.0.8/28" at character 8
select '0.0.0.16/27'::iprange;
ERROR:  invalid IP4R value: "0.0.0.16/27" at character 8
select '0.0.0.32/26'::iprange;
ERROR:  invalid IP4R value: "0.0.0.32/26" at character 8
select '0.0.0.64/25'::iprange;
ERROR:  invalid IP4R value: "0.0.0.64/25" at character 8
select '
Download .txt
gitextract_txv3m7cj/

├── .dir-locals.el
├── .editorconfig
├── .gitattributes
├── .github/
│   └── workflows/
│       ├── regr_macos.yml
│       └── regression.yml
├── .gitignore
├── LICENSE
├── Makefile
├── README.ip4r
├── expected/
│   ├── ip4r-softerr.out
│   ├── ip4r-v11.out
│   └── ip4r.out
├── ip4r.control
├── scripts/
│   ├── ip4r--2.0--2.1.sql
│   ├── ip4r--2.1--2.2.sql
│   ├── ip4r--2.2--2.4.sql
│   ├── ip4r--2.4.sql
│   ├── ip4r--unpackaged1--2.0.sql
│   ├── ip4r--unpackaged2.0--2.0.sql
│   └── ip4r--unpackaged2.1--2.1.sql
├── sql/
│   ├── ip4r-softerr.sql
│   ├── ip4r-v11.sql
│   └── ip4r.sql
├── src/
│   ├── ip4r.c
│   ├── ip4r_funcs.h
│   ├── ip4r_module.c
│   ├── ip6r.c
│   ├── ip6r_funcs.h
│   ├── ipaddr.c
│   ├── ipr.h
│   ├── ipr_internal.h
│   ├── iprange.c
│   └── raw_io.c
└── tools/
    ├── numeric-tests.mk
    └── numeric.mk
Download .txt
SYMBOL INDEX (752 symbols across 13 files)

FILE: scripts/ip4r--2.2--2.4.sql
  function cidr_split (line 7) | CREATE FUNCTION cidr_split(ip4r) RETURNS SETOF ip4r AS 'MODULE_PATHNAME'...
  function cidr_split (line 8) | CREATE FUNCTION cidr_split(ip6r) RETURNS SETOF ip6r AS 'MODULE_PATHNAME'...
  function cidr_split (line 9) | CREATE FUNCTION cidr_split(iprange) RETURNS SETOF iprange AS 'MODULE_PAT...
  function ip4 (line 12) | CREATE FUNCTION ip4(bit) RETURNS ip4 AS 'MODULE_PATHNAME','ip4_cast_from...
  function ip4 (line 13) | CREATE FUNCTION ip4(varbit) RETURNS ip4 AS 'MODULE_PATHNAME','ip4_cast_f...
  function ip4 (line 14) | CREATE FUNCTION ip4(bytea) RETURNS ip4 AS 'MODULE_PATHNAME','ip4_cast_fr...
  function ip6 (line 15) | CREATE FUNCTION ip6(bit) RETURNS ip6 AS 'MODULE_PATHNAME','ip6_cast_from...
  function ip6 (line 16) | CREATE FUNCTION ip6(varbit) RETURNS ip6 AS 'MODULE_PATHNAME','ip6_cast_f...
  function ip6 (line 17) | CREATE FUNCTION ip6(bytea) RETURNS ip6 AS 'MODULE_PATHNAME','ip6_cast_fr...
  function ipaddress (line 18) | CREATE FUNCTION ipaddress(bit) RETURNS ipaddress AS 'MODULE_PATHNAME','i...
  function ipaddress (line 19) | CREATE FUNCTION ipaddress(varbit) RETURNS ipaddress AS 'MODULE_PATHNAME'...
  function ipaddress (line 20) | CREATE FUNCTION ipaddress(bytea) RETURNS ipaddress AS 'MODULE_PATHNAME',...
  function ip4r (line 21) | CREATE FUNCTION ip4r(varbit) RETURNS ip4r AS 'MODULE_PATHNAME','ip4r_cas...
  function ip6r (line 22) | CREATE FUNCTION ip6r(varbit) RETURNS ip6r AS 'MODULE_PATHNAME','ip6r_cas...
  function to_bit (line 23) | CREATE FUNCTION to_bit(ip4) RETURNS varbit AS 'MODULE_PATHNAME','ip4_cas...
  function to_bit (line 24) | CREATE FUNCTION to_bit(ip6) RETURNS varbit AS 'MODULE_PATHNAME','ip6_cas...
  function to_bit (line 25) | CREATE FUNCTION to_bit(ipaddress) RETURNS varbit AS 'MODULE_PATHNAME','i...
  function to_bit (line 26) | CREATE FUNCTION to_bit(ip4r) RETURNS varbit AS 'MODULE_PATHNAME','ip4r_c...
  function to_bit (line 27) | CREATE FUNCTION to_bit(ip6r) RETURNS varbit AS 'MODULE_PATHNAME','ip6r_c...
  function to_bit (line 28) | CREATE FUNCTION to_bit(iprange) RETURNS varbit AS 'MODULE_PATHNAME','ipr...
  function to_bytea (line 29) | CREATE FUNCTION to_bytea(ip4) RETURNS bytea AS 'MODULE_PATHNAME','ip4_ca...
  function to_bytea (line 30) | CREATE FUNCTION to_bytea(ip6) RETURNS bytea AS 'MODULE_PATHNAME','ip6_ca...
  function to_bytea (line 31) | CREATE FUNCTION to_bytea(ipaddress) RETURNS bytea AS 'MODULE_PATHNAME','...
  function iprange_hash (line 32) | CREATE CAST (ip4 as varbit) WITH FUNCTION to_bit(ip4);
  function ip4_hash_extended (line 56) | CREATE FUNCTION ip4_hash_extended(ip4,bigint) RETURNS bigint AS 'MODULE_...
  function ip6_hash_extended (line 57) | CREATE FUNCTION ip6_hash_extended(ip6,bigint) RETURNS bigint AS 'MODULE_...
  function ipaddress_hash_extended (line 58) | CREATE FUNCTION ipaddress_hash_extended(ipaddress,bigint) RETURNS bigint...
  function ip4r_hash_extended (line 59) | CREATE FUNCTION ip4r_hash_extended(ip4r,bigint) RETURNS bigint AS 'MODUL...
  function ip6r_hash_extended (line 60) | CREATE FUNCTION ip6r_hash_extended(ip6r,bigint) RETURNS bigint AS 'MODUL...
  function iprange_hash_extended (line 61) | CREATE FUNCTION iprange_hash_extended(iprange,bigint) RETURNS bigint AS ...
  function in_range (line 64) | CREATE FUNCTION in_range(ip4,ip4,bigint,boolean,boolean) RETURNS boolean...
  function in_range (line 65) | CREATE FUNCTION in_range(ip4,ip4,ip4,boolean,boolean) RETURNS boolean AS...
  function in_range (line 66) | CREATE FUNCTION in_range(ip6,ip6,bigint,boolean,boolean) RETURNS boolean...
  function in_range (line 67) | CREATE FUNCTION in_range(ip6,ip6,ip6,boolean,boolean) RETURNS boolean AS...
  type ip4r_update_to_2_4 (line 147) | CREATE TABLE ip4r_update_to_2_4.update_indexes

FILE: scripts/ip4r--2.4.sql
  function ip4_in (line 13) | CREATE FUNCTION ip4_in(cstring) RETURNS ip4 AS 'MODULE_PATHNAME' LANGUAG...
  function ip4_out (line 14) | CREATE FUNCTION ip4_out(ip4) RETURNS cstring AS 'MODULE_PATHNAME' LANGUA...
  function ip4_recv (line 15) | CREATE FUNCTION ip4_recv(internal) RETURNS ip4 AS 'MODULE_PATHNAME' LANG...
  function ip4_send (line 16) | CREATE FUNCTION ip4_send(ip4) RETURNS bytea AS 'MODULE_PATHNAME' LANGUAG...
  function ip4r_in (line 28) | CREATE FUNCTION ip4r_in(cstring) RETURNS ip4r AS 'MODULE_PATHNAME' LANGU...
  function ip4r_out (line 29) | CREATE FUNCTION ip4r_out(ip4r) RETURNS cstring AS 'MODULE_PATHNAME' LANG...
  function ip4r_recv (line 30) | CREATE FUNCTION ip4r_recv(internal) RETURNS ip4r AS 'MODULE_PATHNAME' LA...
  function ip4r_send (line 31) | CREATE FUNCTION ip4r_send(ip4r) RETURNS bytea AS 'MODULE_PATHNAME' LANGU...
  function ip6_in (line 43) | CREATE FUNCTION ip6_in(cstring) RETURNS ip6 AS 'MODULE_PATHNAME' LANGUAG...
  function ip6_out (line 44) | CREATE FUNCTION ip6_out(ip6) RETURNS cstring AS 'MODULE_PATHNAME' LANGUA...
  function ip6_recv (line 45) | CREATE FUNCTION ip6_recv(internal) RETURNS ip6 AS 'MODULE_PATHNAME' LANG...
  function ip6_send (line 46) | CREATE FUNCTION ip6_send(ip6) RETURNS bytea AS 'MODULE_PATHNAME' LANGUAG...
  function ip6r_in (line 58) | CREATE FUNCTION ip6r_in(cstring) RETURNS ip6r AS 'MODULE_PATHNAME' LANGU...
  function ip6r_out (line 59) | CREATE FUNCTION ip6r_out(ip6r) RETURNS cstring AS 'MODULE_PATHNAME' LANG...
  function ip6r_recv (line 60) | CREATE FUNCTION ip6r_recv(internal) RETURNS ip6r AS 'MODULE_PATHNAME' LA...
  function ip6r_send (line 61) | CREATE FUNCTION ip6r_send(ip6r) RETURNS bytea AS 'MODULE_PATHNAME' LANGU...
  function ipaddress_in (line 73) | CREATE FUNCTION ipaddress_in(cstring) RETURNS ipaddress AS 'MODULE_PATHN...
  function ipaddress_out (line 74) | CREATE FUNCTION ipaddress_out(ipaddress) RETURNS cstring AS 'MODULE_PATH...
  function ipaddress_recv (line 75) | CREATE FUNCTION ipaddress_recv(internal) RETURNS ipaddress AS 'MODULE_PA...
  function ipaddress_send (line 76) | CREATE FUNCTION ipaddress_send(ipaddress) RETURNS bytea AS 'MODULE_PATHN...
  function iprange_in (line 88) | CREATE FUNCTION iprange_in(cstring) RETURNS iprange AS 'MODULE_PATHNAME'...
  function iprange_out (line 89) | CREATE FUNCTION iprange_out(iprange) RETURNS cstring AS 'MODULE_PATHNAME...
  function iprange_recv (line 90) | CREATE FUNCTION iprange_recv(internal) RETURNS iprange AS 'MODULE_PATHNA...
  function iprange_send (line 91) | CREATE FUNCTION iprange_send(iprange) RETURNS bytea AS 'MODULE_PATHNAME'...
  function ip4 (line 104) | CREATE FUNCTION ip4(bigint) RETURNS ip4 AS 'MODULE_PATHNAME','ip4_cast_f...
  function ip4 (line 105) | CREATE FUNCTION ip4(double precision) RETURNS ip4 AS 'MODULE_PATHNAME','...
  function ip4 (line 106) | CREATE FUNCTION ip4(numeric) RETURNS ip4 AS 'MODULE_PATHNAME','ip4_cast_...
  function ip4 (line 107) | CREATE FUNCTION ip4(inet) RETURNS ip4 AS 'MODULE_PATHNAME','ip4_cast_fro...
  function ip4 (line 108) | CREATE FUNCTION ip4(text) RETURNS ip4 AS 'MODULE_PATHNAME','ip4_cast_fro...
  function ip4 (line 109) | CREATE FUNCTION ip4(bit) RETURNS ip4 AS 'MODULE_PATHNAME','ip4_cast_from...
  function ip4 (line 110) | CREATE FUNCTION ip4(varbit) RETURNS ip4 AS 'MODULE_PATHNAME','ip4_cast_f...
  function ip4 (line 111) | CREATE FUNCTION ip4(bytea) RETURNS ip4 AS 'MODULE_PATHNAME','ip4_cast_fr...
  function ip4 (line 112) | CREATE FUNCTION ip4(ipaddress) RETURNS ip4 AS 'MODULE_PATHNAME','ipaddr_...
  function ip6 (line 114) | CREATE FUNCTION ip6(numeric) RETURNS ip6 AS 'MODULE_PATHNAME','ip6_cast_...
  function ip6 (line 115) | CREATE FUNCTION ip6(inet) RETURNS ip6 AS 'MODULE_PATHNAME','ip6_cast_fro...
  function ip6 (line 116) | CREATE FUNCTION ip6(text) RETURNS ip6 AS 'MODULE_PATHNAME','ip6_cast_fro...
  function ip6 (line 117) | CREATE FUNCTION ip6(bit) RETURNS ip6 AS 'MODULE_PATHNAME','ip6_cast_from...
  function ip6 (line 118) | CREATE FUNCTION ip6(varbit) RETURNS ip6 AS 'MODULE_PATHNAME','ip6_cast_f...
  function ip6 (line 119) | CREATE FUNCTION ip6(bytea) RETURNS ip6 AS 'MODULE_PATHNAME','ip6_cast_fr...
  function ip6 (line 120) | CREATE FUNCTION ip6(ipaddress) RETURNS ip6 AS 'MODULE_PATHNAME','ipaddr_...
  function ipaddress (line 122) | CREATE FUNCTION ipaddress(inet) RETURNS ipaddress AS 'MODULE_PATHNAME','...
  function ipaddress (line 123) | CREATE FUNCTION ipaddress(ip4) RETURNS ipaddress AS 'MODULE_PATHNAME','i...
  function ipaddress (line 124) | CREATE FUNCTION ipaddress(ip6) RETURNS ipaddress AS 'MODULE_PATHNAME','i...
  function ipaddress (line 125) | CREATE FUNCTION ipaddress(text) RETURNS ipaddress AS 'MODULE_PATHNAME','...
  function ipaddress (line 126) | CREATE FUNCTION ipaddress(bit) RETURNS ipaddress AS 'MODULE_PATHNAME','i...
  function ipaddress (line 127) | CREATE FUNCTION ipaddress(varbit) RETURNS ipaddress AS 'MODULE_PATHNAME'...
  function ipaddress (line 128) | CREATE FUNCTION ipaddress(bytea) RETURNS ipaddress AS 'MODULE_PATHNAME',...
  function ip4r (line 130) | CREATE FUNCTION ip4r(cidr) RETURNS ip4r AS 'MODULE_PATHNAME','ip4r_cast_...
  function ip4r (line 131) | CREATE FUNCTION ip4r(ip4) RETURNS ip4r AS 'MODULE_PATHNAME','ip4r_cast_f...
  function ip4r (line 132) | CREATE FUNCTION ip4r(text) RETURNS ip4r AS 'MODULE_PATHNAME','ip4r_cast_...
  function ip4r (line 133) | CREATE FUNCTION ip4r(varbit) RETURNS ip4r AS 'MODULE_PATHNAME','ip4r_cas...
  function ip4r (line 134) | CREATE FUNCTION ip4r(iprange) RETURNS ip4r AS 'MODULE_PATHNAME','iprange...
  function ip6r (line 136) | CREATE FUNCTION ip6r(cidr) RETURNS ip6r AS 'MODULE_PATHNAME','ip6r_cast_...
  function ip6r (line 137) | CREATE FUNCTION ip6r(ip6) RETURNS ip6r AS 'MODULE_PATHNAME','ip6r_cast_f...
  function ip6r (line 138) | CREATE FUNCTION ip6r(text) RETURNS ip6r AS 'MODULE_PATHNAME','ip6r_cast_...
  function ip6r (line 139) | CREATE FUNCTION ip6r(varbit) RETURNS ip6r AS 'MODULE_PATHNAME','ip6r_cas...
  function ip6r (line 140) | CREATE FUNCTION ip6r(iprange) RETURNS ip6r AS 'MODULE_PATHNAME','iprange...
  function iprange (line 142) | CREATE FUNCTION iprange(cidr) RETURNS iprange AS 'MODULE_PATHNAME','ipra...
  function iprange (line 143) | CREATE FUNCTION iprange(ip4) RETURNS iprange AS 'MODULE_PATHNAME','ipran...
  function iprange (line 144) | CREATE FUNCTION iprange(ip6) RETURNS iprange AS 'MODULE_PATHNAME','ipran...
  function iprange (line 145) | CREATE FUNCTION iprange(ip4r) RETURNS iprange AS 'MODULE_PATHNAME','ipra...
  function iprange (line 146) | CREATE FUNCTION iprange(ip6r) RETURNS iprange AS 'MODULE_PATHNAME','ipra...
  function iprange (line 147) | CREATE FUNCTION iprange(ipaddress) RETURNS iprange AS 'MODULE_PATHNAME',...
  function iprange (line 148) | CREATE FUNCTION iprange(text) RETURNS iprange AS 'MODULE_PATHNAME','ipra...
  function cidr (line 153) | CREATE FUNCTION cidr(ip4) RETURNS cidr AS 'MODULE_PATHNAME','ip4_cast_to...
  function cidr (line 154) | CREATE FUNCTION cidr(ip4r) RETURNS cidr AS 'MODULE_PATHNAME','ip4r_cast_...
  function cidr (line 155) | CREATE FUNCTION cidr(ip6) RETURNS cidr AS 'MODULE_PATHNAME','ip6_cast_to...
  function cidr (line 156) | CREATE FUNCTION cidr(ip6r) RETURNS cidr AS 'MODULE_PATHNAME','ip6r_cast_...
  function cidr (line 157) | CREATE FUNCTION cidr(ipaddress) RETURNS cidr AS 'MODULE_PATHNAME','ipadd...
  function cidr (line 158) | CREATE FUNCTION cidr(iprange) RETURNS cidr AS 'MODULE_PATHNAME','iprange...
  function text (line 160) | CREATE FUNCTION text(ip4) RETURNS text AS 'MODULE_PATHNAME','ip4_cast_to...
  function text (line 161) | CREATE FUNCTION text(ip4r) RETURNS text AS 'MODULE_PATHNAME','ip4r_cast_...
  function text (line 162) | CREATE FUNCTION text(ip6) RETURNS text AS 'MODULE_PATHNAME','ip6_cast_to...
  function text (line 163) | CREATE FUNCTION text(ip6r) RETURNS text AS 'MODULE_PATHNAME','ip6r_cast_...
  function text (line 164) | CREATE FUNCTION text(ipaddress) RETURNS text AS 'MODULE_PATHNAME','ipadd...
  function text (line 165) | CREATE FUNCTION text(iprange) RETURNS text AS 'MODULE_PATHNAME','iprange...
  function to_bigint (line 167) | CREATE FUNCTION to_bigint(ip4) RETURNS bigint AS 'MODULE_PATHNAME','ip4_...
  function to_double (line 168) | CREATE FUNCTION to_double(ip4) RETURNS double precision AS 'MODULE_PATHN...
  function to_numeric (line 169) | CREATE FUNCTION to_numeric(ip4) RETURNS numeric AS 'MODULE_PATHNAME','ip...
  function to_numeric (line 170) | CREATE FUNCTION to_numeric(ip6) RETURNS numeric AS 'MODULE_PATHNAME','ip...
  function to_numeric (line 171) | CREATE FUNCTION to_numeric(ipaddress) RETURNS numeric AS 'MODULE_PATHNAM...
  function to_bit (line 172) | CREATE FUNCTION to_bit(ip4) RETURNS varbit AS 'MODULE_PATHNAME','ip4_cas...
  function to_bit (line 173) | CREATE FUNCTION to_bit(ip6) RETURNS varbit AS 'MODULE_PATHNAME','ip6_cas...
  function to_bit (line 174) | CREATE FUNCTION to_bit(ipaddress) RETURNS varbit AS 'MODULE_PATHNAME','i...
  function to_bit (line 175) | CREATE FUNCTION to_bit(ip4r) RETURNS varbit AS 'MODULE_PATHNAME','ip4r_c...
  function to_bit (line 176) | CREATE FUNCTION to_bit(ip6r) RETURNS varbit AS 'MODULE_PATHNAME','ip6r_c...
  function to_bit (line 177) | CREATE FUNCTION to_bit(iprange) RETURNS varbit AS 'MODULE_PATHNAME','ipr...
  function to_bytea (line 178) | CREATE FUNCTION to_bytea(ip4) RETURNS bytea AS 'MODULE_PATHNAME','ip4_ca...
  function to_bytea (line 179) | CREATE FUNCTION to_bytea(ip6) RETURNS bytea AS 'MODULE_PATHNAME','ip6_ca...
  function to_bytea (line 180) | CREATE FUNCTION to_bytea(ipaddress) RETURNS bytea AS 'MODULE_PATHNAME','...
  function text (line 189) | CREATE CAST (ip4 as bigint) WITH FUNCTION to_bigint(ip4);
  function ip6r (line 294) | CREATE FUNCTION ip6r(ip6,ip6) RETURNS ip6r AS 'MODULE_PATHNAME', 'ip6r_f...
  function iprange (line 295) | CREATE FUNCTION iprange(ip4,ip4) RETURNS iprange AS 'MODULE_PATHNAME', '...
  function iprange (line 296) | CREATE FUNCTION iprange(ip6,ip6) RETURNS iprange AS 'MODULE_PATHNAME', '...
  function iprange (line 297) | CREATE FUNCTION iprange(ipaddress,ipaddress) RETURNS iprange AS 'MODULE_...
  function family (line 302) | CREATE FUNCTION family(ip4) RETURNS integer AS $f$ select 4; $f$ LANGUAG...
  function family (line 303) | CREATE FUNCTION family(ip4r) RETURNS integer AS $f$ select 4; $f$ LANGUA...
  function family (line 304) | CREATE FUNCTION family(ip6) RETURNS integer AS $f$ select 6; $f$ LANGUAG...
  function family (line 305) | CREATE FUNCTION family(ip6r) RETURNS integer AS $f$ select 6; $f$ LANGUA...
  function family (line 306) | CREATE FUNCTION family(ipaddress) RETURNS integer AS 'MODULE_PATHNAME', ...
  function family (line 307) | CREATE FUNCTION family(iprange) RETURNS integer AS 'MODULE_PATHNAME', 'i...
  function ip4_netmask (line 309) | CREATE FUNCTION ip4_netmask(integer) RETURNS ip4 AS 'MODULE_PATHNAME', '...
  function ip6_netmask (line 310) | CREATE FUNCTION ip6_netmask(integer) RETURNS ip6 AS 'MODULE_PATHNAME', '...
  function is_cidr (line 312) | CREATE FUNCTION is_cidr(ip4r) RETURNS boolean AS 'MODULE_PATHNAME', 'ip4...
  function is_cidr (line 313) | CREATE FUNCTION is_cidr(ip6r) RETURNS boolean AS 'MODULE_PATHNAME', 'ip6...
  function is_cidr (line 314) | CREATE FUNCTION is_cidr(iprange) RETURNS boolean AS 'MODULE_PATHNAME', '...
  function masklen (line 316) | CREATE FUNCTION masklen(ip4r) RETURNS integer AS 'MODULE_PATHNAME','ip4r...
  function masklen (line 317) | CREATE FUNCTION masklen(ip6r) RETURNS integer AS 'MODULE_PATHNAME','ip6r...
  function masklen (line 318) | CREATE FUNCTION masklen(iprange) RETURNS integer AS 'MODULE_PATHNAME','i...
  function lower (line 320) | CREATE FUNCTION lower(ip4r) RETURNS ip4 AS 'MODULE_PATHNAME', 'ip4r_lowe...
  function lower (line 321) | CREATE FUNCTION lower(ip6r) RETURNS ip6 AS 'MODULE_PATHNAME', 'ip6r_lowe...
  function lower (line 322) | CREATE FUNCTION lower(iprange) RETURNS ipaddress AS 'MODULE_PATHNAME', '...
  function upper (line 324) | CREATE FUNCTION upper(ip4r) RETURNS ip4 AS 'MODULE_PATHNAME', 'ip4r_uppe...
  function upper (line 325) | CREATE FUNCTION upper(ip6r) RETURNS ip6 AS 'MODULE_PATHNAME', 'ip6r_uppe...
  function upper (line 326) | CREATE FUNCTION upper(iprange) RETURNS ipaddress AS 'MODULE_PATHNAME', '...
  function ip4_net_lower (line 328) | CREATE FUNCTION ip4_net_lower(ip4,integer) RETURNS ip4 AS 'MODULE_PATHNA...
  function ip6_net_lower (line 329) | CREATE FUNCTION ip6_net_lower(ip6,integer) RETURNS ip6 AS 'MODULE_PATHNA...
  function ipaddress_net_lower (line 330) | CREATE FUNCTION ipaddress_net_lower(ipaddress,integer) RETURNS ipaddress...
  function ip4_net_upper (line 332) | CREATE FUNCTION ip4_net_upper(ip4,integer) RETURNS ip4 AS 'MODULE_PATHNA...
  function ip6_net_upper (line 333) | CREATE FUNCTION ip6_net_upper(ip6,integer) RETURNS ip6 AS 'MODULE_PATHNA...
  function ipaddress_net_upper (line 334) | CREATE FUNCTION ipaddress_net_upper(ipaddress,integer) RETURNS ipaddress...
  function ip4r_union (line 336) | CREATE FUNCTION ip4r_union(ip4r, ip4r) RETURNS ip4r AS 'MODULE_PATHNAME'...
  function ip6r_union (line 337) | CREATE FUNCTION ip6r_union(ip6r, ip6r) RETURNS ip6r AS 'MODULE_PATHNAME'...
  function iprange_union (line 338) | CREATE FUNCTION iprange_union(iprange, iprange) RETURNS iprange AS 'MODU...
  function ip4r_inter (line 340) | CREATE FUNCTION ip4r_inter(ip4r,ip4r) RETURNS ip4r AS 'MODULE_PATHNAME',...
  function ip6r_inter (line 341) | CREATE FUNCTION ip6r_inter(ip6r,ip6r) RETURNS ip6r AS 'MODULE_PATHNAME',...
  function iprange_inter (line 342) | CREATE FUNCTION iprange_inter(iprange,iprange) RETURNS iprange AS 'MODUL...
  function cidr_split (line 344) | CREATE FUNCTION cidr_split(ip4r) RETURNS SETOF ip4r AS 'MODULE_PATHNAME'...
  function cidr_split (line 345) | CREATE FUNCTION cidr_split(ip6r) RETURNS SETOF ip6r AS 'MODULE_PATHNAME'...
  function cidr_split (line 346) | CREATE FUNCTION cidr_split(iprange) RETURNS SETOF iprange AS 'MODULE_PAT...
  function ip4r_net_mask (line 356) | CREATE FUNCTION ip4r_net_mask(ip4,ip4) RETURNS ip4r AS 'MODULE_PATHNAME'...
  function ip6r_net_mask (line 357) | CREATE FUNCTION ip6r_net_mask(ip6,ip6) RETURNS ip6r AS 'MODULE_PATHNAME'...
  function iprange_net_mask (line 358) | CREATE FUNCTION iprange_net_mask(ip4,ip4) RETURNS iprange AS 'MODULE_PAT...
  function iprange_net_mask (line 359) | CREATE FUNCTION iprange_net_mask(ip6,ip6) RETURNS iprange AS 'MODULE_PAT...
  function iprange_net_mask (line 360) | CREATE FUNCTION iprange_net_mask(ipaddress,ipaddress) RETURNS iprange AS...
  function ip4r_net_prefix (line 362) | CREATE FUNCTION ip4r_net_prefix(ip4,integer) RETURNS ip4r AS 'MODULE_PAT...
  function ip6r_net_prefix (line 363) | CREATE FUNCTION ip6r_net_prefix(ip6,integer) RETURNS ip6r AS 'MODULE_PAT...
  function iprange_net_prefix (line 364) | CREATE FUNCTION iprange_net_prefix(ip4,integer) RETURNS iprange AS 'MODU...
  function iprange_net_prefix (line 365) | CREATE FUNCTION iprange_net_prefix(ip6,integer) RETURNS iprange AS 'MODU...
  function iprange_net_prefix (line 366) | CREATE FUNCTION iprange_net_prefix(ipaddress,integer) RETURNS iprange AS...
  function iprange_size (line 379) | CREATE FUNCTION iprange_size(iprange) RETURNS double precision AS 'MODUL...
  function ip4r_size_exact (line 381) | CREATE FUNCTION ip4r_size_exact(ip4r) RETURNS numeric AS 'MODULE_PATHNAM...
  function ip6r_size_exact (line 382) | CREATE FUNCTION ip6r_size_exact(ip6r) RETURNS numeric AS 'MODULE_PATHNAM...
  function iprange_size_exact (line 383) | CREATE FUNCTION iprange_size_exact(iprange) RETURNS numeric AS 'MODULE_P...
  function ip4_and (line 400) | CREATE FUNCTION ip4_and(ip4,ip4) RETURNS ip4 AS 'MODULE_PATHNAME', 'ip4_...
  function ip6_and (line 401) | CREATE FUNCTION ip6_and(ip6,ip6) RETURNS ip6 AS 'MODULE_PATHNAME', 'ip6_...
  function ipaddress_and (line 402) | CREATE FUNCTION ipaddress_and(ipaddress,ipaddress) RETURNS ipaddress AS ...
  function ip4_or (line 408) | CREATE FUNCTION ip4_or(ip4,ip4) RETURNS ip4 AS 'MODULE_PATHNAME', 'ip4_o...
  function ip6_or (line 409) | CREATE FUNCTION ip6_or(ip6,ip6) RETURNS ip6 AS 'MODULE_PATHNAME', 'ip6_o...
  function ipaddress_or (line 410) | CREATE FUNCTION ipaddress_or(ipaddress,ipaddress) RETURNS ipaddress AS '...
  function ip4_not (line 416) | CREATE FUNCTION ip4_not(ip4) RETURNS ip4 AS 'MODULE_PATHNAME', 'ip4_not'...
  function ip6_not (line 417) | CREATE FUNCTION ip6_not(ip6) RETURNS ip6 AS 'MODULE_PATHNAME', 'ip6_not'...
  function ipaddress_not (line 418) | CREATE FUNCTION ipaddress_not(ipaddress) RETURNS ipaddress AS 'MODULE_PA...
  function ip4_xor (line 420) | CREATE OPERATOR ~ ( RIGHTARG = ip4,       PROCEDURE = ip4_not );
  function ip6_xor (line 425) | CREATE FUNCTION ip6_xor(ip6,ip6) RETURNS ip6 AS 'MODULE_PATHNAME', 'ip6_...
  function ipaddress_xor (line 426) | CREATE FUNCTION ipaddress_xor(ipaddress,ipaddress) RETURNS ipaddress AS ...
  function ip4_plus_numeric (line 436) | CREATE FUNCTION ip4_plus_numeric(ip4,numeric) RETURNS ip4 AS 'MODULE_PAT...
  function ip6_plus_numeric (line 444) | CREATE FUNCTION ip6_plus_numeric(ip6,numeric) RETURNS ip6 AS 'MODULE_PAT...
  function ipaddress_plus_numeric (line 452) | CREATE FUNCTION ipaddress_plus_numeric(ipaddress,numeric) RETURNS ipaddr...
  function ip4_minus_numeric (line 460) | CREATE FUNCTION ip4_minus_numeric(ip4,numeric) RETURNS ip4 AS 'MODULE_PA...
  function ip6_minus_numeric (line 468) | CREATE FUNCTION ip6_minus_numeric(ip6,numeric) RETURNS ip6 AS 'MODULE_PA...
  function ipaddress_minus_numeric (line 476) | CREATE FUNCTION ipaddress_minus_numeric(ipaddress,numeric) RETURNS ipadd...
  function ipaddress_minus_ipaddress (line 484) | CREATE FUNCTION ipaddress_minus_ipaddress(ipaddress,ipaddress) RETURNS n...
  function iprange_contained_by (line 494) | CREATE FUNCTION iprange_contained_by(iprange,iprange) RETURNS bool AS 'M...
  function iprange_contained_by_strict (line 502) | CREATE FUNCTION iprange_contained_by_strict(iprange,iprange) RETURNS boo...
  function iprange_contains (line 510) | CREATE FUNCTION iprange_contains(iprange,iprange) RETURNS bool AS 'MODUL...
  function iprange_contains_strict (line 518) | CREATE FUNCTION iprange_contains_strict(iprange,iprange) RETURNS bool AS...
  function iprange_overlaps (line 526) | CREATE FUNCTION iprange_overlaps(iprange,iprange) RETURNS bool AS 'MODUL...
  function ip4_contained_by (line 536) | CREATE FUNCTION ip4_contained_by(ip4,ip4r) RETURNS bool AS 'MODULE_PATHN...
  function ip4_contained_by (line 537) | CREATE FUNCTION ip4_contained_by(ip4,iprange) RETURNS bool AS 'MODULE_PA...
  function ip6_contained_by (line 538) | CREATE FUNCTION ip6_contained_by(ip6,ip6r) RETURNS bool AS 'MODULE_PATHN...
  function ip6_contained_by (line 539) | CREATE FUNCTION ip6_contained_by(ip6,iprange) RETURNS bool AS 'MODULE_PA...
  function ipaddress_contained_by (line 540) | CREATE FUNCTION ipaddress_contained_by(ipaddress,iprange) RETURNS bool A...
  function ip4_contains (line 542) | CREATE FUNCTION ip4_contains(ip4r,ip4) RETURNS bool AS 'MODULE_PATHNAME'...
  function ip6_contains (line 543) | CREATE FUNCTION ip6_contains(ip6r,ip6) RETURNS bool AS 'MODULE_PATHNAME'...
  function ip4_contains (line 544) | CREATE FUNCTION ip4_contains(iprange,ip4) RETURNS bool AS 'MODULE_PATHNA...
  function ip6_contains (line 545) | CREATE FUNCTION ip6_contains(iprange,ip6) RETURNS bool AS 'MODULE_PATHNA...
  function ipaddress_contains (line 546) | CREATE FUNCTION ipaddress_contains(iprange,ipaddress) RETURNS bool AS 'M...
  function ip4_eq (line 554) | CREATE FUNCTION ip4_eq(ip4,ip4) RETURNS bool AS 'MODULE_PATHNAME' LANGUA...
  function ip4r_eq (line 555) | CREATE FUNCTION ip4r_eq(ip4r,ip4r) RETURNS bool AS 'MODULE_PATHNAME' LAN...
  function ip6_eq (line 556) | CREATE FUNCTION ip6_eq(ip6,ip6) RETURNS bool AS 'MODULE_PATHNAME' LANGUA...
  function ip6r_eq (line 557) | CREATE FUNCTION ip6r_eq(ip6r,ip6r) RETURNS bool AS 'MODULE_PATHNAME' LAN...
  function ipaddress_eq (line 558) | CREATE FUNCTION ipaddress_eq(ipaddress,ipaddress) RETURNS bool AS 'MODUL...
  function iprange_eq (line 559) | CREATE FUNCTION iprange_eq(iprange,iprange) RETURNS bool AS 'MODULE_PATH...
  function ip4r_ge (line 569) | CREATE FUNCTION ip4r_ge(ip4r,ip4r) RETURNS bool AS 'MODULE_PATHNAME' LAN...
  function ip6_ge (line 570) | CREATE FUNCTION ip6_ge(ip6,ip6) RETURNS bool AS 'MODULE_PATHNAME' LANGUA...
  function ip6r_ge (line 571) | CREATE FUNCTION ip6r_ge(ip6r,ip6r) RETURNS bool AS 'MODULE_PATHNAME' LAN...
  function ipaddress_ge (line 572) | CREATE FUNCTION ipaddress_ge(ipaddress,ipaddress) RETURNS bool AS 'MODUL...
  function iprange_ge (line 573) | CREATE FUNCTION iprange_ge(iprange,iprange) RETURNS bool AS 'MODULE_PATH...
  function ip6_gt (line 584) | CREATE FUNCTION ip6_gt(ip6,ip6) RETURNS bool AS 'MODULE_PATHNAME' LANGUA...
  function ip6r_gt (line 585) | CREATE FUNCTION ip6r_gt(ip6r,ip6r) RETURNS bool AS 'MODULE_PATHNAME' LAN...
  function ipaddress_gt (line 586) | CREATE FUNCTION ipaddress_gt(ipaddress,ipaddress) RETURNS bool AS 'MODUL...
  function iprange_gt (line 587) | CREATE FUNCTION iprange_gt(iprange,iprange) RETURNS bool AS 'MODULE_PATH...
  function ip6_le (line 598) | CREATE FUNCTION ip6_le(ip6,ip6) RETURNS bool AS 'MODULE_PATHNAME' LANGUA...
  function ip6r_le (line 599) | CREATE FUNCTION ip6r_le(ip6r,ip6r) RETURNS bool AS 'MODULE_PATHNAME' LAN...
  function ipaddress_le (line 600) | CREATE FUNCTION ipaddress_le(ipaddress,ipaddress) RETURNS bool AS 'MODUL...
  function iprange_le (line 601) | CREATE FUNCTION iprange_le(iprange,iprange) RETURNS bool AS 'MODULE_PATH...
  function ip6_lt (line 612) | CREATE FUNCTION ip6_lt(ip6,ip6) RETURNS bool AS 'MODULE_PATHNAME' LANGUA...
  function ip6r_lt (line 613) | CREATE FUNCTION ip6r_lt(ip6r,ip6r) RETURNS bool AS 'MODULE_PATHNAME' LAN...
  function ipaddress_lt (line 614) | CREATE FUNCTION ipaddress_lt(ipaddress,ipaddress) RETURNS bool AS 'MODUL...
  function iprange_lt (line 615) | CREATE FUNCTION iprange_lt(iprange,iprange) RETURNS bool AS 'MODULE_PATH...
  function ip6_neq (line 626) | CREATE FUNCTION ip6_neq(ip6,ip6) RETURNS bool AS 'MODULE_PATHNAME' LANGU...
  function ip6r_neq (line 627) | CREATE FUNCTION ip6r_neq(ip6r,ip6r) RETURNS bool AS 'MODULE_PATHNAME' LA...
  function ipaddress_neq (line 628) | CREATE FUNCTION ipaddress_neq(ipaddress,ipaddress) RETURNS bool AS 'MODU...
  function iprange_neq (line 629) | CREATE FUNCTION iprange_neq(iprange,iprange) RETURNS bool AS 'MODULE_PAT...
  function ip6_cmp (line 643) | CREATE FUNCTION ip6_cmp(ip6,ip6) RETURNS integer AS 'MODULE_PATHNAME' LA...
  function ip6r_cmp (line 644) | CREATE FUNCTION ip6r_cmp(ip6r,ip6r) RETURNS integer AS 'MODULE_PATHNAME'...
  function ipaddress_cmp (line 645) | CREATE FUNCTION ipaddress_cmp(ipaddress,ipaddress) RETURNS integer AS 'M...
  function iprange_cmp (line 646) | CREATE FUNCTION iprange_cmp(iprange,iprange) RETURNS integer AS 'MODULE_...
  function in_range (line 648) | CREATE FUNCTION in_range(ip4,ip4,bigint,boolean,boolean) RETURNS boolean...
  function in_range (line 649) | CREATE FUNCTION in_range(ip4,ip4,ip4,boolean,boolean) RETURNS boolean AS...
  function in_range (line 650) | CREATE FUNCTION in_range(ip6,ip6,bigint,boolean,boolean) RETURNS boolean...
  function in_range (line 651) | CREATE FUNCTION in_range(ip6,ip6,ip6,boolean,boolean) RETURNS boolean AS...
  function ip4hash (line 653) | CREATE OPERATOR CLASS btree_ip4_ops DEFAULT FOR TYPE ip4 USING btree AS
  function ip6hash (line 708) | CREATE FUNCTION ip6hash(ip6) RETURNS integer AS 'MODULE_PATHNAME', 'ip6h...
  function ipaddresshash (line 709) | CREATE FUNCTION ipaddresshash(ipaddress) RETURNS integer AS 'MODULE_PATH...
  function ip4rhash (line 710) | CREATE FUNCTION ip4rhash(ip4r) RETURNS integer AS 'MODULE_PATHNAME', 'ip...
  function ip6rhash (line 711) | CREATE FUNCTION ip6rhash(ip6r) RETURNS integer AS 'MODULE_PATHNAME', 'ip...
  function iprangehash (line 712) | CREATE FUNCTION iprangehash(iprange) RETURNS integer AS 'MODULE_PATHNAME...
  function iprange_hash (line 714) | CREATE FUNCTION iprange_hash(iprange) RETURNS integer AS 'MODULE_PATHNAM...
  function ip4_hash_extended (line 716) | CREATE FUNCTION ip4_hash_extended(ip4,bigint) RETURNS bigint AS 'MODULE_...
  function ip6_hash_extended (line 717) | CREATE FUNCTION ip6_hash_extended(ip6,bigint) RETURNS bigint AS 'MODULE_...
  function ipaddress_hash_extended (line 718) | CREATE FUNCTION ipaddress_hash_extended(ipaddress,bigint) RETURNS bigint...
  function ip4r_hash_extended (line 719) | CREATE FUNCTION ip4r_hash_extended(ip4r,bigint) RETURNS bigint AS 'MODUL...
  function ip6r_hash_extended (line 720) | CREATE FUNCTION ip6r_hash_extended(ip6r,bigint) RETURNS bigint AS 'MODUL...
  function iprange_hash_extended (line 721) | CREATE FUNCTION iprange_hash_extended(iprange,bigint) RETURNS bigint AS ...
  function gip4r_consistent (line 723) | CREATE OPERATOR CLASS hash_ip4_ops DEFAULT FOR TYPE ip4 USING hash AS
  function gip4r_compress (line 751) | CREATE FUNCTION gip4r_compress(internal) RETURNS internal  AS 'MODULE_PA...
  function gip4r_decompress (line 752) | CREATE FUNCTION gip4r_decompress(internal) RETURNS internal  AS 'MODULE_...
  function gip4r_penalty (line 753) | CREATE FUNCTION gip4r_penalty(internal,internal,internal) RETURNS intern...
  function gip4r_picksplit (line 754) | CREATE FUNCTION gip4r_picksplit(internal, internal) RETURNS internal AS ...
  function gip4r_union (line 755) | CREATE FUNCTION gip4r_union(internal, internal) RETURNS ip4r AS 'MODULE_...
  function gip4r_same (line 756) | CREATE FUNCTION gip4r_same(ip4r, ip4r, internal) RETURNS internal  AS 'M...
  function gip4r_fetch (line 757) | CREATE FUNCTION gip4r_fetch(internal) RETURNS internal	AS 'MODULE_PATHNA...
  function gip6r_consistent (line 759) | CREATE FUNCTION gip6r_consistent(internal,ip6r,int2,oid,internal) RETURN...
  function gip6r_compress (line 760) | CREATE FUNCTION gip6r_compress(internal) RETURNS internal  AS 'MODULE_PA...
  function gip6r_decompress (line 761) | CREATE FUNCTION gip6r_decompress(internal) RETURNS internal  AS 'MODULE_...
  function gip6r_penalty (line 762) | CREATE FUNCTION gip6r_penalty(internal,internal,internal) RETURNS intern...
  function gip6r_picksplit (line 763) | CREATE FUNCTION gip6r_picksplit(internal, internal) RETURNS internal AS ...
  function gip6r_union (line 764) | CREATE FUNCTION gip6r_union(internal, internal) RETURNS ip6r AS 'MODULE_...
  function gip6r_same (line 765) | CREATE FUNCTION gip6r_same(ip6r, ip6r, internal) RETURNS internal  AS 'M...
  function gip6r_fetch (line 766) | CREATE FUNCTION gip6r_fetch(internal) RETURNS internal	AS 'MODULE_PATHNA...
  function gipr_consistent (line 768) | CREATE FUNCTION gipr_consistent(internal,iprange,int2,oid,internal) RETU...
  function gipr_compress (line 769) | CREATE FUNCTION gipr_compress(internal) RETURNS internal  AS 'MODULE_PAT...
  function gipr_decompress (line 770) | CREATE FUNCTION gipr_decompress(internal) RETURNS internal  AS 'MODULE_P...
  function gipr_penalty (line 771) | CREATE FUNCTION gipr_penalty(internal,internal,internal) RETURNS interna...
  function gipr_picksplit (line 772) | CREATE FUNCTION gipr_picksplit(internal, internal) RETURNS internal AS '...
  function gipr_union (line 773) | CREATE FUNCTION gipr_union(internal, internal) RETURNS iprange AS 'MODUL...
  function gipr_same (line 774) | CREATE FUNCTION gipr_same(iprange, iprange, internal) RETURNS internal	A...
  function gipr_fetch (line 775) | CREATE FUNCTION gipr_fetch(internal) RETURNS internal  AS 'MODULE_PATHNA...

FILE: scripts/ip4r--unpackaged1--2.0.sql
  function ip4_in (line 11) | CREATE OR REPLACE FUNCTION ip4_in(cstring) RETURNS ip4 AS 'MODULE_PATHNA...
  function ip4_out (line 12) | CREATE OR REPLACE FUNCTION ip4_out(ip4) RETURNS cstring AS 'MODULE_PATHN...
  function ip4_recv (line 13) | CREATE OR REPLACE FUNCTION ip4_recv(internal) RETURNS ip4 AS 'MODULE_PAT...
  function ip4_send (line 14) | CREATE OR REPLACE FUNCTION ip4_send(ip4) RETURNS bytea AS 'MODULE_PATHNA...
  function ip4r_in (line 30) | CREATE OR REPLACE FUNCTION ip4r_in(cstring) RETURNS ip4r AS 'MODULE_PATH...
  function ip4r_out (line 31) | CREATE OR REPLACE FUNCTION ip4r_out(ip4r) RETURNS cstring AS 'MODULE_PAT...
  function ip4r_recv (line 32) | CREATE OR REPLACE FUNCTION ip4r_recv(internal) RETURNS ip4r AS 'MODULE_P...
  function ip4r_send (line 33) | CREATE OR REPLACE FUNCTION ip4r_send(ip4r) RETURNS bytea AS 'MODULE_PATH...
  function ip6_in (line 49) | CREATE OR REPLACE FUNCTION ip6_in(cstring) RETURNS ip6 AS 'MODULE_PATHNA...
  function ip6_out (line 50) | CREATE OR REPLACE FUNCTION ip6_out(ip6) RETURNS cstring AS 'MODULE_PATHN...
  function ip6_recv (line 51) | CREATE OR REPLACE FUNCTION ip6_recv(internal) RETURNS ip6 AS 'MODULE_PAT...
  function ip6_send (line 52) | CREATE OR REPLACE FUNCTION ip6_send(ip6) RETURNS bytea AS 'MODULE_PATHNA...
  function ip6r_in (line 64) | CREATE OR REPLACE FUNCTION ip6r_in(cstring) RETURNS ip6r AS 'MODULE_PATH...
  function ip6r_out (line 65) | CREATE OR REPLACE FUNCTION ip6r_out(ip6r) RETURNS cstring AS 'MODULE_PAT...
  function ip6r_recv (line 66) | CREATE OR REPLACE FUNCTION ip6r_recv(internal) RETURNS ip6r AS 'MODULE_P...
  function ip6r_send (line 67) | CREATE OR REPLACE FUNCTION ip6r_send(ip6r) RETURNS bytea AS 'MODULE_PATH...
  function ipaddress_in (line 79) | CREATE OR REPLACE FUNCTION ipaddress_in(cstring) RETURNS ipaddress AS 'M...
  function ipaddress_out (line 80) | CREATE OR REPLACE FUNCTION ipaddress_out(ipaddress) RETURNS cstring AS '...
  function ipaddress_recv (line 81) | CREATE OR REPLACE FUNCTION ipaddress_recv(internal) RETURNS ipaddress AS...
  function ipaddress_send (line 82) | CREATE OR REPLACE FUNCTION ipaddress_send(ipaddress) RETURNS bytea AS 'M...
  function iprange_in (line 94) | CREATE OR REPLACE FUNCTION iprange_in(cstring) RETURNS iprange AS 'MODUL...
  function iprange_out (line 95) | CREATE OR REPLACE FUNCTION iprange_out(iprange) RETURNS cstring AS 'MODU...
  function iprange_recv (line 96) | CREATE OR REPLACE FUNCTION iprange_recv(internal) RETURNS iprange AS 'MO...
  function iprange_send (line 97) | CREATE OR REPLACE FUNCTION iprange_send(iprange) RETURNS bytea AS 'MODUL...
  function ip4 (line 110) | CREATE OR REPLACE FUNCTION ip4(bigint) RETURNS ip4 AS 'MODULE_PATHNAME',...
  function ip4 (line 111) | CREATE OR REPLACE FUNCTION ip4(double precision) RETURNS ip4 AS 'MODULE_...
  function ip4 (line 112) | CREATE OR REPLACE FUNCTION ip4(numeric) RETURNS ip4 AS 'MODULE_PATHNAME'...
  function ip4 (line 113) | CREATE OR REPLACE FUNCTION ip4(inet) RETURNS ip4 AS 'MODULE_PATHNAME','i...
  function ip4 (line 114) | CREATE OR REPLACE FUNCTION ip4(text) RETURNS ip4 AS 'MODULE_PATHNAME','i...
  function ip4 (line 115) | CREATE OR REPLACE FUNCTION ip4(ipaddress) RETURNS ip4 AS 'MODULE_PATHNAM...
  function ip6 (line 117) | CREATE OR REPLACE FUNCTION ip6(numeric) RETURNS ip6 AS 'MODULE_PATHNAME'...
  function ip6 (line 118) | CREATE OR REPLACE FUNCTION ip6(inet) RETURNS ip6 AS 'MODULE_PATHNAME','i...
  function ip6 (line 119) | CREATE OR REPLACE FUNCTION ip6(text) RETURNS ip6 AS 'MODULE_PATHNAME','i...
  function ip6 (line 120) | CREATE OR REPLACE FUNCTION ip6(ipaddress) RETURNS ip6 AS 'MODULE_PATHNAM...
  function ipaddress (line 122) | CREATE OR REPLACE FUNCTION ipaddress(inet) RETURNS ipaddress AS 'MODULE_...
  function ipaddress (line 123) | CREATE OR REPLACE FUNCTION ipaddress(ip4) RETURNS ipaddress AS 'MODULE_P...
  function ipaddress (line 124) | CREATE OR REPLACE FUNCTION ipaddress(ip6) RETURNS ipaddress AS 'MODULE_P...
  function ipaddress (line 125) | CREATE OR REPLACE FUNCTION ipaddress(text) RETURNS ipaddress AS 'MODULE_...
  function ip4r (line 127) | CREATE OR REPLACE FUNCTION ip4r(cidr) RETURNS ip4r AS 'MODULE_PATHNAME',...
  function ip4r (line 128) | CREATE OR REPLACE FUNCTION ip4r(ip4) RETURNS ip4r AS 'MODULE_PATHNAME','...
  function ip4r (line 129) | CREATE OR REPLACE FUNCTION ip4r(text) RETURNS ip4r AS 'MODULE_PATHNAME',...
  function ip4r (line 130) | CREATE OR REPLACE FUNCTION ip4r(iprange) RETURNS ip4r AS 'MODULE_PATHNAM...
  function ip6r (line 132) | CREATE OR REPLACE FUNCTION ip6r(cidr) RETURNS ip6r AS 'MODULE_PATHNAME',...
  function ip6r (line 133) | CREATE OR REPLACE FUNCTION ip6r(ip6) RETURNS ip6r AS 'MODULE_PATHNAME','...
  function ip6r (line 134) | CREATE OR REPLACE FUNCTION ip6r(text) RETURNS ip6r AS 'MODULE_PATHNAME',...
  function ip6r (line 135) | CREATE OR REPLACE FUNCTION ip6r(iprange) RETURNS ip6r AS 'MODULE_PATHNAM...
  function iprange (line 137) | CREATE OR REPLACE FUNCTION iprange(cidr) RETURNS iprange AS 'MODULE_PATH...
  function iprange (line 138) | CREATE OR REPLACE FUNCTION iprange(ip4) RETURNS iprange AS 'MODULE_PATHN...
  function iprange (line 139) | CREATE OR REPLACE FUNCTION iprange(ip6) RETURNS iprange AS 'MODULE_PATHN...
  function iprange (line 140) | CREATE OR REPLACE FUNCTION iprange(ip4r) RETURNS iprange AS 'MODULE_PATH...
  function iprange (line 141) | CREATE OR REPLACE FUNCTION iprange(ip6r) RETURNS iprange AS 'MODULE_PATH...
  function iprange (line 142) | CREATE OR REPLACE FUNCTION iprange(ipaddress) RETURNS iprange AS 'MODULE...
  function iprange (line 143) | CREATE OR REPLACE FUNCTION iprange(text) RETURNS iprange AS 'MODULE_PATH...
  function cidr (line 148) | CREATE OR REPLACE FUNCTION cidr(ip4) RETURNS cidr AS 'MODULE_PATHNAME','...
  function cidr (line 149) | CREATE OR REPLACE FUNCTION cidr(ip4r) RETURNS cidr AS 'MODULE_PATHNAME',...
  function cidr (line 150) | CREATE OR REPLACE FUNCTION cidr(ip6) RETURNS cidr AS 'MODULE_PATHNAME','...
  function cidr (line 151) | CREATE OR REPLACE FUNCTION cidr(ip6r) RETURNS cidr AS 'MODULE_PATHNAME',...
  function cidr (line 152) | CREATE OR REPLACE FUNCTION cidr(ipaddress) RETURNS cidr AS 'MODULE_PATHN...
  function cidr (line 153) | CREATE OR REPLACE FUNCTION cidr(iprange) RETURNS cidr AS 'MODULE_PATHNAM...
  function text (line 155) | CREATE OR REPLACE FUNCTION text(ip4) RETURNS text AS 'MODULE_PATHNAME','...
  function text (line 156) | CREATE OR REPLACE FUNCTION text(ip4r) RETURNS text AS 'MODULE_PATHNAME',...
  function text (line 157) | CREATE OR REPLACE FUNCTION text(ip6) RETURNS text AS 'MODULE_PATHNAME','...
  function text (line 158) | CREATE OR REPLACE FUNCTION text(ip6r) RETURNS text AS 'MODULE_PATHNAME',...
  function text (line 159) | CREATE OR REPLACE FUNCTION text(ipaddress) RETURNS text AS 'MODULE_PATHN...
  function text (line 160) | CREATE OR REPLACE FUNCTION text(iprange) RETURNS text AS 'MODULE_PATHNAM...
  function to_bigint (line 162) | CREATE OR REPLACE FUNCTION to_bigint(ip4) RETURNS bigint AS 'MODULE_PATH...
  function to_double (line 163) | CREATE OR REPLACE FUNCTION to_double(ip4) RETURNS double precision AS 'M...
  function to_numeric (line 164) | CREATE OR REPLACE FUNCTION to_numeric(ip4) RETURNS numeric AS 'MODULE_PA...
  function to_numeric (line 165) | CREATE OR REPLACE FUNCTION to_numeric(ip6) RETURNS numeric AS 'MODULE_PA...
  function to_numeric (line 166) | CREATE OR REPLACE FUNCTION to_numeric(ipaddress) RETURNS numeric AS 'MOD...

FILE: sql/ip4r.sql
  type ipaddrs (line 2087) | create table ipaddrs (a ipaddress, a4 ip4, a6 ip6)
  type ipranges_r (line 2128) | create index ipranges_r on ipranges using gist (r)
  type ipranges_r4 (line 2129) | create index ipranges_r4 on ipranges using gist (r4)
  type ipranges_r6 (line 2130) | create index ipranges_r6 on ipranges using gist (r6)
  type ipaddrs_a (line 2131) | create index ipaddrs_a on ipaddrs (a)
  type ipaddrs_a4 (line 2132) | create index ipaddrs_a4 on ipaddrs (a4)
  type ipaddrs_a6 (line 2133) | create index ipaddrs_a6 on ipaddrs (a6)

FILE: src/ip4r.c
  function ip4r_from_str (line 27) | static
  function ip4r_to_str (line 95) | static inline
  function text (line 122) | static
  function set_text_len (line 131) | static inline
  function Datum (line 145) | Datum
  function Datum (line 159) | Datum
  function Datum (line 169) | Datum
  function Datum (line 177) | Datum
  function Datum (line 189) | Datum
  function Datum (line 198) | Datum
  function Datum (line 208) | Datum
  function Datum (line 218) | Datum
  function Datum (line 241) | Datum
  function Datum (line 260) | Datum
  function Datum (line 284) | Datum
  function Datum (line 292) | Datum
  function Datum (line 301) | Datum
  function Datum (line 315) | Datum
  function Datum (line 323) | Datum
  function Datum (line 353) | Datum
  function Datum (line 368) | Datum
  function Datum (line 386) | Datum
  function Datum (line 406) | Datum
  function Datum (line 424) | Datum
  function Datum (line 442) | Datum
  function Datum (line 458) | Datum
  function Datum (line 475) | Datum
  function Datum (line 492) | Datum
  function Datum (line 510) | Datum
  function Datum (line 529) | Datum
  function Datum (line 549) | Datum
  function Datum (line 567) | Datum
  function Datum (line 586) | Datum
  function Datum (line 606) | Datum
  function Datum (line 617) | Datum
  function Datum (line 627) | Datum
  function Datum (line 637) | Datum
  function Datum (line 647) | Datum
  function Datum (line 659) | Datum
  function Datum (line 677) | Datum
  function Datum (line 687) | Datum
  function Datum (line 707) | Datum
  function Datum (line 720) | Datum
  function Datum (line 729) | Datum
  function Datum (line 739) | Datum
  function Datum (line 749) | Datum
  function Datum (line 777) | Datum
  function Datum (line 802) | Datum
  function Datum (line 832) | Datum
  function Datum (line 850) | Datum
  function Datum (line 864) | Datum
  function Datum (line 896) | Datum
  function Datum (line 924) | Datum
  function Datum (line 949) | Datum
  function Datum (line 973) | Datum
  function Datum (line 981) | Datum
  function Datum (line 989) | Datum
  function Datum (line 1001) | Datum
  function Datum (line 1035) | Datum
  function Datum (line 1042) | Datum
  function Datum (line 1049) | Datum
  function Datum (line 1056) | Datum
  function Datum (line 1063) | Datum
  function Datum (line 1070) | Datum
  function Datum (line 1077) | Datum
  function Datum (line 1084) | Datum
  function Datum (line 1091) | Datum
  function Datum (line 1098) | Datum
  function Datum (line 1105) | Datum
  function Datum (line 1112) | Datum
  function Datum (line 1119) | Datum
  function Datum (line 1127) | Datum
  function Datum (line 1136) | Datum
  function Datum (line 1145) | Datum
  function Datum (line 1154) | Datum
  function Datum (line 1163) | Datum
  function Datum (line 1170) | Datum
  function Datum (line 1177) | Datum
  function Datum (line 1184) | Datum
  function Datum (line 1192) | Datum
  function Datum (line 1201) | Datum
  function Datum (line 1214) | Datum
  function Datum (line 1222) | Datum
  function Datum (line 1230) | Datum
  function Datum (line 1246) | Datum
  function Datum (line 1259) | Datum
  function Datum (line 1280) | Datum
  function Datum (line 1324) | Datum
  function Datum (line 1375) | Datum
  function Datum (line 1406) | Datum
  function Datum (line 1443) | Datum
  function Datum (line 1450) | Datum
  function Datum (line 1457) | Datum
  function Datum (line 1468) | Datum
  type gip4r_sort (line 1504) | struct gip4r_sort
  function gip4r_sort_compare (line 1510) | static int
  function Datum (line 1525) | Datum
  function Datum (line 1660) | Datum
  function gip4r_leaf_consistent (line 1693) | static bool
  function gip4r_internal_consistent (line 1733) | bool

FILE: src/ip4r_funcs.h
  function uint32 (line 3) | static inline
  function uint32 (line 9) | static inline
  function masklen (line 19) | static inline
  function ip4_valid_netmask (line 48) | static inline
  function ip4r_from_cidr (line 68) | static inline
  function ip4r_from_inet (line 81) | static inline
  function ip4r_split_cidr (line 92) | static inline
  function ip4_equal (line 128) | static inline
  function ip4_lessthan (line 134) | static inline
  function ip4_less_eq (line 140) | static inline
  function IP4R (line 148) | static inline
  function IP4R (line 164) | static inline
  function ip4r_metric (line 188) | static inline
  function ip4r_equal (line 196) | static inline
  function ip4r_lessthan (line 202) | static inline
  function ip4r_less_eq (line 208) | static inline
  function ip4r_contains_internal (line 214) | static inline
  function ip4r_overlaps_internal (line 222) | static inline
  function ip4_contains_internal (line 228) | static inline
  function ip4r_left_internal (line 234) | static inline
  function ip4r_extends_left_of_internal (line 240) | static inline
  function ip4r_extends_right_of_internal (line 246) | static inline

FILE: src/ip6r.c
  function ip6r_from_str (line 26) | static
  function ip6r_to_str (line 94) | static
  function text (line 130) | static
  function set_text_len (line 139) | static inline
  function Datum (line 153) | Datum
  function Datum (line 167) | Datum
  function Datum (line 177) | Datum
  function Datum (line 190) | Datum
  function Datum (line 203) | Datum
  function Datum (line 212) | Datum
  function Datum (line 222) | Datum
  function Datum (line 232) | Datum
  function Datum (line 255) | Datum
  function Datum (line 275) | Datum
  function Datum (line 294) | Datum
  function Datum (line 318) | Datum
  function Datum (line 371) | Datum
  function Datum (line 390) | Datum
  function Datum (line 407) | Datum
  function Datum (line 426) | Datum
  function Datum (line 441) | Datum
  function Datum (line 461) | Datum
  function Datum (line 483) | Datum
  function Datum (line 505) | Datum
  function Datum (line 534) | Datum
  function Datum (line 563) | Datum
  function Datum (line 600) | Datum
  function Datum (line 620) | Datum
  function Datum (line 649) | Datum
  function Datum (line 660) | Datum
  function Datum (line 675) | Datum
  function Datum (line 689) | Datum
  function Datum (line 703) | Datum
  function Datum (line 717) | Datum
  function Datum (line 733) | Datum
  function Datum (line 752) | Datum
  function Datum (line 762) | Datum
  function Datum (line 784) | Datum
  function Datum (line 799) | Datum
  function Datum (line 808) | Datum
  function Datum (line 818) | Datum
  function Datum (line 828) | Datum
  function Datum (line 855) | Datum
  function Datum (line 881) | Datum
  function Datum (line 905) | Datum
  function Datum (line 923) | Datum
  function Datum (line 937) | Datum
  function Datum (line 968) | Datum
  function Datum (line 993) | Datum
  function Datum (line 1014) | Datum
  function Datum (line 1041) | Datum
  function Datum (line 1051) | Datum
  function Datum (line 1061) | Datum
  function Datum (line 1073) | Datum
  function Datum (line 1107) | Datum
  function Datum (line 1114) | Datum
  function Datum (line 1121) | Datum
  function Datum (line 1128) | Datum
  function Datum (line 1135) | Datum
  function Datum (line 1142) | Datum
  function Datum (line 1149) | Datum
  function Datum (line 1156) | Datum
  function Datum (line 1163) | Datum
  function Datum (line 1170) | Datum
  function Datum (line 1177) | Datum
  function Datum (line 1184) | Datum
  function Datum (line 1191) | Datum
  function Datum (line 1199) | Datum
  function Datum (line 1208) | Datum
  function Datum (line 1217) | Datum
  function Datum (line 1226) | Datum
  function Datum (line 1235) | Datum
  function Datum (line 1242) | Datum
  function Datum (line 1249) | Datum
  function Datum (line 1258) | Datum
  function Datum (line 1271) | Datum
  function Datum (line 1279) | Datum
  function Datum (line 1291) | Datum
  function Datum (line 1307) | Datum
  function Datum (line 1320) | Datum
  function Datum (line 1337) | Datum
  function Datum (line 1370) | Datum
  function Datum (line 1390) | Datum
  function Datum (line 1476) | Datum
  function Datum (line 1507) | Datum
  function Datum (line 1544) | Datum
  function Datum (line 1551) | Datum
  function Datum (line 1558) | Datum
  function Datum (line 1569) | Datum
  type gip6r_sort (line 1625) | struct gip6r_sort
  function gip6r_sort_compare (line 1631) | static int
  function Datum (line 1646) | Datum
  function Datum (line 1791) | Datum
  function gip6r_leaf_consistent (line 1824) | static bool
  function gip6r_internal_consistent (line 1864) | bool

FILE: src/ip6r_funcs.h
  function uint64 (line 9) | static inline
  function uint64 (line 19) | static inline
  function uint64 (line 27) | static inline
  function uint64 (line 33) | static inline
  function masklen64 (line 43) | static inline
  function masklen6 (line 83) | static inline
  function ip6_valid_netmask (line 98) | static inline
  function ip6_serialize (line 126) | static inline
  function ip6_deserialize (line 148) | static inline
  function ip6_equal (line 170) | static inline
  function ip6_compare (line 176) | static inline
  function ip6_lessthan (line 186) | static inline
  function ip6_sub (line 193) | static inline
  function ip6_sub_int (line 200) | static inline
  function ip6_in_range_internal (line 219) | static inline
  function ip6_in_range_internal_bits (line 258) | static inline
  function ip6r_from_cidr (line 279) | static inline
  function ip6r_from_inet (line 294) | static inline
  function ip6r_split_cidr (line 308) | static inline
  function IP6R (line 365) | static inline
  function IP6R (line 381) | static inline
  function ip6r_metric (line 407) | static inline
  function ip6_less_eq (line 423) | static inline
  function ip6r_equal (line 429) | static inline
  function ip6r_lessthan (line 435) | static inline
  function ip6r_less_eq (line 446) | static inline
  function ip6r_contains_internal (line 452) | static inline
  function ip6r_overlaps_internal (line 460) | static inline
  function ip6_contains_internal (line 466) | static inline

FILE: src/ipaddr.c
  function ipaddr_internal_error (line 26) | void ipaddr_internal_error(void)
  function Datum (line 43) | static inline
  function IP_P (line 66) | static inline
  function IP_P (line 94) | static inline
  function IP_P (line 121) | static inline
  function text (line 163) | static
  function set_text_len (line 176) | static inline
  function Datum (line 190) | Datum
  function Datum (line 213) | Datum
  function Datum (line 234) | Datum
  function Datum (line 276) | Datum
  function Datum (line 306) | Datum
  function Datum (line 315) | Datum
  function Datum (line 325) | Datum
  function Datum (line 349) | Datum
  function Datum (line 381) | Datum
  function Datum (line 404) | Datum
  function Datum (line 412) | Datum
  function Datum (line 419) | Datum
  function Datum (line 430) | Datum
  function Datum (line 443) | Datum
  function Datum (line 460) | Datum
  function Datum (line 479) | Datum
  function Datum (line 501) | Datum
  function Datum (line 508) | Datum
  function Datum (line 530) | Datum
  function Datum (line 538) | Datum
  function Datum (line 552) | Datum
  function Datum (line 559) | Datum
  function Datum (line 566) | Datum
  function Datum (line 573) | Datum
  function Datum (line 580) | Datum
  function Datum (line 587) | Datum
  function Datum (line 594) | Datum
  function Datum (line 601) | Datum
  function Datum (line 608) | Datum
  function Datum (line 646) | Datum
  function Datum (line 653) | Datum
  function Datum (line 660) | Datum
  function Datum (line 667) | Datum
  function ipaddr_comparison_bool (line 681) | static inline
  function Datum (line 725) | Datum
  function Datum (line 735) | Datum
  function Datum (line 745) | Datum
  function Datum (line 755) | Datum
  function Datum (line 765) | Datum
  function Datum (line 775) | Datum
  function Datum (line 790) | Datum

FILE: src/ipr.h
  type uint32 (line 34) | typedef uint32 IP4;
  type IP4R (line 39) | typedef struct IP4R {
  type IP6 (line 50) | typedef struct IP6 {
  type IP6R (line 57) | typedef struct IP6R {
  type IP (line 70) | typedef union IP {
  function ip_unpack (line 85) | static inline
  function IP_P (line 101) | static inline
  type IPR (line 112) | typedef union IPR {

FILE: src/ipr_internal.h
  function Datum (line 33) | static inline

FILE: src/iprange.c
  function iprange_internal_error (line 39) | static
  function iprange_af_mismatch (line 48) | static
  function ipr_unpack (line 73) | int ipr_unpack(IPR_P in, IPR *out)
  function IPR_P (line 114) | IPR_P ipr_pack(int af, IPR *val)
  function Datum (line 172) | Datum
  function Datum (line 201) | Datum
  function Datum (line 229) | Datum
  function Datum (line 328) | Datum
  function Datum (line 411) | Datum
  function Datum (line 423) | Datum
  function Datum (line 440) | Datum
  function Datum (line 458) | Datum
  function Datum (line 485) | Datum
  function Datum (line 514) | Datum
  function Datum (line 566) | Datum
  function Datum (line 644) | Datum
  function Datum (line 660) | Datum
  function Datum (line 676) | Datum
  function Datum (line 704) | Datum
  function Datum (line 715) | Datum
  function Datum (line 726) | Datum
  function Datum (line 746) | Datum
  function Datum (line 766) | Datum
  function Datum (line 818) | static
  function Datum (line 846) | Datum
  function Datum (line 856) | Datum
  function Datum (line 866) | Datum
  function Datum (line 882) | static Datum
  function Datum (line 910) | Datum
  function Datum (line 920) | Datum
  function Datum (line 930) | Datum
  function Datum (line 941) | static Datum
  function Datum (line 976) | Datum
  function Datum (line 986) | Datum
  function Datum (line 996) | Datum
  function Datum (line 1013) | Datum
  function Datum (line 1041) | Datum
  function Datum (line 1069) | Datum
  function Datum (line 1093) | Datum
  function Datum (line 1120) | Datum
  function iprange_cmp_internal (line 1200) | static int
  function Datum (line 1250) | Datum
  function Datum (line 1257) | Datum
  function Datum (line 1264) | Datum
  function Datum (line 1271) | Datum
  function Datum (line 1278) | Datum
  function Datum (line 1285) | Datum
  function iprange_overlaps_internal (line 1291) | static bool
  function iprange_contains_internal (line 1333) | static int
  function iprange_contains_ip_internal (line 1375) | static int
  function Datum (line 1413) | Datum
  function Datum (line 1421) | Datum
  function Datum (line 1430) | Datum
  function Datum (line 1439) | Datum
  function Datum (line 1448) | Datum
  function Datum (line 1457) | Datum
  function Datum (line 1470) | Datum
  function Datum (line 1478) | Datum
  function Datum (line 1486) | Datum
  function Datum (line 1494) | Datum
  function Datum (line 1502) | Datum
  function Datum (line 1515) | Datum
  function Datum (line 1550) | Datum
  function Datum (line 1591) | Datum
  function Datum (line 1615) | Datum
  function Datum (line 1649) | Datum
  function Datum (line 1675) | Datum
  type IPR_KEY (line 1699) | typedef struct {
  function Datum (line 1717) | Datum
  function Datum (line 1741) | Datum
  function Datum (line 1759) | Datum
  function Datum (line 1774) | Datum
  function gipr_union_internal_1 (line 1806) | static void
  function gipr_union_internal (line 1840) | static void
  function Datum (line 1919) | Datum
  function Datum (line 1947) | Datum
  type gipr_sort (line 2043) | struct gipr_sort
  function gipr_sort_compare_v4 (line 2049) | static int
  function gipr_sort_compare_v6 (line 2059) | static int
  function Datum (line 2076) | Datum
  function Datum (line 2263) | Datum
  function gipr_leaf_consistent (line 2314) | static bool
  function gipr_internal_consistent (line 2415) | static bool

FILE: src/raw_io.c
  function ip4_raw_input (line 10) | bool ip4_raw_input(const char *osrc, uint32 *dst)
  function ip6_raw_input (line 53) | bool ip6_raw_input(const char *osrc, uint64 *dst)
  function ip4_raw_output (line 147) | int ip4_raw_output(uint32 ip, char *str, int len)
  function ip6_raw_output (line 153) | int ip6_raw_output(uint64 *ip, char *str, int len)
Condensed preview — 35 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,027K chars).
[
  {
    "path": ".dir-locals.el",
    "chars": 1223,
    "preview": ";; largely stolen from pg itself\n\n((c-mode . ((c-basic-offset . 4)\n            (c-file-style . \"bsd\")\n\t    (c-file-offse"
  },
  {
    "path": ".editorconfig",
    "chars": 45,
    "preview": "\n[*]\ntab_width = 4\n\n[Makefile]\ntab_width = 8\n"
  },
  {
    "path": ".gitattributes",
    "chars": 302,
    "preview": "# gitattributes\n*\t\twhitespace=space-before-tab,trailing-space\n*.[chly]\twhitespace=space-before-tab,trailing-space,indent"
  },
  {
    "path": ".github/workflows/regr_macos.yml",
    "chars": 706,
    "preview": "name: Build on MacOS\n\non:\n  push:\n    branches: [ master ]\n    tags:     [ REL_* ]\n  pull_request:\n    branches: [ maste"
  },
  {
    "path": ".github/workflows/regression.yml",
    "chars": 1684,
    "preview": "name: Build\n\non:\n  push:\n    branches: [ master ]\n    tags:     [ REL_* ]\n  pull_request:\n    branches: [ master ]\n\njobs"
  },
  {
    "path": ".gitignore",
    "chars": 259,
    "preview": "*.o\n*.so\n*.so.[0-9]\n*.so.[0-9].[0-9]\n*.sl\n*.sl.[0-9]\n*.sl.[0-9].[0-9]\n*.dylib\n*.dll\n*.a\n*.mo\n*.bc\nobjfiles.txt\n.deps/\n*."
  },
  {
    "path": "LICENSE",
    "chars": 1045,
    "preview": "PostgreSQL License\n\nCopyright (c) 2004-2019, Andrew Gierth\nCopyright (c) 2003, Steve Atkins\nCopyright (c) 2000-2003, Pos"
  },
  {
    "path": "Makefile",
    "chars": 1710,
    "preview": "\nEXTENSION= ip4r\n\nMODULE_big = ip4r\n\nSRC_SQL\t= ip4r--2.4.sql \\\n\t  ip4r--2.2--2.4.sql \\\n\t  ip4r--2.1--2.2.sql \\\n\t  ip4r--"
  },
  {
    "path": "README.ip4r",
    "chars": 22354,
    "preview": "\nIP4R  - IPv4/v6 and IPv4/v6 range index type for PostgreSQL\n==========================================================="
  },
  {
    "path": "expected/ip4r-softerr.out",
    "chars": 27416,
    "preview": "-- Tests for pg16+\n--valid and invalid ip4\nselect v.i, v.t, pg_input_is_valid(v.t,'ip4') as valid, ierr.*\n  from (values"
  },
  {
    "path": "expected/ip4r-v11.out",
    "chars": 51716,
    "preview": "-- Tests for pg11+\n-- RANGE support\nselect a4,\n       array_agg(a4) over (order by a4 range between 268435456 preceding "
  },
  {
    "path": "expected/ip4r.out",
    "chars": 387999,
    "preview": "--\n/*CUT-HERE*/\nCREATE EXTENSION ip4r;\n-- Check whether any of our opclasses fail amvalidate\nDO $d$\n  DECLARE\n    r reco"
  },
  {
    "path": "ip4r.control",
    "chars": 85,
    "preview": "# ip4r\ndefault_version = '2.4'\nrelocatable = 'true'\nmodule_pathname = '$libdir/ip4r'\n"
  },
  {
    "path": "scripts/ip4r--2.0--2.1.sql",
    "chars": 2733,
    "preview": "/* ip4r--2.0--2.1.sql */\n\n-- complain if script is sourced in psql, rather than via ALTER EXTENSION\n\\echo Use \"ALTER EXT"
  },
  {
    "path": "scripts/ip4r--2.1--2.2.sql",
    "chars": 926,
    "preview": "/* ip4r--2.1--2.2.sql */\n\n-- complain if script is sourced in psql, rather than via ALTER EXTENSION\n\\echo Use \"ALTER EXT"
  },
  {
    "path": "scripts/ip4r--2.2--2.4.sql",
    "chars": 12065,
    "preview": "/* ip4r--2.2--2.4.sql */\n\n-- complain if script is sourced in psql, rather than via ALTER EXTENSION\n\\echo Use \"ALTER EXT"
  },
  {
    "path": "scripts/ip4r--2.4.sql",
    "chars": 59573,
    "preview": "-- ip4r extension\n\n-- complain if script is sourced in psql, rather than via CREATE EXTENSION\n\\echo Use \"CREATE EXTENSIO"
  },
  {
    "path": "scripts/ip4r--unpackaged1--2.0.sql",
    "chars": 52049,
    "preview": "-- ip4r extension\n\n-- complain if script is sourced in psql, rather than via CREATE EXTENSION\n\\echo Use \"CREATE EXTENSIO"
  },
  {
    "path": "scripts/ip4r--unpackaged2.0--2.0.sql",
    "chars": 22888,
    "preview": "-- ip4r extension\n\n-- complain if script is sourced in psql, rather than via CREATE EXTENSION\n\\echo Use \"CREATE EXTENSIO"
  },
  {
    "path": "scripts/ip4r--unpackaged2.1--2.1.sql",
    "chars": 23097,
    "preview": "-- ip4r extension\n\n-- complain if script is sourced in psql, rather than via CREATE EXTENSION\n\\echo Use \"CREATE EXTENSIO"
  },
  {
    "path": "sql/ip4r-softerr.sql",
    "chars": 6076,
    "preview": "-- Tests for pg16+\n\n--valid and invalid ip4\nselect v.i, v.t, pg_input_is_valid(v.t,'ip4') as valid, ierr.*\n  from (value"
  },
  {
    "path": "sql/ip4r-v11.sql",
    "chars": 1059,
    "preview": "-- Tests for pg11+\n\n-- RANGE support\n\nselect a4,\n       array_agg(a4) over (order by a4 range between 268435456 precedin"
  },
  {
    "path": "sql/ip4r.sql",
    "chars": 115239,
    "preview": "--\n\n/*CUT-HERE*/\nCREATE EXTENSION ip4r;\n\n-- Check whether any of our opclasses fail amvalidate\n\nDO $d$\n  DECLARE\n    r r"
  },
  {
    "path": "src/ip4r.c",
    "chars": 38542,
    "preview": "/* ip4r.c */\n\n#include \"postgres.h\"\n\n#include <math.h>\n#include <sys/socket.h>\n\n#include \"fmgr.h\"\n#include \"funcapi.h\"\n\n"
  },
  {
    "path": "src/ip4r_funcs.h",
    "chars": 4725,
    "preview": "/* ip4r_funcs.h */\n\nstatic inline\nuint32 hostmask(unsigned masklen)\n{\n\treturn (masklen) ? ( (((uint32)(1U)) << (32-maskl"
  },
  {
    "path": "src/ip4r_module.c",
    "chars": 90,
    "preview": "/* ip4r_module.c */\n\n#include \"postgres.h\"\n#include \"fmgr.h\"\n\nPG_MODULE_MAGIC;\n\n/* end */\n"
  },
  {
    "path": "src/ip6r.c",
    "chars": 44081,
    "preview": "/* ip6r.c */\n\n#include \"postgres.h\"\n\n#include <math.h>\n#include <sys/socket.h>\n\n#include \"fmgr.h\"\n#include \"funcapi.h\"\n\n"
  },
  {
    "path": "src/ip6r_funcs.h",
    "chars": 10198,
    "preview": "/* ip6r_funcs.h */\n\n/**************************************************************************/\n/* This part is the int"
  },
  {
    "path": "src/ipaddr.c",
    "chars": 18211,
    "preview": "/* ipaddr.c */\n\n#include \"postgres.h\"\n\n#include <math.h>\n#include <sys/socket.h>\n\n#include \"fmgr.h\"\n#include \"funcapi.h\""
  },
  {
    "path": "src/ipr.h",
    "chars": 3968,
    "preview": "/* ipr.h */\n#ifndef IPR_H\n#define IPR_H\n\n#if !defined(PG_VERSION_NUM)\n#error \"Unknown or unsupported postgresql version\""
  },
  {
    "path": "src/ipr_internal.h",
    "chars": 12131,
    "preview": "/* ipr_internal.h */\n#ifndef IPR_INTERNAL_H\n#define IPR_INTERNAL_H\n\n#include \"ipr.h\"\n\n#define IP4R_VERSION_STR \"2.4.2\"\n#"
  },
  {
    "path": "src/iprange.c",
    "chars": 57797,
    "preview": "/* iprange.c */\n\n#include \"postgres.h\"\n\n#include <math.h>\n#include <sys/socket.h>\n\n#include \"fmgr.h\"\n#include \"funcapi.h"
  },
  {
    "path": "src/raw_io.c",
    "chars": 6044,
    "preview": "/* raw_io.c */\n\n#include \"postgres.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"ipr_internal.h\"\n\nbool ip4_raw_i"
  },
  {
    "path": "tools/numeric-tests.mk",
    "chars": 385,
    "preview": "##\n\ninclude tools/numeric.mk\n\ndefine assert\n$(if $1,,$(error assert failed: $2))\nendef\n\ndefine assert_n\n$(if $1,$(error "
  },
  {
    "path": "tools/numeric.mk",
    "chars": 1201,
    "preview": "##--\n## Hacks for numeric comparisons.\n\n# $(call version_ge,a,b)\n#  true iff a >= b when treated as vectors of integers "
  }
]

About this extraction

This page contains the full source code of the RhodiumToad/ip4r GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 35 files (966.4 KB), approximately 362.8k tokens, and a symbol index with 752 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!