tor
master
|
Headers and type declarations for protover.c. More...
#include "container.h"
Go to the source code of this file.
Macros | |
#define | FIRST_TOR_VERSION_TO_ADVERTISE_PROTOCOLS "0.2.9.3-alpha" |
#define | PROTOVER_HSDIR_V3 2 |
#define | PROTOVER_HS_INTRO_V3 4 |
#define | PROTOVER_HS_RENDEZVOUS_POINT_V3 2 |
Typedefs | |
typedef enum protocol_type_t | protocol_type_t |
Enumerations | |
enum | protocol_type_t { PRT_LINK, PRT_LINKAUTH, PRT_RELAY, PRT_DIRCACHE, PRT_HSDIR, PRT_HSINTRO, PRT_HSREND, PRT_DESC, PRT_MICRODESC, PRT_CONS } |
Functions | |
bool | protover_contains_long_protocol_names (const char *s) |
int | protover_all_supported (const char *s, char **missing) |
int | protover_is_supported_here (protocol_type_t pr, uint32_t ver) |
const char * | protover_get_supported_protocols (void) |
C_RUST_COUPLED: src/rust/protover/protover.rs SUPPORTED_PROTOCOLS More... | |
char * | protover_compute_vote (const smartlist_t *list_of_proto_strings, int threshold) |
const char * | protover_compute_for_old_tor (const char *version) |
C_RUST_COUPLED: src/rust/protover/protover.rs compute_for_old_tor More... | |
int | protocol_list_supports_protocol (const char *list, protocol_type_t tp, uint32_t version) |
int | protocol_list_supports_protocol_or_later (const char *list, protocol_type_t tp, uint32_t version) |
void | protover_free_all (void) |
Headers and type declarations for protover.c.
#define FIRST_TOR_VERSION_TO_ADVERTISE_PROTOCOLS "0.2.9.3-alpha" |
The first version of Tor that included "proto" entries in its descriptors. Authorities should use this to decide whether to guess proto lines. C_RUST_COUPLED: src/rust/protover/protover.rs FIRST_TOR_VERSION_TO_ADVERTISE_PROTOCOLS
#define PROTOVER_HS_INTRO_V3 4 |
The protover version number that signifies HSv3 intro point support
#define PROTOVER_HS_RENDEZVOUS_POINT_V3 2 |
The protover version number that signifies HSv3 rendezvous point support
#define PROTOVER_HSDIR_V3 2 |
The protover version number that signifies HSDir support for HSv3
typedef enum protocol_type_t protocol_type_t |
List of recognized subprotocols. C_RUST_COUPLED: src/rust/protover/ffi.rs translate_to_rust
C_RUST_COUPLED: src/rust/protover/protover.rs Proto
enum protocol_type_t |
List of recognized subprotocols. C_RUST_COUPLED: src/rust/protover/ffi.rs translate_to_rust
C_RUST_COUPLED: src/rust/protover/protover.rs Proto
int protocol_list_supports_protocol | ( | const char * | list, |
protocol_type_t | tp, | ||
uint32_t | version | ||
) |
Return true iff "list" encodes a protocol list that includes support for the indicated protocol and version.
int protocol_list_supports_protocol_or_later | ( | const char * | list, |
protocol_type_t | tp, | ||
uint32_t | version | ||
) |
Return true iff "list" encodes a protocol list that includes support for the indicated protocol and version, or some later version.
int protover_all_supported | ( | const char * | s, |
char ** | missing_out | ||
) |
Return true if every protocol version described in the string s is one that we support, and false otherwise. If missing_out is provided, set it to the list of protocols we do not support.
NOTE: This is quadratic, but we don't do it much: only a few times per consensus. Checking signatures should be way more expensive than this ever would be.
const char* protover_compute_for_old_tor | ( | const char * | version | ) |
C_RUST_COUPLED: src/rust/protover/protover.rs compute_for_old_tor
Return a string describing the protocols supported by tor version version, or an empty string if we cannot tell.
Note that this is only used to infer protocols for Tor versions that can't declare their own.
char* protover_compute_vote | ( | const smartlist_t * | list_of_proto_strings, |
int | threshold | ||
) |
Protocol voting implementation.
Given a list of strings describing protocol versions, return a newly allocated string encoding all of the protocols that are listed by at least threshold of the inputs.
The string is minimal and sorted according to the rules of contract_protocol_list above.
bool protover_contains_long_protocol_names | ( | const char * | s | ) |
Return true if the unparsed protover in s would contain a protocol name longer than MAX_PROTOCOL_NAME_LENGTH, and false otherwise.
void protover_free_all | ( | void | ) |
Release all storage held by static fields in protover.c
const char* protover_get_supported_protocols | ( | void | ) |
C_RUST_COUPLED: src/rust/protover/protover.rs SUPPORTED_PROTOCOLS
Return the canonical string containing the list of protocols that we support.
int protover_is_supported_here | ( | protocol_type_t | pr, |
uint32_t | ver | ||
) |
Given a protocol type and version number, return true iff we know how to speak that protocol.