Tor 0.4.9.0-alpha-dev
Macros | Enumerations | Functions
protover.h File Reference

Headers and type declarations for protover.c. More...

#include <stdbool.h>
#include "lib/cc/torint.h"
#include "lib/testsupport/testsupport.h"

Go to the source code of this file.

Macros

#define FIRST_TOR_VERSION_TO_ADVERTISE_PROTOCOLS   "0.2.9.3-alpha"
 
#define PROTOVER_LINKAUTH_ED25519_HANDSHAKE   3
 
#define PROTOVER_RELAY_EXTEND2   2
 
#define PROTOVER_RELAY_ACCEPT_IPV6   2
 
#define PROTOVER_RELAY_EXTEND_IPV6   3
 
#define PROTOVER_RELAY_CANONICAL_IPV6   3
 
#define PROTOVER_RELAY_NTOR_V3   4
 
#define PROTOVER_CONFLUX_V1   1
 
#define PROTOVER_HS_INTRO_V3   4
 
#define PROTOVER_HS_INTRO_DOS   5
 
#define PROTOVER_HS_RENDEZVOUS_POINT_V3   2
 
#define PROTOVER_HSDIR_V3   2
 
#define PROTOVER_HS_SETUP_PADDING   2
 
#define PROTOVER_FLOWCTRL_CC   2
 

Enumerations

enum  protocol_type_t {
  PRT_LINK = 0 , PRT_LINKAUTH = 1 , PRT_RELAY = 2 , PRT_DIRCACHE = 3 ,
  PRT_HSDIR = 4 , PRT_HSINTRO = 5 , PRT_HSREND = 6 , PRT_DESC = 7 ,
  PRT_MICRODESC = 8 , PRT_CONS = 9 , PRT_PADDING = 10 , PRT_FLOWCTRL = 11 ,
  PRT_CONFLUX = 12
}
 

Functions

bool protover_list_is_invalid (const char *s)
 
const char * protover_get_supported (const protocol_type_t type)
 
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...
 
const char * protover_get_recommended_client_protocols (void)
 
const char * protover_get_recommended_relay_protocols (void)
 
const char * protover_get_required_client_protocols (void)
 
const char * protover_get_required_relay_protocols (void)
 
char * protover_compute_vote (const struct 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)
 

Detailed Description

Headers and type declarations for protover.c.

Definition in file protover.h.

Macro Definition Documentation

◆ FIRST_TOR_VERSION_TO_ADVERTISE_PROTOCOLS

#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

Definition at line 23 of file protover.h.

◆ PROTOVER_CONFLUX_V1

#define PROTOVER_CONFLUX_V1   1

The protover that signals conflux support.

Definition at line 41 of file protover.h.

◆ PROTOVER_FLOWCTRL_CC

#define PROTOVER_FLOWCTRL_CC   2

The protover that signals support for congestion control

Definition at line 59 of file protover.h.

◆ PROTOVER_HS_INTRO_DOS

#define PROTOVER_HS_INTRO_DOS   5

The protover version number where intro points support denial of service resistance

Definition at line 47 of file protover.h.

◆ PROTOVER_HS_INTRO_V3

#define PROTOVER_HS_INTRO_V3   4

The protover version number that signifies HSv3 intro point support

Definition at line 44 of file protover.h.

◆ PROTOVER_HS_RENDEZVOUS_POINT_V3

#define PROTOVER_HS_RENDEZVOUS_POINT_V3   2

The protover version number that signifies HSv3 rendezvous point support

Definition at line 50 of file protover.h.

◆ PROTOVER_HS_SETUP_PADDING

#define PROTOVER_HS_SETUP_PADDING   2

The protover that signals support for HS circuit setup padding machines

Definition at line 56 of file protover.h.

◆ PROTOVER_HSDIR_V3

#define PROTOVER_HSDIR_V3   2

The protover version number that signifies HSDir support for HSv3

Definition at line 53 of file protover.h.

◆ PROTOVER_LINKAUTH_ED25519_HANDSHAKE

#define PROTOVER_LINKAUTH_ED25519_HANDSHAKE   3

The protover version number that signifies ed25519 link handshake support

Definition at line 27 of file protover.h.

◆ PROTOVER_RELAY_ACCEPT_IPV6

#define PROTOVER_RELAY_ACCEPT_IPV6   2

The protover version number where relays can accept IPv6 connections

Definition at line 32 of file protover.h.

◆ PROTOVER_RELAY_CANONICAL_IPV6

#define PROTOVER_RELAY_CANONICAL_IPV6   3

The protover version number where relays can consider IPv6 connections canonical

Definition at line 37 of file protover.h.

◆ PROTOVER_RELAY_EXTEND2

#define PROTOVER_RELAY_EXTEND2   2

The protover version number that signifies extend2 cell support

Definition at line 30 of file protover.h.

◆ PROTOVER_RELAY_EXTEND_IPV6

#define PROTOVER_RELAY_EXTEND_IPV6   3

The protover version number where relays can initiate IPv6 extends

Definition at line 34 of file protover.h.

◆ PROTOVER_RELAY_NTOR_V3

#define PROTOVER_RELAY_NTOR_V3   4

The protover version number where relays can accept ntorv3

Definition at line 39 of file protover.h.

Enumeration Type Documentation

◆ 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

Definition at line 64 of file protover.h.

Function Documentation

◆ protocol_list_supports_protocol()

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.

If the protocol list is unparseable, treat it as if it defines no protocols, and return 0.

Definition at line 330 of file protover.c.

Referenced by hs_desc_supports_congestion_control(), and memoize_protover_summary().

◆ protocol_list_supports_protocol_or_later()

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.

If the protocol list is unparseable, treat it as if it defines no protocols, and return 0.

Definition at line 355 of file protover.c.

◆ protover_all_supported()

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.

If the protocol version string is unparseable, treat it as if it defines no protocols, and return 1.

Definition at line 750 of file protover.c.

Referenced by networkstatus_check_required_protocols().

◆ protover_compute_for_old_tor()

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.

Definition at line 849 of file protover.c.

◆ protover_free_all()

void protover_free_all ( void  )

Release all storage held by static fields in protover.c

Definition at line 887 of file protover.c.

◆ protover_get_recommended_client_protocols()

const char * protover_get_recommended_client_protocols ( void  )

Return the recommended client protocols list that directory authorities put in the consensus.

Definition at line 522 of file protover.c.

◆ protover_get_recommended_relay_protocols()

const char * protover_get_recommended_relay_protocols ( void  )

Return the recommended relay protocols list that directory authorities put in the consensus.

Definition at line 531 of file protover.c.

◆ protover_get_required_client_protocols()

const char * protover_get_required_client_protocols ( void  )

Return the required client protocols list that directory authorities put in the consensus.

Definition at line 540 of file protover.c.

◆ protover_get_required_relay_protocols()

const char * protover_get_required_relay_protocols ( void  )

Return the required relay protocols list that directory authorities put in the consensus.

Definition at line 548 of file protover.c.

◆ protover_get_supported()

const char * protover_get_supported ( const protocol_type_t  type)

Return the string containing the supported version for the given protocol type.

Definition at line 411 of file protover.c.

◆ protover_get_supported_protocols()

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.

Definition at line 437 of file protover.c.

◆ protover_is_supported_here()

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.

Definition at line 316 of file protover.c.

◆ protover_list_is_invalid()

bool protover_list_is_invalid ( const char *  s)

Return true if the unparsed protover list in s contains a parsing error, such as extra commas, a bad number, or an over-long name.

Definition at line 301 of file protover.c.