From f4ce7f9c9b43aacf307b83e086dfe6605b320bb2 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 3 Jun 2007 03:05:10 +0000 Subject: r13166@catbus: nickm | 2007-06-02 23:02:40 -0400 First cut at code to parse and validate v3 networkstatus votes. svn:r10461 --- src/or/dirvote.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/or/dirvote.c (limited to 'src/or/dirvote.c') diff --git a/src/or/dirvote.c b/src/or/dirvote.c new file mode 100644 index 000000000..413cc9364 --- /dev/null +++ b/src/or/dirvote.c @@ -0,0 +1,48 @@ +/* Copyright 2001-2004 Roger Dingledine. + * Copyright 2004-2007 Roger Dingledine, Nick Mathewson. */ +/* See LICENSE for licensing information */ +/* $Id$ */ +const char dirvote_c_id[] = + "$Id$"; + +#include "or.h" + +/** + * \file dirvote.c + **/ + +/** DOCDOC */ +void +networkstatus_vote_free(networkstatus_vote_t *ns) +{ + int i; + if (!ns) + return; + + tor_free(ns->client_versions); + tor_free(ns->server_versions); + if (ns->known_flags) { + for (i=0; ns->known_flags[i]; ++i) + tor_free(ns->known_flags[i]); + tor_free(ns->known_flags); + } + tor_free(ns->nickname); + tor_free(ns->address); + tor_free(ns->contact); + if (ns->cert) + authority_cert_free(ns->cert); + + if (ns->routerstatus_list) { + SMARTLIST_FOREACH(ns->routerstatus_list, vote_routerstatus_t *, rs, + { + tor_free(rs->version); + tor_free(rs); + }); + + smartlist_free(ns->routerstatus_list); + } + + memset(ns, 11, sizeof(*ns)); + tor_free(ns); +} + -- cgit v1.2.3