4 -- prepare the table...
6 ERROR: table "inet_tbl" does not exist
7 CREATE TABLE INET_TBL (c cidr, i inet);
8 INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.226/24');
9 INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.0/26', '192.168.1.226');
10 INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.0/24');
11 INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.0/25');
12 INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.255/24');
13 INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.255/25');
14 INSERT INTO INET_TBL (c, i) VALUES ('10', '10.1.2.3/8');
15 INSERT INTO INET_TBL (c, i) VALUES ('10.0.0.0', '10.1.2.3/8');
16 INSERT INTO INET_TBL (c, i) VALUES ('10.1.2.3', '10.1.2.3/32');
17 INSERT INTO INET_TBL (c, i) VALUES ('10.1.2', '10.1.2.3/24');
18 INSERT INTO INET_TBL (c, i) VALUES ('10.1', '10.1.2.3/16');
19 INSERT INTO INET_TBL (c, i) VALUES ('10', '10.1.2.3/8');
20 INSERT INTO INET_TBL (c, i) VALUES ('10', '11.1.2.3/8');
21 INSERT INTO INET_TBL (c, i) VALUES ('10', '9.1.2.3/8');
22 INSERT INTO INET_TBL (c, i) VALUES ('10:23::f1', '10:23::f1/64');
23 INSERT INTO INET_TBL (c, i) VALUES ('10:23::8000/113', '10:23::ffff');
24 INSERT INTO INET_TBL (c, i) VALUES ('::ffff:1.2.3.4', '::4.3.2.1/24');
25 -- check that CIDR rejects invalid input:
26 INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.2/30', '192.168.1.226');
27 ERROR: invalid cidr value: "192.168.1.2/30"
28 LINE 1: INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.2/30', '192.1...
30 DETAIL: Value has bits set to right of mask.
31 INSERT INTO INET_TBL (c, i) VALUES ('1234::1234::1234', '::1.2.3.4');
32 ERROR: invalid input syntax for type cidr: "1234::1234::1234"
33 LINE 1: INSERT INTO INET_TBL (c, i) VALUES ('1234::1234::1234', '::1...
35 -- check that CIDR rejects invalid input when converting from text:
36 INSERT INTO INET_TBL (c, i) VALUES (cidr('192.168.1.2/30'), '192.168.1.226');
37 ERROR: invalid cidr value: "192.168.1.2/30"
38 LINE 1: INSERT INTO INET_TBL (c, i) VALUES (cidr('192.168.1.2/30'), ...
40 DETAIL: Value has bits set to right of mask.
41 INSERT INTO INET_TBL (c, i) VALUES (cidr('ffff:ffff:ffff:ffff::/24'), '::192.168.1.226');
42 ERROR: invalid cidr value: "ffff:ffff:ffff:ffff::/24"
43 LINE 1: INSERT INTO INET_TBL (c, i) VALUES (cidr('ffff:ffff:ffff:fff...
45 DETAIL: Value has bits set to right of mask.
46 SELECT c AS cidr, i AS inet FROM INET_TBL;
48 --------------------+------------------
49 192.168.1.0/24 | 192.168.1.226/24
50 192.168.1.0/26 | 192.168.1.226
51 192.168.1.0/24 | 192.168.1.0/24
52 192.168.1.0/24 | 192.168.1.0/25
53 192.168.1.0/24 | 192.168.1.255/24
54 192.168.1.0/24 | 192.168.1.255/25
55 10.0.0.0/8 | 10.1.2.3/8
56 10.0.0.0/32 | 10.1.2.3/8
57 10.1.2.3/32 | 10.1.2.3
58 10.1.2.0/24 | 10.1.2.3/24
59 10.1.0.0/16 | 10.1.2.3/16
60 10.0.0.0/8 | 10.1.2.3/8
61 10.0.0.0/8 | 11.1.2.3/8
62 10.0.0.0/8 | 9.1.2.3/8
63 10:23::f1/128 | 10:23::f1/64
64 10:23::8000/113 | 10:23::ffff
65 ::ffff:1.2.3.4/128 | ::4.3.2.1/24
68 -- now test some support functions
69 SELECT i AS inet, host(i), text(i), family(i) FROM INET_TBL;
70 inet | host | text | family
71 ------------------+---------------+------------------+--------
72 192.168.1.226/24 | 192.168.1.226 | 192.168.1.226/24 | 4
73 192.168.1.226 | 192.168.1.226 | 192.168.1.226/32 | 4
74 192.168.1.0/24 | 192.168.1.0 | 192.168.1.0/24 | 4
75 192.168.1.0/25 | 192.168.1.0 | 192.168.1.0/25 | 4
76 192.168.1.255/24 | 192.168.1.255 | 192.168.1.255/24 | 4
77 192.168.1.255/25 | 192.168.1.255 | 192.168.1.255/25 | 4
78 10.1.2.3/8 | 10.1.2.3 | 10.1.2.3/8 | 4
79 10.1.2.3/8 | 10.1.2.3 | 10.1.2.3/8 | 4
80 10.1.2.3 | 10.1.2.3 | 10.1.2.3/32 | 4
81 10.1.2.3/24 | 10.1.2.3 | 10.1.2.3/24 | 4
82 10.1.2.3/16 | 10.1.2.3 | 10.1.2.3/16 | 4
83 10.1.2.3/8 | 10.1.2.3 | 10.1.2.3/8 | 4
84 11.1.2.3/8 | 11.1.2.3 | 11.1.2.3/8 | 4
85 9.1.2.3/8 | 9.1.2.3 | 9.1.2.3/8 | 4
86 10:23::f1/64 | 10:23::f1 | 10:23::f1/64 | 6
87 10:23::ffff | 10:23::ffff | 10:23::ffff/128 | 6
88 ::4.3.2.1/24 | ::4.3.2.1 | ::4.3.2.1/24 | 6
91 SELECT c AS cidr, abbrev(c) FROM INET_TBL;
93 --------------------+--------------------
94 192.168.1.0/24 | 192.168.1/24
95 192.168.1.0/26 | 192.168.1.0/26
96 192.168.1.0/24 | 192.168.1/24
97 192.168.1.0/24 | 192.168.1/24
98 192.168.1.0/24 | 192.168.1/24
99 192.168.1.0/24 | 192.168.1/24
101 10.0.0.0/32 | 10.0.0.0/32
102 10.1.2.3/32 | 10.1.2.3/32
103 10.1.2.0/24 | 10.1.2/24
104 10.1.0.0/16 | 10.1/16
108 10:23::f1/128 | 10:23::f1/128
109 10:23::8000/113 | 10:23::8000/113
110 ::ffff:1.2.3.4/128 | ::ffff:1.2.3.4/128
113 SELECT c AS cidr, broadcast(c),
114 i AS inet, broadcast(i) FROM INET_TBL;
115 cidr | broadcast | inet | broadcast
116 --------------------+------------------+------------------+---------------------------------------
117 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.226/24 | 192.168.1.255/24
118 192.168.1.0/26 | 192.168.1.63/26 | 192.168.1.226 | 192.168.1.226
119 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.0/24 | 192.168.1.255/24
120 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.0/25 | 192.168.1.127/25
121 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.255/24 | 192.168.1.255/24
122 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.255/25 | 192.168.1.255/25
123 10.0.0.0/8 | 10.255.255.255/8 | 10.1.2.3/8 | 10.255.255.255/8
124 10.0.0.0/32 | 10.0.0.0 | 10.1.2.3/8 | 10.255.255.255/8
125 10.1.2.3/32 | 10.1.2.3 | 10.1.2.3 | 10.1.2.3
126 10.1.2.0/24 | 10.1.2.255/24 | 10.1.2.3/24 | 10.1.2.255/24
127 10.1.0.0/16 | 10.1.255.255/16 | 10.1.2.3/16 | 10.1.255.255/16
128 10.0.0.0/8 | 10.255.255.255/8 | 10.1.2.3/8 | 10.255.255.255/8
129 10.0.0.0/8 | 10.255.255.255/8 | 11.1.2.3/8 | 11.255.255.255/8
130 10.0.0.0/8 | 10.255.255.255/8 | 9.1.2.3/8 | 9.255.255.255/8
131 10:23::f1/128 | 10:23::f1 | 10:23::f1/64 | 10:23::ffff:ffff:ffff:ffff/64
132 10:23::8000/113 | 10:23::ffff/113 | 10:23::ffff | 10:23::ffff
133 ::ffff:1.2.3.4/128 | ::ffff:1.2.3.4 | ::4.3.2.1/24 | 0:ff:ffff:ffff:ffff:ffff:ffff:ffff/24
136 SELECT c AS cidr, network(c) AS "network(cidr)",
137 i AS inet, network(i) AS "network(inet)" FROM INET_TBL;
138 cidr | network(cidr) | inet | network(inet)
139 --------------------+--------------------+------------------+------------------
140 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.226/24 | 192.168.1.0/24
141 192.168.1.0/26 | 192.168.1.0/26 | 192.168.1.226 | 192.168.1.226/32
142 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.0/24
143 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.0/25 | 192.168.1.0/25
144 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.0/24
145 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.255/25 | 192.168.1.128/25
146 10.0.0.0/8 | 10.0.0.0/8 | 10.1.2.3/8 | 10.0.0.0/8
147 10.0.0.0/32 | 10.0.0.0/32 | 10.1.2.3/8 | 10.0.0.0/8
148 10.1.2.3/32 | 10.1.2.3/32 | 10.1.2.3 | 10.1.2.3/32
149 10.1.2.0/24 | 10.1.2.0/24 | 10.1.2.3/24 | 10.1.2.0/24
150 10.1.0.0/16 | 10.1.0.0/16 | 10.1.2.3/16 | 10.1.0.0/16
151 10.0.0.0/8 | 10.0.0.0/8 | 10.1.2.3/8 | 10.0.0.0/8
152 10.0.0.0/8 | 10.0.0.0/8 | 11.1.2.3/8 | 11.0.0.0/8
153 10.0.0.0/8 | 10.0.0.0/8 | 9.1.2.3/8 | 9.0.0.0/8
154 10:23::f1/128 | 10:23::f1/128 | 10:23::f1/64 | 10:23::/64
155 10:23::8000/113 | 10:23::8000/113 | 10:23::ffff | 10:23::ffff/128
156 ::ffff:1.2.3.4/128 | ::ffff:1.2.3.4/128 | ::4.3.2.1/24 | ::/24
159 SELECT c AS cidr, masklen(c) AS "masklen(cidr)",
160 i AS inet, masklen(i) AS "masklen(inet)" FROM INET_TBL;
161 cidr | masklen(cidr) | inet | masklen(inet)
162 --------------------+---------------+------------------+---------------
163 192.168.1.0/24 | 24 | 192.168.1.226/24 | 24
164 192.168.1.0/26 | 26 | 192.168.1.226 | 32
165 192.168.1.0/24 | 24 | 192.168.1.0/24 | 24
166 192.168.1.0/24 | 24 | 192.168.1.0/25 | 25
167 192.168.1.0/24 | 24 | 192.168.1.255/24 | 24
168 192.168.1.0/24 | 24 | 192.168.1.255/25 | 25
169 10.0.0.0/8 | 8 | 10.1.2.3/8 | 8
170 10.0.0.0/32 | 32 | 10.1.2.3/8 | 8
171 10.1.2.3/32 | 32 | 10.1.2.3 | 32
172 10.1.2.0/24 | 24 | 10.1.2.3/24 | 24
173 10.1.0.0/16 | 16 | 10.1.2.3/16 | 16
174 10.0.0.0/8 | 8 | 10.1.2.3/8 | 8
175 10.0.0.0/8 | 8 | 11.1.2.3/8 | 8
176 10.0.0.0/8 | 8 | 9.1.2.3/8 | 8
177 10:23::f1/128 | 128 | 10:23::f1/64 | 64
178 10:23::8000/113 | 113 | 10:23::ffff | 128
179 ::ffff:1.2.3.4/128 | 128 | ::4.3.2.1/24 | 24
182 SELECT c AS cidr, masklen(c) AS "masklen(cidr)",
183 i AS inet, masklen(i) AS "masklen(inet)" FROM INET_TBL
184 WHERE masklen(c) <= 8;
185 cidr | masklen(cidr) | inet | masklen(inet)
186 ------------+---------------+------------+---------------
187 10.0.0.0/8 | 8 | 10.1.2.3/8 | 8
188 10.0.0.0/8 | 8 | 10.1.2.3/8 | 8
189 10.0.0.0/8 | 8 | 11.1.2.3/8 | 8
190 10.0.0.0/8 | 8 | 9.1.2.3/8 | 8
193 SELECT c AS cidr, i AS inet FROM INET_TBL
196 ----------------+----------------
197 192.168.1.0/24 | 192.168.1.0/24
198 10.1.2.3/32 | 10.1.2.3
202 i < c AS lt, i <= c AS le, i = c AS eq,
203 i >= c AS ge, i > c AS gt, i <> c AS ne,
204 i << c AS sb, i <<= c AS sbe,
205 i >> c AS sup, i >>= c AS spe,
208 i | c | lt | le | eq | ge | gt | ne | sb | sbe | sup | spe | ovr
209 ------------------+--------------------+----+----+----+----+----+----+----+-----+-----+-----+-----
210 192.168.1.226/24 | 192.168.1.0/24 | f | f | f | t | t | t | f | t | f | t | t
211 192.168.1.226 | 192.168.1.0/26 | f | f | f | t | t | t | f | f | f | f | f
212 192.168.1.0/24 | 192.168.1.0/24 | f | t | t | t | f | f | f | t | f | t | t
213 192.168.1.0/25 | 192.168.1.0/24 | f | f | f | t | t | t | t | t | f | f | t
214 192.168.1.255/24 | 192.168.1.0/24 | f | f | f | t | t | t | f | t | f | t | t
215 192.168.1.255/25 | 192.168.1.0/24 | f | f | f | t | t | t | t | t | f | f | t
216 10.1.2.3/8 | 10.0.0.0/8 | f | f | f | t | t | t | f | t | f | t | t
217 10.1.2.3/8 | 10.0.0.0/32 | t | t | f | f | f | t | f | f | t | t | t
218 10.1.2.3 | 10.1.2.3/32 | f | t | t | t | f | f | f | t | f | t | t
219 10.1.2.3/24 | 10.1.2.0/24 | f | f | f | t | t | t | f | t | f | t | t
220 10.1.2.3/16 | 10.1.0.0/16 | f | f | f | t | t | t | f | t | f | t | t
221 10.1.2.3/8 | 10.0.0.0/8 | f | f | f | t | t | t | f | t | f | t | t
222 11.1.2.3/8 | 10.0.0.0/8 | f | f | f | t | t | t | f | f | f | f | f
223 9.1.2.3/8 | 10.0.0.0/8 | t | t | f | f | f | t | f | f | f | f | f
224 10:23::f1/64 | 10:23::f1/128 | t | t | f | f | f | t | f | f | t | t | t
225 10:23::ffff | 10:23::8000/113 | f | f | f | t | t | t | t | t | f | f | t
226 ::4.3.2.1/24 | ::ffff:1.2.3.4/128 | t | t | f | f | f | t | f | f | t | t | t
229 SELECT max(i) AS max, min(i) AS min FROM INET_TBL;
231 -------------+-----------
232 10:23::ffff | 9.1.2.3/8
235 SELECT max(c) AS max, min(c) AS min FROM INET_TBL;
237 -----------------+------------
238 10:23::8000/113 | 10.0.0.0/8
241 -- check the conversion to/from text and set_netmask
242 SELECT set_masklen(inet(text(i)), 24) FROM INET_TBL;
264 -- check that btree index works correctly
265 CREATE INDEX inet_idx1 ON inet_tbl(i);
266 SET enable_seqscan TO off;
268 SELECT * FROM inet_tbl WHERE i<<'192.168.1.0/24'::cidr;
270 -------------------------------------------------------------------------------
271 Index Scan using inet_idx1 on inet_tbl
272 Index Cond: ((i > '192.168.1.0/24'::inet) AND (i <= '192.168.1.255'::inet))
273 Filter: (i << '192.168.1.0/24'::inet)
276 SELECT * FROM inet_tbl WHERE i<<'192.168.1.0/24'::cidr;
278 ----------------+------------------
279 192.168.1.0/24 | 192.168.1.0/25
280 192.168.1.0/24 | 192.168.1.255/25
281 192.168.1.0/26 | 192.168.1.226
285 SELECT * FROM inet_tbl WHERE i<<='192.168.1.0/24'::cidr;
287 --------------------------------------------------------------------------------
288 Index Scan using inet_idx1 on inet_tbl
289 Index Cond: ((i >= '192.168.1.0/24'::inet) AND (i <= '192.168.1.255'::inet))
290 Filter: (i <<= '192.168.1.0/24'::inet)
293 SELECT * FROM inet_tbl WHERE i<<='192.168.1.0/24'::cidr;
295 ----------------+------------------
296 192.168.1.0/24 | 192.168.1.0/24
297 192.168.1.0/24 | 192.168.1.226/24
298 192.168.1.0/24 | 192.168.1.255/24
299 192.168.1.0/24 | 192.168.1.0/25
300 192.168.1.0/24 | 192.168.1.255/25
301 192.168.1.0/26 | 192.168.1.226
305 SELECT * FROM inet_tbl WHERE '192.168.1.0/24'::cidr >>= i;
307 --------------------------------------------------------------------------------
308 Index Scan using inet_idx1 on inet_tbl
309 Index Cond: ((i >= '192.168.1.0/24'::inet) AND (i <= '192.168.1.255'::inet))
310 Filter: ('192.168.1.0/24'::inet >>= i)
313 SELECT * FROM inet_tbl WHERE '192.168.1.0/24'::cidr >>= i;
315 ----------------+------------------
316 192.168.1.0/24 | 192.168.1.0/24
317 192.168.1.0/24 | 192.168.1.226/24
318 192.168.1.0/24 | 192.168.1.255/24
319 192.168.1.0/24 | 192.168.1.0/25
320 192.168.1.0/24 | 192.168.1.255/25
321 192.168.1.0/26 | 192.168.1.226
325 SELECT * FROM inet_tbl WHERE '192.168.1.0/24'::cidr >> i;
327 -------------------------------------------------------------------------------
328 Index Scan using inet_idx1 on inet_tbl
329 Index Cond: ((i > '192.168.1.0/24'::inet) AND (i <= '192.168.1.255'::inet))
330 Filter: ('192.168.1.0/24'::inet >> i)
333 SELECT * FROM inet_tbl WHERE '192.168.1.0/24'::cidr >> i;
335 ----------------+------------------
336 192.168.1.0/24 | 192.168.1.0/25
337 192.168.1.0/24 | 192.168.1.255/25
338 192.168.1.0/26 | 192.168.1.226
341 SET enable_seqscan TO on;
342 DROP INDEX inet_idx1;
343 -- check that gist index works correctly
344 CREATE INDEX inet_idx2 ON inet_tbl using gist (i inet_ops);
345 SET enable_seqscan TO off;
346 SELECT * FROM inet_tbl WHERE i << '192.168.1.0/24'::cidr ORDER BY i;
348 ----------------+------------------
349 192.168.1.0/24 | 192.168.1.0/25
350 192.168.1.0/24 | 192.168.1.255/25
351 192.168.1.0/26 | 192.168.1.226
354 SELECT * FROM inet_tbl WHERE i <<= '192.168.1.0/24'::cidr ORDER BY i;
356 ----------------+------------------
357 192.168.1.0/24 | 192.168.1.0/24
358 192.168.1.0/24 | 192.168.1.226/24
359 192.168.1.0/24 | 192.168.1.255/24
360 192.168.1.0/24 | 192.168.1.0/25
361 192.168.1.0/24 | 192.168.1.255/25
362 192.168.1.0/26 | 192.168.1.226
365 SELECT * FROM inet_tbl WHERE i && '192.168.1.0/24'::cidr ORDER BY i;
367 ----------------+------------------
368 192.168.1.0/24 | 192.168.1.0/24
369 192.168.1.0/24 | 192.168.1.226/24
370 192.168.1.0/24 | 192.168.1.255/24
371 192.168.1.0/24 | 192.168.1.0/25
372 192.168.1.0/24 | 192.168.1.255/25
373 192.168.1.0/26 | 192.168.1.226
376 SELECT * FROM inet_tbl WHERE i >>= '192.168.1.0/24'::cidr ORDER BY i;
378 ----------------+------------------
379 192.168.1.0/24 | 192.168.1.0/24
380 192.168.1.0/24 | 192.168.1.226/24
381 192.168.1.0/24 | 192.168.1.255/24
384 SELECT * FROM inet_tbl WHERE i >> '192.168.1.0/24'::cidr ORDER BY i;
389 SELECT * FROM inet_tbl WHERE i < '192.168.1.0/24'::cidr ORDER BY i;
391 -------------+-------------
392 10.0.0.0/8 | 9.1.2.3/8
393 10.0.0.0/32 | 10.1.2.3/8
394 10.0.0.0/8 | 10.1.2.3/8
395 10.0.0.0/8 | 10.1.2.3/8
396 10.1.0.0/16 | 10.1.2.3/16
397 10.1.2.0/24 | 10.1.2.3/24
398 10.1.2.3/32 | 10.1.2.3
399 10.0.0.0/8 | 11.1.2.3/8
402 SELECT * FROM inet_tbl WHERE i <= '192.168.1.0/24'::cidr ORDER BY i;
404 ----------------+----------------
405 10.0.0.0/8 | 9.1.2.3/8
406 10.0.0.0/8 | 10.1.2.3/8
407 10.0.0.0/32 | 10.1.2.3/8
408 10.0.0.0/8 | 10.1.2.3/8
409 10.1.0.0/16 | 10.1.2.3/16
410 10.1.2.0/24 | 10.1.2.3/24
411 10.1.2.3/32 | 10.1.2.3
412 10.0.0.0/8 | 11.1.2.3/8
413 192.168.1.0/24 | 192.168.1.0/24
416 SELECT * FROM inet_tbl WHERE i = '192.168.1.0/24'::cidr ORDER BY i;
418 ----------------+----------------
419 192.168.1.0/24 | 192.168.1.0/24
422 SELECT * FROM inet_tbl WHERE i >= '192.168.1.0/24'::cidr ORDER BY i;
424 --------------------+------------------
425 192.168.1.0/24 | 192.168.1.0/24
426 192.168.1.0/24 | 192.168.1.226/24
427 192.168.1.0/24 | 192.168.1.255/24
428 192.168.1.0/24 | 192.168.1.0/25
429 192.168.1.0/24 | 192.168.1.255/25
430 192.168.1.0/26 | 192.168.1.226
431 ::ffff:1.2.3.4/128 | ::4.3.2.1/24
432 10:23::f1/128 | 10:23::f1/64
433 10:23::8000/113 | 10:23::ffff
436 SELECT * FROM inet_tbl WHERE i > '192.168.1.0/24'::cidr ORDER BY i;
438 --------------------+------------------
439 192.168.1.0/24 | 192.168.1.226/24
440 192.168.1.0/24 | 192.168.1.255/24
441 192.168.1.0/24 | 192.168.1.0/25
442 192.168.1.0/24 | 192.168.1.255/25
443 192.168.1.0/26 | 192.168.1.226
444 ::ffff:1.2.3.4/128 | ::4.3.2.1/24
445 10:23::f1/128 | 10:23::f1/64
446 10:23::8000/113 | 10:23::ffff
449 SELECT * FROM inet_tbl WHERE i <> '192.168.1.0/24'::cidr ORDER BY i;
451 --------------------+------------------
452 10.0.0.0/8 | 9.1.2.3/8
453 10.0.0.0/8 | 10.1.2.3/8
454 10.0.0.0/32 | 10.1.2.3/8
455 10.0.0.0/8 | 10.1.2.3/8
456 10.1.0.0/16 | 10.1.2.3/16
457 10.1.2.0/24 | 10.1.2.3/24
458 10.1.2.3/32 | 10.1.2.3
459 10.0.0.0/8 | 11.1.2.3/8
460 192.168.1.0/24 | 192.168.1.226/24
461 192.168.1.0/24 | 192.168.1.255/24
462 192.168.1.0/24 | 192.168.1.0/25
463 192.168.1.0/24 | 192.168.1.255/25
464 192.168.1.0/26 | 192.168.1.226
465 ::ffff:1.2.3.4/128 | ::4.3.2.1/24
466 10:23::f1/128 | 10:23::f1/64
467 10:23::8000/113 | 10:23::ffff
470 -- test index-only scans
472 SELECT i FROM inet_tbl WHERE i << '192.168.1.0/24'::cidr ORDER BY i;
474 ---------------------------------------------------
477 -> Index Only Scan using inet_idx2 on inet_tbl
478 Index Cond: (i << '192.168.1.0/24'::inet)
481 SELECT i FROM inet_tbl WHERE i << '192.168.1.0/24'::cidr ORDER BY i;
489 SET enable_seqscan TO on;
490 DROP INDEX inet_idx2;
491 -- check that spgist index works correctly
492 CREATE INDEX inet_idx3 ON inet_tbl using spgist (i);
493 SET enable_seqscan TO off;
494 SELECT * FROM inet_tbl WHERE i << '192.168.1.0/24'::cidr ORDER BY i;
496 ----------------+------------------
497 192.168.1.0/24 | 192.168.1.0/25
498 192.168.1.0/24 | 192.168.1.255/25
499 192.168.1.0/26 | 192.168.1.226
502 SELECT * FROM inet_tbl WHERE i <<= '192.168.1.0/24'::cidr ORDER BY i;
504 ----------------+------------------
505 192.168.1.0/24 | 192.168.1.0/24
506 192.168.1.0/24 | 192.168.1.226/24
507 192.168.1.0/24 | 192.168.1.255/24
508 192.168.1.0/24 | 192.168.1.0/25
509 192.168.1.0/24 | 192.168.1.255/25
510 192.168.1.0/26 | 192.168.1.226
513 SELECT * FROM inet_tbl WHERE i && '192.168.1.0/24'::cidr ORDER BY i;
515 ----------------+------------------
516 192.168.1.0/24 | 192.168.1.0/24
517 192.168.1.0/24 | 192.168.1.226/24
518 192.168.1.0/24 | 192.168.1.255/24
519 192.168.1.0/24 | 192.168.1.0/25
520 192.168.1.0/24 | 192.168.1.255/25
521 192.168.1.0/26 | 192.168.1.226
524 SELECT * FROM inet_tbl WHERE i >>= '192.168.1.0/24'::cidr ORDER BY i;
526 ----------------+------------------
527 192.168.1.0/24 | 192.168.1.0/24
528 192.168.1.0/24 | 192.168.1.226/24
529 192.168.1.0/24 | 192.168.1.255/24
532 SELECT * FROM inet_tbl WHERE i >> '192.168.1.0/24'::cidr ORDER BY i;
537 SELECT * FROM inet_tbl WHERE i < '192.168.1.0/24'::cidr ORDER BY i;
539 -------------+-------------
540 10.0.0.0/8 | 9.1.2.3/8
541 10.0.0.0/32 | 10.1.2.3/8
542 10.0.0.0/8 | 10.1.2.3/8
543 10.0.0.0/8 | 10.1.2.3/8
544 10.1.0.0/16 | 10.1.2.3/16
545 10.1.2.0/24 | 10.1.2.3/24
546 10.1.2.3/32 | 10.1.2.3
547 10.0.0.0/8 | 11.1.2.3/8
550 SELECT * FROM inet_tbl WHERE i <= '192.168.1.0/24'::cidr ORDER BY i;
552 ----------------+----------------
553 10.0.0.0/8 | 9.1.2.3/8
554 10.0.0.0/8 | 10.1.2.3/8
555 10.0.0.0/32 | 10.1.2.3/8
556 10.0.0.0/8 | 10.1.2.3/8
557 10.1.0.0/16 | 10.1.2.3/16
558 10.1.2.0/24 | 10.1.2.3/24
559 10.1.2.3/32 | 10.1.2.3
560 10.0.0.0/8 | 11.1.2.3/8
561 192.168.1.0/24 | 192.168.1.0/24
564 SELECT * FROM inet_tbl WHERE i = '192.168.1.0/24'::cidr ORDER BY i;
566 ----------------+----------------
567 192.168.1.0/24 | 192.168.1.0/24
570 SELECT * FROM inet_tbl WHERE i >= '192.168.1.0/24'::cidr ORDER BY i;
572 --------------------+------------------
573 192.168.1.0/24 | 192.168.1.0/24
574 192.168.1.0/24 | 192.168.1.226/24
575 192.168.1.0/24 | 192.168.1.255/24
576 192.168.1.0/24 | 192.168.1.0/25
577 192.168.1.0/24 | 192.168.1.255/25
578 192.168.1.0/26 | 192.168.1.226
579 ::ffff:1.2.3.4/128 | ::4.3.2.1/24
580 10:23::f1/128 | 10:23::f1/64
581 10:23::8000/113 | 10:23::ffff
584 SELECT * FROM inet_tbl WHERE i > '192.168.1.0/24'::cidr ORDER BY i;
586 --------------------+------------------
587 192.168.1.0/24 | 192.168.1.226/24
588 192.168.1.0/24 | 192.168.1.255/24
589 192.168.1.0/24 | 192.168.1.0/25
590 192.168.1.0/24 | 192.168.1.255/25
591 192.168.1.0/26 | 192.168.1.226
592 ::ffff:1.2.3.4/128 | ::4.3.2.1/24
593 10:23::f1/128 | 10:23::f1/64
594 10:23::8000/113 | 10:23::ffff
597 SELECT * FROM inet_tbl WHERE i <> '192.168.1.0/24'::cidr ORDER BY i;
599 --------------------+------------------
600 10.0.0.0/8 | 9.1.2.3/8
601 10.0.0.0/8 | 10.1.2.3/8
602 10.0.0.0/32 | 10.1.2.3/8
603 10.0.0.0/8 | 10.1.2.3/8
604 10.1.0.0/16 | 10.1.2.3/16
605 10.1.2.0/24 | 10.1.2.3/24
606 10.1.2.3/32 | 10.1.2.3
607 10.0.0.0/8 | 11.1.2.3/8
608 192.168.1.0/24 | 192.168.1.226/24
609 192.168.1.0/24 | 192.168.1.255/24
610 192.168.1.0/24 | 192.168.1.0/25
611 192.168.1.0/24 | 192.168.1.255/25
612 192.168.1.0/26 | 192.168.1.226
613 ::ffff:1.2.3.4/128 | ::4.3.2.1/24
614 10:23::f1/128 | 10:23::f1/64
615 10:23::8000/113 | 10:23::ffff
618 -- test index-only scans
620 SELECT i FROM inet_tbl WHERE i << '192.168.1.0/24'::cidr ORDER BY i;
622 ---------------------------------------------------
625 -> Index Only Scan using inet_idx3 on inet_tbl
626 Index Cond: (i << '192.168.1.0/24'::inet)
629 SELECT i FROM inet_tbl WHERE i << '192.168.1.0/24'::cidr ORDER BY i;
637 SET enable_seqscan TO on;
638 DROP INDEX inet_idx3;
639 -- simple tests of inet boolean and arithmetic operators
640 SELECT i, ~i AS "~i" FROM inet_tbl;
642 ------------------+--------------------------------------------
643 192.168.1.226/24 | 63.87.254.29/24
644 192.168.1.226 | 63.87.254.29
645 192.168.1.0/24 | 63.87.254.255/24
646 192.168.1.0/25 | 63.87.254.255/25
647 192.168.1.255/24 | 63.87.254.0/24
648 192.168.1.255/25 | 63.87.254.0/25
649 10.1.2.3/8 | 245.254.253.252/8
650 10.1.2.3/8 | 245.254.253.252/8
651 10.1.2.3 | 245.254.253.252
652 10.1.2.3/24 | 245.254.253.252/24
653 10.1.2.3/16 | 245.254.253.252/16
654 10.1.2.3/8 | 245.254.253.252/8
655 11.1.2.3/8 | 244.254.253.252/8
656 9.1.2.3/8 | 246.254.253.252/8
657 10:23::f1/64 | ffef:ffdc:ffff:ffff:ffff:ffff:ffff:ff0e/64
658 10:23::ffff | ffef:ffdc:ffff:ffff:ffff:ffff:ffff:0
659 ::4.3.2.1/24 | ffff:ffff:ffff:ffff:ffff:ffff:fbfc:fdfe/24
662 SELECT i, c, i & c AS "and" FROM inet_tbl;
664 ------------------+--------------------+----------------
665 192.168.1.226/24 | 192.168.1.0/24 | 192.168.1.0/24
666 192.168.1.226 | 192.168.1.0/26 | 192.168.1.0
667 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.0/24
668 192.168.1.0/25 | 192.168.1.0/24 | 192.168.1.0/25
669 192.168.1.255/24 | 192.168.1.0/24 | 192.168.1.0/24
670 192.168.1.255/25 | 192.168.1.0/24 | 192.168.1.0/25
671 10.1.2.3/8 | 10.0.0.0/8 | 10.0.0.0/8
672 10.1.2.3/8 | 10.0.0.0/32 | 10.0.0.0
673 10.1.2.3 | 10.1.2.3/32 | 10.1.2.3
674 10.1.2.3/24 | 10.1.2.0/24 | 10.1.2.0/24
675 10.1.2.3/16 | 10.1.0.0/16 | 10.1.0.0/16
676 10.1.2.3/8 | 10.0.0.0/8 | 10.0.0.0/8
677 11.1.2.3/8 | 10.0.0.0/8 | 10.0.0.0/8
678 9.1.2.3/8 | 10.0.0.0/8 | 8.0.0.0/8
679 10:23::f1/64 | 10:23::f1/128 | 10:23::f1
680 10:23::ffff | 10:23::8000/113 | 10:23::8000
681 ::4.3.2.1/24 | ::ffff:1.2.3.4/128 | ::0.2.2.0
684 SELECT i, c, i | c AS "or" FROM inet_tbl;
686 ------------------+--------------------+------------------
687 192.168.1.226/24 | 192.168.1.0/24 | 192.168.1.226/24
688 192.168.1.226 | 192.168.1.0/26 | 192.168.1.226
689 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.0/24
690 192.168.1.0/25 | 192.168.1.0/24 | 192.168.1.0/25
691 192.168.1.255/24 | 192.168.1.0/24 | 192.168.1.255/24
692 192.168.1.255/25 | 192.168.1.0/24 | 192.168.1.255/25
693 10.1.2.3/8 | 10.0.0.0/8 | 10.1.2.3/8
694 10.1.2.3/8 | 10.0.0.0/32 | 10.1.2.3
695 10.1.2.3 | 10.1.2.3/32 | 10.1.2.3
696 10.1.2.3/24 | 10.1.2.0/24 | 10.1.2.3/24
697 10.1.2.3/16 | 10.1.0.0/16 | 10.1.2.3/16
698 10.1.2.3/8 | 10.0.0.0/8 | 10.1.2.3/8
699 11.1.2.3/8 | 10.0.0.0/8 | 11.1.2.3/8
700 9.1.2.3/8 | 10.0.0.0/8 | 11.1.2.3/8
701 10:23::f1/64 | 10:23::f1/128 | 10:23::f1
702 10:23::ffff | 10:23::8000/113 | 10:23::ffff
703 ::4.3.2.1/24 | ::ffff:1.2.3.4/128 | ::ffff:5.3.3.5
706 SELECT i, i + 500 AS "i+500" FROM inet_tbl;
708 ------------------+------------------
709 192.168.1.226/24 | 192.168.3.214/24
710 192.168.1.226 | 192.168.3.214
711 192.168.1.0/24 | 192.168.2.244/24
712 192.168.1.0/25 | 192.168.2.244/25
713 192.168.1.255/24 | 192.168.3.243/24
714 192.168.1.255/25 | 192.168.3.243/25
715 10.1.2.3/8 | 10.1.3.247/8
716 10.1.2.3/8 | 10.1.3.247/8
717 10.1.2.3 | 10.1.3.247
718 10.1.2.3/24 | 10.1.3.247/24
719 10.1.2.3/16 | 10.1.3.247/16
720 10.1.2.3/8 | 10.1.3.247/8
721 11.1.2.3/8 | 11.1.3.247/8
722 9.1.2.3/8 | 9.1.3.247/8
723 10:23::f1/64 | 10:23::2e5/64
724 10:23::ffff | 10:23::1:1f3
725 ::4.3.2.1/24 | ::4.3.3.245/24
728 SELECT i, i - 500 AS "i-500" FROM inet_tbl;
730 ------------------+----------------------------------------
731 192.168.1.226/24 | 192.167.255.238/24
732 192.168.1.226 | 192.167.255.238
733 192.168.1.0/24 | 192.167.255.12/24
734 192.168.1.0/25 | 192.167.255.12/25
735 192.168.1.255/24 | 192.168.0.11/24
736 192.168.1.255/25 | 192.168.0.11/25
737 10.1.2.3/8 | 10.1.0.15/8
738 10.1.2.3/8 | 10.1.0.15/8
740 10.1.2.3/24 | 10.1.0.15/24
741 10.1.2.3/16 | 10.1.0.15/16
742 10.1.2.3/8 | 10.1.0.15/8
743 11.1.2.3/8 | 11.1.0.15/8
744 9.1.2.3/8 | 9.1.0.15/8
745 10:23::f1/64 | 10:22:ffff:ffff:ffff:ffff:ffff:fefd/64
746 10:23::ffff | 10:23::fe0b
747 ::4.3.2.1/24 | ::4.3.0.13/24
750 SELECT i, c, i - c AS "minus" FROM inet_tbl;
752 ------------------+--------------------+------------------
753 192.168.1.226/24 | 192.168.1.0/24 | 226
754 192.168.1.226 | 192.168.1.0/26 | 226
755 192.168.1.0/24 | 192.168.1.0/24 | 0
756 192.168.1.0/25 | 192.168.1.0/24 | 0
757 192.168.1.255/24 | 192.168.1.0/24 | 255
758 192.168.1.255/25 | 192.168.1.0/24 | 255
759 10.1.2.3/8 | 10.0.0.0/8 | 66051
760 10.1.2.3/8 | 10.0.0.0/32 | 66051
761 10.1.2.3 | 10.1.2.3/32 | 0
762 10.1.2.3/24 | 10.1.2.0/24 | 3
763 10.1.2.3/16 | 10.1.0.0/16 | 515
764 10.1.2.3/8 | 10.0.0.0/8 | 66051
765 11.1.2.3/8 | 10.0.0.0/8 | 16843267
766 9.1.2.3/8 | 10.0.0.0/8 | -16711165
767 10:23::f1/64 | 10:23::f1/128 | 0
768 10:23::ffff | 10:23::8000/113 | 32767
769 ::4.3.2.1/24 | ::ffff:1.2.3.4/128 | -281470631346435
772 SELECT '127.0.0.1'::inet + 257;
778 SELECT ('127.0.0.1'::inet + 257) - 257;
784 SELECT '127::1'::inet + 257;
790 SELECT ('127::1'::inet + 257) - 257;
796 SELECT '127.0.0.2'::inet - ('127.0.0.2'::inet + 500);
802 SELECT '127.0.0.2'::inet - ('127.0.0.2'::inet - 500);
808 SELECT '127::2'::inet - ('127::2'::inet + 500);
814 SELECT '127::2'::inet - ('127::2'::inet - 500);
820 -- these should give overflow errors:
821 SELECT '127.0.0.1'::inet + 10000000000;
822 ERROR: result is out of range
823 SELECT '127.0.0.1'::inet - 10000000000;
824 ERROR: result is out of range
825 SELECT '126::1'::inet - '127::2'::inet;
826 ERROR: result is out of range
827 SELECT '127::1'::inet - '126::2'::inet;
828 ERROR: result is out of range
830 SELECT '127::1'::inet + 10000000000;
836 SELECT '127::1'::inet - '127::2'::inet;
842 -- insert one more row with addressed from different families
843 INSERT INTO INET_TBL (c, i) VALUES ('10', '10::/8');
844 -- now, this one should fail
845 SELECT inet_merge(c, i) FROM INET_TBL;
846 ERROR: cannot merge addresses from different families
847 -- fix it by inet_same_family() condition
848 SELECT inet_merge(c, i) FROM INET_TBL WHERE inet_same_family(c, i);
870 -- Test inet sortsupport with a variety of boundary inputs:
871 SELECT a FROM (VALUES
874 ('0.0.0.0/32'::inet),
877 ('127.126.127.127/0'::inet),
878 ('127.127.127.127/0'::inet),
879 ('127.128.127.127/0'::inet),
880 ('192.168.1.0/24'::inet),
881 ('192.168.1.0/25'::inet),
882 ('192.168.1.1/23'::inet),
883 ('192.168.1.1/5'::inet),
884 ('192.168.1.1/6'::inet),
885 ('192.168.1.1/25'::inet),
886 ('192.168.1.2/25'::inet),
887 ('192.168.1.1/26'::inet),
888 ('192.168.1.2/26'::inet),
889 ('192.168.1.2/23'::inet),
890 ('192.168.1.255/5'::inet),
891 ('192.168.1.255/6'::inet),
892 ('192.168.1.3/1'::inet),
893 ('192.168.1.3/23'::inet),
894 ('192.168.1.4/0'::inet),
895 ('192.168.1.5/0'::inet),
896 ('255.0.0.0/0'::inet),
897 ('255.1.0.0/0'::inet),
898 ('255.2.0.0/0'::inet),
899 ('255.255.000.000/0'::inet),
900 ('255.255.000.000/0'::inet),
901 ('255.255.000.000/15'::inet),
902 ('255.255.000.000/16'::inet),
903 ('255.255.255.254/32'::inet),
904 ('255.255.255.000/32'::inet),
905 ('255.255.255.001/31'::inet),
906 ('255.255.255.002/31'::inet),
907 ('255.255.255.003/31'::inet),
908 ('255.255.255.003/32'::inet),
909 ('255.255.255.001/32'::inet),
910 ('255.255.255.255/0'::inet),
911 ('255.255.255.255/0'::inet),
912 ('255.255.255.255/0'::inet),
913 ('255.255.255.255/1'::inet),
914 ('255.255.255.255/16'::inet),
915 ('255.255.255.255/16'::inet),
916 ('255.255.255.255/31'::inet),
917 ('255.255.255.255/32'::inet),
918 ('255.255.255.253/32'::inet),
919 ('255.255.255.252/32'::inet),
920 ('255.3.0.0/0'::inet),
921 ('0000:0000:0000:0000:0000:0000:0000:0000/0'::inet),
922 ('0000:0000:0000:0000:0000:0000:0000:0000/128'::inet),
923 ('0000:0000:0000:0000:0000:0000:0000:0001/128'::inet),
924 ('10:23::f1/64'::inet),
925 ('10:23::f1/65'::inet),
926 ('10:23::ffff'::inet),
929 ('8000:0000:0000:0000:0000:0000:0000:0000/1'::inet),
930 ('::1:ffff:ffff:ffff:ffff/128'::inet),
931 ('::2:ffff:ffff:ffff:ffff/128'::inet),
932 ('::4:3:2:0/24'::inet),
933 ('::4:3:2:1/24'::inet),
934 ('::4:3:2:2/24'::inet),
935 ('ffff:83e7:f118:57dc:6093:6d92:689d:58cf/70'::inet),
936 ('ffff:84b0:4775:536e:c3ed:7116:a6d6:34f0/44'::inet),
937 ('ffff:8566:f84:5867:47f1:7867:d2ba:8a1a/69'::inet),
938 ('ffff:8883:f028:7d2:4d68:d510:7d6b:ac43/73'::inet),
939 ('ffff:8ae8:7c14:65b3:196:8e4a:89ae:fb30/89'::inet),
940 ('ffff:8dd0:646:694c:7c16:7e35:6a26:171/104'::inet),
941 ('ffff:8eef:cbf:700:eda3:ae32:f4b4:318b/121'::inet),
942 ('ffff:90e7:e744:664:a93:8efe:1f25:7663/122'::inet),
943 ('ffff:9597:c69c:8b24:57a:8639:ec78:6026/111'::inet),
944 ('ffff:9e86:79ea:f16e:df31:8e4d:7783:532e/88'::inet),
945 ('ffff:a0c7:82d3:24de:f762:6e1f:316d:3fb2/23'::inet),
946 ('ffff:fffa:ffff:ffff:ffff:ffff:ffff:ffff/0'::inet),
947 ('ffff:fffb:ffff:ffff:ffff:ffff:ffff:ffff/0'::inet),
948 ('ffff:fffc:ffff:ffff:ffff:ffff:ffff:ffff/0'::inet),
949 ('ffff:fffd:ffff:ffff:ffff:ffff:ffff:ffff/0'::inet),
950 ('ffff:fffe:ffff:ffff:ffff:ffff:ffff:ffff/0'::inet),
951 ('ffff:ffff:ffff:fffa:ffff:ffff:ffff:ffff/0'::inet),
952 ('ffff:ffff:ffff:fffb:ffff:ffff:ffff:ffff/0'::inet),
953 ('ffff:ffff:ffff:fffc:ffff:ffff:ffff:ffff/0'::inet),
954 ('ffff:ffff:ffff:fffd::/128'::inet),
955 ('ffff:ffff:ffff:fffd:ffff:ffff:ffff:ffff/0'::inet),
956 ('ffff:ffff:ffff:fffe::/128'::inet),
957 ('ffff:ffff:ffff:fffe:ffff:ffff:ffff:ffff/0'::inet),
958 ('ffff:ffff:ffff:ffff:4:3:2:0/24'::inet),
959 ('ffff:ffff:ffff:ffff:4:3:2:1/24'::inet),
960 ('ffff:ffff:ffff:ffff:4:3:2:2/24'::inet),
961 ('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/0'::inet),
962 ('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128'::inet)
963 ) AS i(a) ORDER BY a;
965 --------------------------------------------
1016 ffff:fffa:ffff:ffff:ffff:ffff:ffff:ffff/0
1017 ffff:fffb:ffff:ffff:ffff:ffff:ffff:ffff/0
1018 ffff:fffc:ffff:ffff:ffff:ffff:ffff:ffff/0
1019 ffff:fffd:ffff:ffff:ffff:ffff:ffff:ffff/0
1020 ffff:fffe:ffff:ffff:ffff:ffff:ffff:ffff/0
1021 ffff:ffff:ffff:fffa:ffff:ffff:ffff:ffff/0
1022 ffff:ffff:ffff:fffb:ffff:ffff:ffff:ffff/0
1023 ffff:ffff:ffff:fffc:ffff:ffff:ffff:ffff/0
1024 ffff:ffff:ffff:fffd:ffff:ffff:ffff:ffff/0
1025 ffff:ffff:ffff:fffe:ffff:ffff:ffff:ffff/0
1026 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/0
1032 ::1:ffff:ffff:ffff:ffff
1033 ::2:ffff:ffff:ffff:ffff
1040 ffff:83e7:f118:57dc:6093:6d92:689d:58cf/70
1041 ffff:84b0:4775:536e:c3ed:7116:a6d6:34f0/44
1042 ffff:8566:f84:5867:47f1:7867:d2ba:8a1a/69
1043 ffff:8883:f028:7d2:4d68:d510:7d6b:ac43/73
1044 ffff:8ae8:7c14:65b3:196:8e4a:89ae:fb30/89
1045 ffff:8dd0:646:694c:7c16:7e35:6a26:171/104
1046 ffff:8eef:cbf:700:eda3:ae32:f4b4:318b/121
1047 ffff:90e7:e744:664:a93:8efe:1f25:7663/122
1048 ffff:9597:c69c:8b24:57a:8639:ec78:6026/111
1049 ffff:9e86:79ea:f16e:df31:8e4d:7783:532e/88
1050 ffff:a0c7:82d3:24de:f762:6e1f:316d:3fb2/23
1051 ffff:ffff:ffff:ffff:4:3:2:0/24
1052 ffff:ffff:ffff:ffff:4:3:2:1/24
1053 ffff:ffff:ffff:ffff:4:3:2:2/24
1054 ffff:ffff:ffff:fffd::
1055 ffff:ffff:ffff:fffe::
1056 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff