Merge pull request #520 from duckduckgo/mintsoft/private_network

Styling and HTML updates for PrivateNetwork
master
Jag Talon 2014-07-10 16:26:53 -04:00
commit ee621a7985
4 changed files with 65 additions and 41 deletions

View File

@ -19,9 +19,15 @@ attribution twitter => 'crazedpsyc',
my $text = scalar share('private_network.txt')->slurp, my $text = scalar share('private_network.txt')->slurp,
my $html = scalar share('private_network.html')->slurp; my $html = scalar share('private_network.html')->slurp;
my $css = scalar share('style.css')->slurp;
sub append_css {
my $html = shift;
return "<style type='text/css'>$css</style>$html";
}
handle sub { handle sub {
$text, html => $html; $text, html => append_css($html)
}; };
1; 1;

View File

@ -1,17 +1,41 @@
Private network IP addresses: <div class='private_network record'>
<br>IPv4 addresses (<a href="https://www.ietf.org/rfc/rfc1918.txt">rfc1918</a>): <table class='record__body'>
<br>10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 <tr class='record__row record__highlight'>
<br>172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 <td class="record__cell__key">
<br>192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 <p>IPv4 addresses (<a href="https://www.ietf.org/rfc/rfc1918.txt">rfc1918</a>):</p>
<br> </td>
<br>Carrier NAT (<a href="https://www.ietf.org/rfc/rfc6598.txt">rfc6598</a>): <td class="record__cell__value">
<br>100.64.0.0 - 100.127.255.255 | 100.64.0.0/10 <p>10.0.0.0 - 10.255.255.255 | 10.0.0.0/8</p>
<br> <p>172.16.0.0 - 172.31.255.255 | 172.16.0.0/12</p>
<br>Test Networks (<a href="https://www.ietf.org/rfc/rfc5735.txt">rfc5735</a>): <p>192.168.0.0 - 192.168.255.255 | 192.168.0.0/16</p>
<br>TEST-NET-1: 192.0.2.0 - 192.0.2.255 | 192.0.2.0/24 </td>
<br>TEST-NET-2: 198.51.100.0 - 198.51.100.255 | 198.51.100.0/24 </tr>
<br>TEST-NET-3: 203.0.113.0 - 203.0.113.255 | 203.0.113.0/24 <tr class='record__row record__highlight'>
<br>Benchmarks: 198.18.0.1 - 198.19.255.255 | 198.18.0.0/15 <td class="record__cell__key">
<br> <p>Carrier NAT (<a href="https://www.ietf.org/rfc/rfc6598.txt">rfc6598</a>):</p>
<br>Private network IPv6 addresses (<a href="https://www.ietf.org/rfc/rfc4193.txt">rfc4193</a>): </td>
<br>Unique local addresses: fd00::/8 <td class="record__cell__value">
<p>100.64.0.0 - 100.127.255.255 | 100.64.0.0/10</p>
</td>
</tr>
<tr class='record__row record__highlight'>
<td class="record__cell__key">
<p>Test Networks (<a href="https://www.ietf.org/rfc/rfc5735.txt">rfc5735</a>):</p>
</td>
<td class="record__cell__value">
<p>TEST-NET-1: 192.0.2.0 - 192.0.2.255 | 192.0.2.0/24</p>
<p>TEST-NET-2: 198.51.100.0 - 198.51.100.255 | 198.51.100.0/24</p>
<p>TEST-NET-3: 203.0.113.0 - 203.0.113.255 | 203.0.113.0/24</p>
<p>Benchmarks: 198.18.0.1 - 198.19.255.255 | 198.18.0.0/15</p>
</td>
</tr>
<tr class='record__row record__highlight'>
<td class="record__cell__key">
<p>IPv6 addresses (<a href="https://www.ietf.org/rfc/rfc4193.txt">rfc4193</a>):</p>
</td>
<td class="record__cell__value">
<p>Unique local addresses: fd00::/8</p>
</td>
</tr>
</table>
</div>

View File

@ -0,0 +1,11 @@
.zci--answer .private_network .record__cell__key {
padding: 0.4em;
}
.zci--answer .private_network .record__cell__value {
padding: 0.4em;
}
.zci--answer .private_network p {
padding: 0;
}

View File

@ -9,11 +9,11 @@ zci answer_type => 'private_network';
zci is_cached => 1; zci is_cached => 1;
ddg_goodie_test( ddg_goodie_test(
[qw( [qw(
DDG::Goodie::PrivateNetwork DDG::Goodie::PrivateNetwork
)], )],
map { ("$_" => test_zci( map { ("$_" => test_zci(
'Private network IPv4 addresses (rfc1918): 'Private network IPv4 addresses (rfc1918):
10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 10.0.0.0 - 10.255.255.255 | 10.0.0.0/8
172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 172.16.0.0 - 172.31.255.255 | 172.16.0.0/12
192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 192.168.0.0 - 192.168.255.255 | 192.168.0.0/16
@ -30,24 +30,7 @@ Benchmarks: 198.18.0.1 - 198.19.255.255 | 198.18.0.0/15
Private network IPv6 addresses (rfc4193): Private network IPv6 addresses (rfc4193):
Unique local addresses: fd00::/8 Unique local addresses: fd00::/8
', ',
html => 'Private network IP addresses: html => qr#.*#
<br>IPv4 addresses (<a href="https://www.ietf.org/rfc/rfc1918.txt">rfc1918</a>):
<br>10.0.0.0 - 10.255.255.255 | 10.0.0.0/8
<br>172.16.0.0 - 172.31.255.255 | 172.16.0.0/12
<br>192.168.0.0 - 192.168.255.255 | 192.168.0.0/16
<br>
<br>Carrier NAT (<a href="https://www.ietf.org/rfc/rfc6598.txt">rfc6598</a>):
<br>100.64.0.0 - 100.127.255.255 | 100.64.0.0/10
<br>
<br>Test Networks (<a href="https://www.ietf.org/rfc/rfc5735.txt">rfc5735</a>):
<br>TEST-NET-1: 192.0.2.0 - 192.0.2.255 | 192.0.2.0/24
<br>TEST-NET-2: 198.51.100.0 - 198.51.100.255 | 198.51.100.0/24
<br>TEST-NET-3: 203.0.113.0 - 203.0.113.255 | 203.0.113.0/24
<br>Benchmarks: 198.18.0.1 - 198.19.255.255 | 198.18.0.0/15
<br>
<br>Private network IPv6 addresses (<a href="https://www.ietf.org/rfc/rfc4193.txt">rfc4193</a>):
<br>Unique local addresses: fd00::/8
'
)) } ( 'private network', 'private networks', 'private ips' ) )) } ( 'private network', 'private networks', 'private ips' )
); );