diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-01-09 11:36:47 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-10 15:09:07 -0500 |
commit | c83d83814660b643b705ed7de4aa1fc35e2d20ad (patch) | |
tree | a40e8125e82391e69a16cac1ee73061243d00017 /src/or/routerparse.c | |
parent | 33df3e37ffecfed309a1a0f210a96620c0ebb837 (diff) | |
download | tor-c83d83814660b643b705ed7de4aa1fc35e2d20ad.tar.gz tor-c83d83814660b643b705ed7de4aa1fc35e2d20ad.zip |
Implement proposal 227-vote-on-package-fingerprints.txt
This implementation includes tests and a little documentation.
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r-- | src/or/routerparse.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index a2bc8fbb93..6f3acd0987 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -131,6 +131,7 @@ typedef enum { K_CONSENSUS_METHOD, K_LEGACY_DIR_KEY, K_DIRECTORY_FOOTER, + K_PACKAGE, A_PURPOSE, A_LAST_LISTED, @@ -420,6 +421,7 @@ static token_rule_t networkstatus_token_table[] = { T1("known-flags", K_KNOWN_FLAGS, ARGS, NO_OBJ ), T01("params", K_PARAMS, ARGS, NO_OBJ ), T( "fingerprint", K_FINGERPRINT, CONCAT_ARGS, NO_OBJ ), + T0N("package", K_PACKAGE, CONCAT_ARGS, NO_OBJ ), CERTIFICATE_MEMBERS @@ -2626,6 +2628,16 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out, ns->server_versions = tor_strdup(tok->args[0]); } + { + smartlist_t *package_lst = find_all_by_keyword(tokens, K_PACKAGE); + if (package_lst) { + ns->package_lines = smartlist_new(); + SMARTLIST_FOREACH(package_lst, directory_token_t *, t, + smartlist_add(ns->package_lines, tor_strdup(t->args[0]))); + } + smartlist_free(package_lst); + } + tok = find_by_keyword(tokens, K_KNOWN_FLAGS); ns->known_flags = smartlist_new(); inorder = 1; |