summaryrefslogtreecommitdiff
path: root/src/rust
diff options
context:
space:
mode:
Diffstat (limited to 'src/rust')
-rw-r--r--src/rust/protover/ffi.rs1
-rw-r--r--src/rust/protover/protover.rs8
-rw-r--r--src/rust/tor_log/tor_log.rs8
3 files changed, 11 insertions, 6 deletions
diff --git a/src/rust/protover/ffi.rs b/src/rust/protover/ffi.rs
index 066b08eddb..14170d0353 100644
--- a/src/rust/protover/ffi.rs
+++ b/src/rust/protover/ffi.rs
@@ -31,6 +31,7 @@ fn translate_to_rust(c_proto: uint32_t) -> Result<Protocol, ProtoverError> {
8 => Ok(Protocol::Microdesc),
9 => Ok(Protocol::Cons),
10 => Ok(Protocol::Padding),
+ 11 => Ok(Protocol::FlowCtrl),
_ => Err(ProtoverError::UnknownProtocol),
}
}
diff --git a/src/rust/protover/protover.rs b/src/rust/protover/protover.rs
index a08e835393..0ca960bd69 100644
--- a/src/rust/protover/protover.rs
+++ b/src/rust/protover/protover.rs
@@ -47,6 +47,7 @@ pub enum Protocol {
Microdesc,
Relay,
Padding,
+ FlowCtrl,
}
impl fmt::Display for Protocol {
@@ -75,6 +76,7 @@ impl FromStr for Protocol {
"Microdesc" => Ok(Protocol::Microdesc),
"Relay" => Ok(Protocol::Relay),
"Padding" => Ok(Protocol::Padding),
+ "FlowCtrl" => Ok(Protocol::FlowCtrl),
_ => Err(ProtoverError::UnknownProtocol),
}
}
@@ -166,7 +168,8 @@ pub(crate) fn get_supported_protocols_cstr() -> &'static CStr {
LinkAuth=3 \
Microdesc=1-2 \
Relay=1-2 \
- Padding=1"
+ Padding=2 \
+ FlowCtrl=1"
)
} else {
cstr!(
@@ -180,7 +183,8 @@ pub(crate) fn get_supported_protocols_cstr() -> &'static CStr {
LinkAuth=1,3 \
Microdesc=1-2 \
Relay=1-2 \
- Padding=1"
+ Padding=2 \
+ FlowCtrl=1"
)
}
}
diff --git a/src/rust/tor_log/tor_log.rs b/src/rust/tor_log/tor_log.rs
index 98fccba5a9..bbaf97129c 100644
--- a/src/rust/tor_log/tor_log.rs
+++ b/src/rust/tor_log/tor_log.rs
@@ -99,14 +99,14 @@ pub mod log {
/// Domain log types. These mirror definitions in src/lib/log/log.h
/// C_RUST_COUPLED: src/lib/log/log.c, log severity types
extern "C" {
- static LD_NET_: u32;
- static LD_GENERAL_: u32;
+ static LD_NET_: u64;
+ static LD_GENERAL_: u64;
}
/// Translate Rust defintions of log domain levels to C. This exposes a 1:1
/// mapping between types.
#[inline]
- pub unsafe fn translate_domain(domain: LogDomain) -> u32 {
+ pub unsafe fn translate_domain(domain: LogDomain) -> u64 {
match domain {
LogDomain::Net => LD_NET_,
LogDomain::General => LD_GENERAL_,
@@ -128,7 +128,7 @@ pub mod log {
extern "C" {
pub fn tor_log_string(
severity: c_int,
- domain: u32,
+ domain: u64,
function: *const c_char,
string: *const c_char,
);