tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 4d642100907cb2125c23f3404d2ab907543433b6
parent 103bc205034628b38ff31705989f42e929033927
Author: Nick Mathewson <nickm@torproject.org>
Date:   Mon, 10 Feb 2025 16:38:45 -0500

Add "family_ids" fields to routerinfo and microdescs.

Diffstat:
Msrc/feature/nodelist/microdesc.c | 4++++
Msrc/feature/nodelist/microdesc_st.h | 6++++++
Msrc/feature/nodelist/routerinfo_st.h | 5+++++
Msrc/feature/nodelist/routerlist.c | 4++++
4 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/feature/nodelist/microdesc.c b/src/feature/nodelist/microdesc.c @@ -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); diff --git a/src/feature/nodelist/microdesc_st.h b/src/feature/nodelist/microdesc_st.h @@ -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 */ diff --git a/src/feature/nodelist/routerinfo_st.h b/src/feature/nodelist/routerinfo_st.h @@ -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 */ diff --git a/src/feature/nodelist/routerlist.c b/src/feature/nodelist/routerlist.c @@ -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);