0

I have 3 input fields for the IPv6:

Prefix:

Length (of the prefix):

Suffix:

I am searching some test case that validation the IPv4-Embedded IPv6 Address Prefix.

Landing on on https://www.rfc-editor.org/rfc/rfc6052#section-2.4


    +-----------------------+------------+------------------------------+
    | Network-Specific      |    IPv4    | IPv4-embedded IPv6 address   |
    | Prefix                |   address  |                              |
    +-----------------------+------------+------------------------------+
    | 2001:db8::/32         | 192.0.2.33 | 2001:db8:c000:221::          |
    | 2001:db8:100::/40     | 192.0.2.33 | 2001:db8:1c0:2:21::          |
    | 2001:db8:122::/48     | 192.0.2.33 | 2001:db8:122:c000:2:2100::   |
    | 2001:db8:122:300::/56 | 192.0.2.33 | 2001:db8:122:3c0:0:221::     |
    | 2001:db8:122:344::/64 | 192.0.2.33 | 2001:db8:122:344:c0:2:2100:: |
    | 2001:db8:122:344::/96 | 192.0.2.33 | 2001:db8:122:344::192.0.2.33 |
    +-----------------------+------------+------------------------------+

I found some examples but I am not sure it is enough. Could you show me some other test case please?

Community
  • 1
  • 1
Tuan
  • 2,303
  • 2
  • 25
  • 37
  • What do you mean "test case"? Test case for *what*? – mpontillo Jun 20 '12 at 04:06
  • @Mike I want to validation the IPv6 that user in put. Sorry for my ambiguous question. – Tuan Jun 20 '12 at 16:35
  • What language are you using? It's best to use a standard API for this, like `inet_pton()`. Some people have written regular expressions, but they're insanely complex. – mpontillo Jun 20 '12 at 16:59
  • See http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses – mpontillo Jun 20 '12 at 16:59

0 Answers0