Migrated geoip.html

This commit is contained in:
str4d
2013-06-04 13:33:02 +00:00
parent 25a8c353f8
commit 24168fb4e5
3 changed files with 19 additions and 16 deletions

View File

@ -41,6 +41,7 @@ LEGACY_PAGES_MAP={
'donate': 'get-involved/donate', 'donate': 'get-involved/donate',
'faq': 'support/faq', 'faq': 'support/faq',
'getinvolved': 'get-involved', 'getinvolved': 'get-involved',
'geoip': 'docs/spec/geoip',
'glossary': 'support/glossary', 'glossary': 'support/glossary',
'halloffame': 'about/hall-of-fame', 'halloffame': 'about/hall-of-fame',
'how': 'docs', 'how': 'docs',

View File

@ -184,7 +184,7 @@ Traditionally used only by Java applications and higher-level APIs.
</li><li> </li><li>
<a href="{{ site_url('docs/spec/configuration') }}">{{ _('Configuration File Format') }}</a></li> <a href="{{ site_url('docs/spec/configuration') }}">{{ _('Configuration File Format') }}</a></li>
</li><li> </li><li>
<a href="geoip.html">GeoIP File Format</a></li> <a href="{{ site_url('docs/spec/geoip') }}">GeoIP File Format</a></li>
</li></ul> </li></ul>
<h3>{% trans %}Developer's Guides and Resources{% endtrans %}</h3> <h3>{% trans %}Developer's Guides and Resources{% endtrans %}</h3>

View File

@ -1,20 +1,21 @@
{% extends "_layout.html" %} {% extends "global/layout.html" %}
{% block title %}GeoIP File Specification{% endblock %} {% block title %}{% trans %}GeoIP File Specification{% endtrans %}{% endblock %}
{% block lastupdated %}{% trans %}May 2013{% endtrans %}{% endblock %}
{% block accuratefor %}0.9.6{% endblock %}
{% block content %} {% block content %}
Updated May 2013, current as of router version 0.9.6
<h2>{% trans %}Overview{% endtrans %}</h2>
<h2>Overview</h2> <p>{% trans -%}
<p>
This page specifies the format of the various GeoIP files, This page specifies the format of the various GeoIP files,
used by the router to look up a country for an IP. used by the router to look up a country for an IP.
</p> {%- endtrans %}</p>
<h2>Country Name (countries.txt) Format</h2> <h2>{% trans %}Country Name (countries.txt) Format{% endtrans %}</h2>
<p> <p>{% trans -%}
This format is easily generated from data files available from many public sources. This format is easily generated from data files available from many public sources.
For example: For example:
{%- endtrans %}</p>
<pre> <pre>
# wget http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip # wget http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
# unzip GeoIPCountryCSV.zip # unzip GeoIPCountryCSV.zip
@ -29,10 +30,11 @@ For example:
</ul> </ul>
<h2>IPv4 (geoip.txt) Format</h2> <h2>{% trans %}IPv4 (geoip.txt) Format{% endtrans %}</h2>
<p> <p>{% trans -%}
This format is borrowed from Tor and is easily generated from data files available from many public sources. This format is borrowed from Tor and is easily generated from data files available from many public sources.
For example: For example:
{%- endtrans %}</p>
<pre> <pre>
# wget http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip # wget http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
# unzip GeoIPCountryCSV.zip # unzip GeoIPCountryCSV.zip
@ -49,10 +51,11 @@ For example:
</ul> </ul>
<h2>IPv6 (geoipv6.dat.gz) Format</h2> <h2>{% trans %}IPv6 (geoipv6.dat.gz) Format{% endtrans %}</h2>
<p> <p>{% trans -%}
This is a compressed binary format designed for I2P. This is a compressed binary format designed for I2P.
The file is gzipped. Ungzipped format: The file is gzipped. Ungzipped format:
{%- endtrans %}</p>
<pre> <pre>
Bytes 0-9: Magic number "I2PGeoIPv6" Bytes 0-9: Magic number "I2PGeoIPv6"
Bytes 10-11: Version (0x0001) Bytes 10-11: Version (0x0001)
@ -65,8 +68,7 @@ The file is gzipped. Ungzipped format:
8 byte to (/64) 8 byte to (/64)
2 byte ISO country code LOWER case (ASCII) 2 byte ISO country code LOWER case (ASCII)
</pre> </pre>
<p> <p>{% trans %}NOTES:{% endtrans %}</p>
NOTES:
<ul> <ul>
<li>Data must be sorted (SIGNED long twos complement), no overlap. <li>Data must be sorted (SIGNED long twos complement), no overlap.
So the order is 8000:: ... FFFF:: 0000:: ... 7FFF:: So the order is 8000:: ... FFFF:: 0000:: ... 7FFF::