mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
15860c8846
This changes a LOT of code but in the end, behavior is the same. Unfortunately, many functions had to be changed to accomodate but in majority of cases, to become simpler. Functions are also removed specifically those that were there to convert an IPv4 as a host format to a tor_addr_t. Those are not needed anymore. The IPv4 address field has been standardized to "ipv4_addr", the ORPort to "ipv4_orport" (currently IPv6 uses ipv6_orport) and DirPort to "ipv4_dirport". This is related to Sponsor 55 work that adds IPv6 support for relays and this work is needed in order to have a common interface between IPv4 and IPv6. Closes #40043. Signed-off-by: David Goulet <dgoulet@torproject.org>
60 lines
2.3 KiB
C
60 lines
2.3 KiB
C
/* Copyright (c) 2001 Matej Pfajfar.
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
|
* Copyright (c) 2007-2020, The Tor Project, Inc. */
|
|
/* See LICENSE for licensing information */
|
|
|
|
/**
|
|
* @file dir_server_st.h
|
|
* @brief Trusted/fallback directory server structure.
|
|
**/
|
|
|
|
#ifndef DIR_SERVER_ST_H
|
|
#define DIR_SERVER_ST_H
|
|
|
|
#include "lib/cc/torint.h"
|
|
#include "core/or/or.h"
|
|
#include "feature/nodelist/routerstatus_st.h"
|
|
|
|
/** Represents information about a single trusted or fallback directory
|
|
* server. */
|
|
struct dir_server_t {
|
|
char *description;
|
|
char *nickname;
|
|
char *address; /**< Hostname. */
|
|
/* XX/teor - why do we duplicate the address and port fields here and in
|
|
* fake_status? Surely we could just use fake_status (#17867). */
|
|
tor_addr_t ipv4_addr;
|
|
uint16_t ipv4_dirport; /**< Directory port. */
|
|
uint16_t ipv4_orport; /**< OR port: Used for tunneling connections. */
|
|
tor_addr_t ipv6_addr; /**< IPv6 address if present; AF_UNSPEC if not */
|
|
uint16_t ipv6_orport; /**< OR port corresponding to ipv6_addr. */
|
|
double weight; /** Weight used when selecting this node at random */
|
|
char digest[DIGEST_LEN]; /**< Digest of identity key. */
|
|
char v3_identity_digest[DIGEST_LEN]; /**< Digest of v3 (authority only,
|
|
* high-security) identity key. */
|
|
|
|
unsigned int is_running:1; /**< True iff we think this server is running. */
|
|
unsigned int is_authority:1; /**< True iff this is a directory authority
|
|
* of some kind. */
|
|
|
|
/** True iff this server has accepted the most recent server descriptor
|
|
* we tried to upload to it. */
|
|
unsigned int has_accepted_serverdesc:1;
|
|
|
|
/** What kind of authority is this? (Bitfield.) */
|
|
dirinfo_type_t type;
|
|
|
|
time_t addr_current_at; /**< When was the document that we derived the
|
|
* address information from published? */
|
|
|
|
routerstatus_t fake_status; /**< Used when we need to pass this trusted
|
|
* dir_server_t to
|
|
* directory_request_set_routerstatus.
|
|
* as a routerstatus_t. Not updated by the
|
|
* router-status management code!
|
|
**/
|
|
};
|
|
|
|
#endif /* !defined(DIR_SERVER_ST_H) */
|