mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 13:43:47 +01:00
ff9bdbd56f
This is ticket 7706, reported by "bugcatcher." The rationale here is that if somebody says 'ExcludeNodes {tv}', then they probably don't just want to block definitely Tuvaluan nodes: they also want to block nodes that have unknown country, since for all they know such nodes are also in Tuvalu. This behavior is controlled by a new GeoIPExcludeUnknown autobool option. With the default (auto) setting, we exclude ?? and A1 if any country is excluded. If the option is 1, we add ?? and A1 unconditionally; if the option is 0, we never add them. (Right now our geoip file doesn't actually seem to include A1: I'm including it here in case it comes back.) This feature only takes effect if you have a GeoIP file. Otherwise you'd be excluding every node.
50 lines
2.0 KiB
C
50 lines
2.0 KiB
C
/* Copyright (c) 2001-2004, Roger Dingledine.
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
|
* Copyright (c) 2007-2013, The Tor Project, Inc. */
|
|
/* See LICENSE for licensing information */
|
|
|
|
/**
|
|
* \file routerlist.h
|
|
* \brief Header file for routerset.c
|
|
**/
|
|
|
|
#ifndef TOR_ROUTERSET_H
|
|
#define TOR_ROUTERSET_H
|
|
|
|
routerset_t *routerset_new(void);
|
|
void routerset_refresh_countries(routerset_t *rs);
|
|
int routerset_parse(routerset_t *target, const char *s,
|
|
const char *description);
|
|
void routerset_union(routerset_t *target, const routerset_t *source);
|
|
int routerset_is_list(const routerset_t *set);
|
|
int routerset_needs_geoip(const routerset_t *set);
|
|
int routerset_is_empty(const routerset_t *set);
|
|
int routerset_contains_router(const routerset_t *set, const routerinfo_t *ri,
|
|
country_t country);
|
|
int routerset_contains_routerstatus(const routerset_t *set,
|
|
const routerstatus_t *rs,
|
|
country_t country);
|
|
int routerset_contains_extendinfo(const routerset_t *set,
|
|
const extend_info_t *ei);
|
|
|
|
int routerset_contains_node(const routerset_t *set, const node_t *node);
|
|
void routerset_get_all_nodes(smartlist_t *out, const routerset_t *routerset,
|
|
const routerset_t *excludeset,
|
|
int running_only);
|
|
int routerset_add_unknown_ccs(routerset_t **setp, int only_if_some_cc_set);
|
|
#if 0
|
|
void routersets_get_node_disjunction(smartlist_t *target,
|
|
const smartlist_t *source,
|
|
const routerset_t *include,
|
|
const routerset_t *exclude, int running_only);
|
|
#endif
|
|
void routerset_subtract_nodes(smartlist_t *out,
|
|
const routerset_t *routerset);
|
|
|
|
char *routerset_to_string(const routerset_t *routerset);
|
|
int routerset_equal(const routerset_t *old, const routerset_t *new);
|
|
void routerset_free(routerset_t *routerset);
|
|
|
|
#endif
|
|
|