Subject: List of test IPv6 addresses?

From: Karl Auer <[email-masked]>
Date: Sat, 02 Jun 2012 16:13:59 +1000

I seem to remember seeing, some time ago, a list of lots and lots of
test IPv6 addresses. That is, IPv6 addresses that could be fed into
programs to check whether they were properly interpreted.

For a project I am currently working on it would be great not to have to
generate all those fiddly test cases myself, apart from the fact that I
would certainly miss some quirky ones.

So does anyone know where I might have seen this list? It may have been
in the source code to something, or perhaps even someone else's unit
tests.

Yours hopefully, K.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer ([email-masked])
http://www.biplane.com.au/kauer

GPG fingerprint: AE1D 4868 6420 AD9A A698 5251 1699 7B78 4EEE 6017
Old fingerprint: DA41 51B1 1481 16E1 F7E2 B2E9 3007 14ED 5736 F687

---

From: Jeroen Massar <[email-masked]>
Date: Sat, 2 Jun 2012 07:26:55 -0700

> programs to check whether they were properly interpreted.

Just use getaddrinfo() and all should be fine as then the OS handles it which hopefully follows the rules.

Greets,
 Jeroen

---

From: John Mann <[email-masked]>
Date: Mon, 4 Jun 2012 16:54:54 +1000

Hi,

> in the source code to something, or perhaps even someone else's unit

How about Net-IPv6Addr from CPAN?
Download from
http://search.cpan.org/CPAN/authors/id/T/TM/TMONROE/Net-IPv6Addr-0.2.tar.gz
or browse test cases at
http://cpansearch.perl.org/src/TMONROE/Net-IPv6Addr-0.2/t/

    John

---

From: Simon Perreault <[email-masked]>
Date: Mon, 04 Jun 2012 11:36:34 -0400

> in the source code to something, or perhaps even someone else's unit

Don't know what list you're talking about, but here are a few ones 
extracted from Asterisk:
http://svn.digium.com/svn/asterisk/trunk/tests/test_netsock2.c

> 	struct parse_test test_vals[] = {
> 		{ "192.168.1.0", 1 },
> 		{ "10.255.255.254", 1 },
> 		{ "172.18.5.4", 1 },
> 		{ "8.8.4.4", 1 },
> 		{ "0.0.0.0", 1 },
> 		{ "127.0.0.1", 1 },
> 		{ "1.256.3.4", 0 },
> 		{ "256.0.0.1", 0 },
> 		{ "1.2.3.4:5060", 1 },
> 		{ "::ffff:5.6.7.8", 1 },
> 		{ "fdf8:f53b:82e4::53", 1 },
> 		{ "fe80::200:5aee:feaa:20a2", 1 },
> 		{ "2001::1", 1 },
> 		{ "2001:0000:4136:e378:8000:63bf:3fff:fdd2", 1 },
> 		{ "2001:0002:6c::430", 1 },
> 		{ "2001:10:240:ab::a", 1 },
> 		{ "2002:cb0a:3cdd:1::1", 1 },
> 		{ "2001:db8:8:4::2", 1 }, /* Documentation only, should never be used */
> 		{ "ff01:0:0:0:0:0:0:2", 1 }, /* Multicast */
> 		{ "[fdf8:f53b:82e4::53]", 1 },
> 		{ "[fe80::200:5aee:feaa:20a2]", 1 },
> 		{ "[2001::1]", 1 },
> 		{ "[2001:0000:4136:e378:8000:63bf:3fff:fdd2]:5060", 1 },
> 		{ "2001:0000:4136:e378:8000:63bf:3fff:fdd2:5060", 0 }, /* port, but no brackets */
> 		{ "fe80::200::abcd", 0 }, /* multiple zero expansions */
> 	};

> 	/* Test various situations with flags = 0 */
> 	TEST_SPLIT_HOSTPORT("192.168.1.1", 0, "192.168.1.1", "", 1);
> 	TEST_SPLIT_HOSTPORT("192.168.1.1:5060", 0, "192.168.1.1", "5060", 1);
> 	TEST_SPLIT_HOSTPORT("::ffff:5.6.7.8", 0, "::ffff:5.6.7.8", "", 1);
> 	TEST_SPLIT_HOSTPORT("[::ffff:5.6.7.8]:5060", 0, "::ffff:5.6.7.8", "5060", 1);
> 	TEST_SPLIT_HOSTPORT("fdf8:f53b:82e4::53", 0, "fdf8:f53b:82e4::53", "", 1);
> 	TEST_SPLIT_HOSTPORT("fe80::200:5aee:feaa:20a2", 0, "fe80::200:5aee:feaa:20a2", "", 1);
> 	TEST_SPLIT_HOSTPORT("[fdf8:f53b:82e4::53]", 0, "fdf8:f53b:82e4::53", "", 1);
> 	TEST_SPLIT_HOSTPORT("[fe80::200:5aee:feaa:20a2]:5060", 0, "fe80::200:5aee:feaa:20a2", "5060", 1);
> 	TEST_SPLIT_HOSTPORT("host:port", 0, "host", "port", 1);
> 	TEST_SPLIT_HOSTPORT("host", 0, "host", "", 1);
>
> 	/* Make sure that flag conditions work when they should */
> 	TEST_SPLIT_HOSTPORT("192.168.1.1:5060", PARSE_PORT_IGNORE, "192.168.1.1", "", 1);
> 	TEST_SPLIT_HOSTPORT("192.168.1.1:5060", PARSE_PORT_REQUIRE, "192.168.1.1", "5060", 1);
> 	TEST_SPLIT_HOSTPORT("192.168.1.1", PARSE_PORT_FORBID, "192.168.1.1", "", 1);
> 	TEST_SPLIT_HOSTPORT("[::ffff:5.6.7.8]:5060", PARSE_PORT_IGNORE, "::ffff:5.6.7.8", "", 1);
> 	TEST_SPLIT_HOSTPORT("[::ffff:5.6.7.8]:5060", PARSE_PORT_REQUIRE, "::ffff:5.6.7.8", "5060", 1);
> 	TEST_SPLIT_HOSTPORT("::ffff:5.6.7.8", PARSE_PORT_FORBID, "::ffff:5.6.7.8", "", 1);
>
> 	/* Make sure it fails when flag requirements are not met */
> 	TEST_SPLIT_HOSTPORT("192.168.1.1", PARSE_PORT_REQUIRE, "<undefined>", "<undefined>", 0);
> 	TEST_SPLIT_HOSTPORT("192.168.1.1:5060", PARSE_PORT_FORBID, "<undefined>", "<undefined>", 0);
> 	TEST_SPLIT_HOSTPORT("::ffff:5.6.7.8", PARSE_PORT_REQUIRE, "<undefined>", "<undefined>", 0);
> 	TEST_SPLIT_HOSTPORT("[::ffff:5.6.7.8]:5060", PARSE_PORT_FORBID, "<undefined>", "<undefined>", 0);

Simon
-- 
DTN made easy, lean, and smart --> http://postellation.viagenie.ca
NAT64/DNS64 open-source        --> http://ecdysis.viagenie.ca
STUN/TURN server               --> http://numb.viagenie.ca