diff options
-rw-r--r-- | spec/dir-list-spec.md | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/spec/dir-list-spec.md b/spec/dir-list-spec.md index 48bd81a..6bf9466 100644 --- a/spec/dir-list-spec.md +++ b/spec/dir-list-spec.md @@ -23,11 +23,11 @@ list was shipped in 0.2.8.1-alpha. The hard-coded fallback directory list is located in the tor source repository at: -src/app/config/fallback_dirs.inc +`src/app/config/fallback_dirs.inc` In Tor 0.3.4 and earlier, the list is located at: -src/or/fallback_dirs.inc +`src/or/fallback_dirs.inc` This document describes version 2.0.0 and later of the directory list format. @@ -70,12 +70,9 @@ except where noted below. The original fallback directory script and format was created by weasel. The current script uses code written by gsathya & karsten. -This specification was revised after feedback from: +This specification was revised after feedback from Damian Johnson ("atagar") +and Iain R. Learmonth ("irl"). -```text - Damian Johnson ("atagar") - Iain R. Learmonth ("irl") -``` <a id="dir-list-spec.txt-1.3"></a> @@ -123,13 +120,11 @@ fallback update script. See #24839 for details. Directory lists contain the following sections: -```text - - List Header (exactly once) - - List Generation (exactly once, may be empty) - - Directory Entry (zero or more times) + - List Header (exactly once) + - List Generation (exactly once, may be empty) + - Directory Entry (zero or more times) - Each section (or entry) ends with a separator. -``` +Each section (or entry) ends with a separator. <a id="dir-list-spec.txt-2.1"></a> @@ -138,13 +133,11 @@ Directory lists contain the following sections: The following nonterminals are defined in the Onionoo details document specification: -```text - dir_address - fingerprint - nickname + * dir_address + * fingerprint + * nickname - See https://metrics.torproject.org/onionoo.html#details -``` +See <https://metrics.torproject.org/onionoo.html#details> The following nonterminals are defined in the "Tor directory protocol" specification in dir-spec.txt: @@ -155,9 +148,11 @@ specification in dir-spec.txt: NL (newline) SP (space) bool (must not be confused with Onionoo's JSON "boolean") +``` - We derive the following nonterminals from Onionoo and dir-spec.txt: +We derive the following nonterminals from Onionoo and dir-spec.txt: +``` ipv4_or_port ::= port from an IPv4 or_addresses item The ipv4_or_port is the port part of an IPv4 address from the @@ -201,11 +196,12 @@ C-style comments. #### List Header Format -"/*" SP+ "type=" Keyword SP+ "*/" SP\* NL +```text -\[At start, exactly once.\] + "/*" SP+ "type=" Keyword SP+ "*/" SP\* NL + + [At start, exactly once.] -```text The type of directory entries in the list. Parsers SHOULD exit with an error if this is not the first line of the list, or if the value is anything other than "fallback". @@ -524,14 +520,17 @@ A sample transitional version 2.0.0 fallback list is available here: #### Sample Fallback List Header +```c /*type=fallback */ /* version=2.0.0 */ /* =====*/ +``` <a id="dir-list-spec.txt-A.1.2"></a> #### Sample Fallback List Generation +```c /*Whitelist & blacklist excluded 1326 of 1513 candidates. */ /* Checked IPv4 DirPorts served a consensus within 15.0s. */ /* @@ -548,11 +547,13 @@ Onionoo Source: uptime Date: 2017-05-16 07:00:00 Version: 4.0 URL: https:onionoo.torproject.orguptime?first_seen_days=30-&flag=V2Dir&type=relay&last_seen_days=-0 */ /* ===== \*/ +``` <a id="dir-list-spec.txt-A.1.3"></a> #### Sample Fallback Entries +```c "176.10.104.240:80 orport=443 id=0111BA9B604669E636FFD5B503F382A4B7AD6E80" /*nickname=foo */ /* extrainfo=1 */ @@ -564,3 +565,4 @@ URL: https:onionoo.torproject.orguptime?first_seen_days=30-&flag=V2Dir&type=rela /* extrainfo=0 */ /* =====*/ , +```
\ No newline at end of file |