Skip to content
Snippets Groups Projects
Commit 4d642100 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Add "family_ids" fields to routerinfo and microdescs.

parent 103bc205
No related branches found
No related tags found
1 merge request!857Implement proposal 321 (happy families)
......@@ -915,6 +915,10 @@ microdesc_free_(microdesc_t *md, const char *fname, int lineno)
tor_free(md->body);
nodefamily_free(md->family);
if (md->family_ids) {
SMARTLIST_FOREACH(md->family_ids, char *, cp, tor_free(cp));
smartlist_free(md->family_ids);
}
short_policy_free(md->exit_policy);
short_policy_free(md->ipv6_exit_policy);
......
......@@ -16,6 +16,7 @@ struct curve25519_public_key_t;
struct ed25519_public_key_t;
struct nodefamily_t;
struct short_policy_t;
struct smartlist_t;
#include "ext/ht.h"
......@@ -73,6 +74,11 @@ struct microdesc_t {
uint16_t ipv6_orport;
/** As routerinfo_t.family, with readable members parsed. */
struct nodefamily_t *family;
/** A list of strings representing router family IDs.
* May be null; Copied from family-ids.
* (Happy families only.) */
struct smartlist_t *family_ids;
/** IPv4 exit policy summary */
struct short_policy_t *exit_policy;
/** IPv6 exit policy summary */
......
......@@ -15,6 +15,7 @@
#include "feature/nodelist/signed_descriptor_st.h"
struct curve25519_public_key_t;
struct smartlist_t;
/** Information about another onion router in the network. */
struct routerinfo_t {
......@@ -67,6 +68,10 @@ struct routerinfo_t {
long uptime; /**< How many seconds the router claims to have been up */
smartlist_t *declared_family; /**< Nicknames of router which this router
* claims are its family. */
/** A list of strings representing router family IDs.
* May be null. Extracted from family-certs.
* (Happy families only.) */
struct smartlist_t *family_ids;
char *contact_info; /**< Declared contact info for this router. */
unsigned int is_hibernating:1; /**< Whether the router claims to be
* hibernating */
......
......@@ -940,6 +940,10 @@ routerinfo_free_(routerinfo_t *router)
SMARTLIST_FOREACH(router->declared_family, char *, s, tor_free(s));
smartlist_free(router->declared_family);
}
if (router->family_ids) {
SMARTLIST_FOREACH(router->family_ids, char *, cp, tor_free(cp));
smartlist_free(router->family_ids);
}
addr_policy_list_free(router->exit_policy);
short_policy_free(router->ipv6_exit_policy);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment