summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-08-19 14:10:20 -0400
committerNick Mathewson <nickm@torproject.org>2016-09-26 10:56:49 -0700
commit4df12239f60a79c9543c21e665d2569f064b98ea (patch)
tree3b584c1ad220d62f288b2a9072d372bd07e1b270 /src/or/routerparse.c
parentb2b2e1c7f24d9b65059e3d089768d6c49ba4f58f (diff)
downloadtor-4df12239f60a79c9543c21e665d2569f064b98ea.tar.gz
tor-4df12239f60a79c9543c21e665d2569f064b98ea.zip
Emit and parse protocol lists in router descriptors
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 03f8f4eded..abad6a8231 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -58,6 +58,7 @@ typedef enum {
K_RUNNING_ROUTERS,
K_ROUTER_STATUS,
K_PLATFORM,
+ K_PROTO,
K_OPT,
K_BANDWIDTH,
K_CONTACT,
@@ -306,6 +307,7 @@ static token_rule_t routerdesc_token_table[] = {
T01("fingerprint", K_FINGERPRINT, CONCAT_ARGS, NO_OBJ ),
T01("hibernating", K_HIBERNATING, GE(1), NO_OBJ ),
T01("platform", K_PLATFORM, CONCAT_ARGS, NO_OBJ ),
+ T01("proto", K_PROTO, CONCAT_ARGS, NO_OBJ ),
T01("contact", K_CONTACT, CONCAT_ARGS, NO_OBJ ),
T01("read-history", K_READ_HISTORY, ARGS, NO_OBJ ),
T01("write-history", K_WRITE_HISTORY, ARGS, NO_OBJ ),
@@ -2092,6 +2094,10 @@ router_parse_entry_from_string(const char *s, const char *end,
router->platform = tor_strdup(tok->args[0]);
}
+ if ((tok = find_opt_by_keyword(tokens, K_PROTO))) {
+ router->protocol_list = tor_strdup(tok->args[0]);
+ }
+
if ((tok = find_opt_by_keyword(tokens, K_CONTACT))) {
router->contact_info = tor_strdup(tok->args[0]);
}