aboutsummaryrefslogtreecommitdiff
path: root/src/or/protover.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-05 16:31:38 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-05 17:15:50 -0400
commit63b4ea22af8e8314dd718f02046de5f4b91edf9d (patch)
treeaf52b6fba37f22c86447fd5267dd5eb557807c8b /src/or/protover.h
parentce84200542f48a92e8b56a8d032401ecd153e90c (diff)
downloadtor-63b4ea22af8e8314dd718f02046de5f4b91edf9d.tar.gz
tor-63b4ea22af8e8314dd718f02046de5f4b91edf9d.zip
Move literally everything out of src/or
This commit won't build yet -- it just puts everything in a slightly more logical place. The reasoning here is that "src/core" will hold the stuff that every (or nearly every) tor instance will need in order to do onion routing. Other features (including some necessary ones) will live in "src/feature". The "src/app" directory will hold the stuff needed to have Tor be an application you can actually run. This commit DOES NOT refactor the former contents of src/or into a logical set of acyclic libraries, or change any code at all. That will have to come in the future. We will continue to move things around and split them in the future, but I hope this lays a reasonable groundwork for doing so.
Diffstat (limited to 'src/or/protover.h')
-rw-r--r--src/or/protover.h97
1 files changed, 0 insertions, 97 deletions
diff --git a/src/or/protover.h b/src/or/protover.h
deleted file mode 100644
index 7319d2f8c4..0000000000
--- a/src/or/protover.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Copyright (c) 2016-2018, The Tor Project, Inc. */
-/* See LICENSE for licensing information */
-
-/**
- * \file protover.h
- * \brief Headers and type declarations for protover.c
- **/
-
-#ifndef TOR_PROTOVER_H
-#define TOR_PROTOVER_H
-
-#include <stdbool.h>
-#include "lib/cc/torint.h"
-#include "lib/testsupport/testsupport.h"
-struct smartlist_t;
-
-/** The first version of Tor that included "proto" entries in its
- * descriptors. Authorities should use this to decide whether to
- * guess proto lines. */
-/* This is a guess. */
-/// C_RUST_COUPLED: src/rust/protover/protover.rs
-/// `FIRST_TOR_VERSION_TO_ADVERTISE_PROTOCOLS`
-#define FIRST_TOR_VERSION_TO_ADVERTISE_PROTOCOLS "0.2.9.3-alpha"
-
-/** The protover version number that signifies HSDir support for HSv3 */
-#define PROTOVER_HSDIR_V3 2
-/** The protover version number that signifies HSv3 intro point support */
-#define PROTOVER_HS_INTRO_V3 4
-/** The protover version number that signifies HSv3 rendezvous point support */
-#define PROTOVER_HS_RENDEZVOUS_POINT_V3 2
-
-/** List of recognized subprotocols. */
-/// C_RUST_COUPLED: src/rust/protover/ffi.rs `translate_to_rust`
-/// C_RUST_COUPLED: src/rust/protover/protover.rs `Proto`
-typedef enum protocol_type_t {
- PRT_LINK,
- PRT_LINKAUTH,
- PRT_RELAY,
- PRT_DIRCACHE,
- PRT_HSDIR,
- PRT_HSINTRO,
- PRT_HSREND,
- PRT_DESC,
- PRT_MICRODESC,
- PRT_CONS,
-} protocol_type_t;
-
-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);
-
-char *protover_compute_vote(const struct smartlist_t *list_of_proto_strings,
- int threshold);
-const char *protover_compute_for_old_tor(const char *version);
-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);
-
-#ifdef PROTOVER_PRIVATE
-/** Represents a range of subprotocols of a given type. All subprotocols
- * between <b>low</b> and <b>high</b> inclusive are included. */
-typedef struct proto_range_t {
- uint32_t low;
- uint32_t high;
-} proto_range_t;
-
-/** Represents a set of ranges of subprotocols of a given type. */
-typedef struct proto_entry_t {
- /** The name of the protocol.
- *
- * (This needs to handle voting on protocols which
- * we don't recognize yet, so it's a char* rather than a protocol_type_t.)
- */
- char *name;
- /** Smartlist of proto_range_t */
- struct smartlist_t *ranges;
-} proto_entry_t;
-
-#if !defined(HAVE_RUST) && defined(TOR_UNIT_TESTS)
-STATIC struct smartlist_t *parse_protocol_list(const char *s);
-STATIC char *encode_protocol_list(const struct smartlist_t *sl);
-STATIC const char *protocol_type_to_str(protocol_type_t pr);
-STATIC int str_to_protocol_type(const char *s, protocol_type_t *pr_out);
-STATIC void proto_entry_free_(proto_entry_t *entry);
-#endif /* !defined(HAVE_RUST) && defined(TOR_UNIT_TESTS) */
-
-#define proto_entry_free(entry) \
- FREE_AND_NULL(proto_entry_t, proto_entry_free_, (entry))
-
-#endif /* defined(PROTOVER_PRIVATE) */
-
-#endif /* !defined(TOR_PROTOVER_H) */