use std::collections::{HashMap, HashSet};
use std::ops::Range;
use std::string::String;
+use std::u32;
- use tor_util::strings::NUL_BYTE;
-
/// The first version of Tor that included "proto" entries in its descriptors.
/// Authorities should use this to decide whether to guess proto lines.
///
/// before concluding that someone is trying to DoS us
///
/// C_RUST_COUPLED: src/or/protover.c `MAX_PROTOCOLS_TO_EXPAND`
-const MAX_PROTOCOLS_TO_EXPAND: u32 = 500;
+const MAX_PROTOCOLS_TO_EXPAND: usize = (1<<16);
- /// Currently supported protocols and their versions, as a byte-slice.
- ///
- /// # Warning
- ///
- /// This byte-slice ends in a NUL byte. This is so that we can directly convert
- /// it to an `&'static CStr` in the FFI code, in order to hand the static string
- /// to C in a way that is compatible with C static strings.
- ///
- /// Rust code which wishes to accesses this string should use
- /// `protover::get_supported_protocols()` instead.
- ///
- /// C_RUST_COUPLED: src/or/protover.c `protover_get_supported_protocols`
- pub(crate) const SUPPORTED_PROTOCOLS: &'static [u8] =
- b"Cons=1-2 \
- Desc=1-2 \
- DirCache=1-2 \
- HSDir=1-2 \
- HSIntro=3-4 \
- HSRend=1-2 \
- Link=1-5 \
- LinkAuth=1,3 \
- Microdesc=1-2 \
- Relay=1-2\0";
-
/// Known subprotocols in Tor. Indicates which subprotocol a relay supports.
///
/// C_RUST_COUPLED: src/or/protover.h `protocol_type_t`