summaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-09-23 15:23:04 -0400
committerNick Mathewson <nickm@torproject.org>2009-10-15 15:17:13 -0400
commita19981725d167927d32ef2a31c7a7968be3d95b6 (patch)
tree9033267c02ab111346921025b04af53939f00e13 /src/or/networkstatus.c
parent0bce0161dded650ac6fa665a7b861d6faac9e91c (diff)
downloadtor-a19981725d167927d32ef2a31c7a7968be3d95b6.tar.gz
tor-a19981725d167927d32ef2a31c7a7968be3d95b6.zip
Parse detached signatures and microdesc networkstatuses correctly.
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 616726525b..93a21ebb74 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -1983,6 +1983,18 @@ networkstatus_get_flavor_name(consensus_flavor_t flav)
}
}
+/** DOCDOC return -1 on unknown */
+int
+networkstatus_parse_flavor_name(const char *flavname)
+{
+ if (!strcmp(flavname, "ns"))
+ return FLAV_NS;
+ else if (!strcmp(flavname, "microdesc"))
+ return FLAV_MICRODESC;
+ else
+ return -1;
+}
+
/** If <b>question</b> is a string beginning with "ns/" in a format the
* control interface expects for a GETINFO question, set *<b>answer</b> to a
* newly-allocated string containing networkstatus lines for the appropriate