diff options
author | David Goulet <dgoulet@torproject.org> | 2019-05-03 13:24:06 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-05-03 13:56:36 -0400 |
commit | 07e4b09b5f27326a1aa58b5b2ed3c25ceb5a6db6 (patch) | |
tree | 8d1e878bc1f60e87a039e90cf7415c87f87070cd /src/rust | |
parent | 2aa441b88e089c9aa650f25dd1b109bf14bc451d (diff) | |
download | tor-07e4b09b5f27326a1aa58b5b2ed3c25ceb5a6db6.tar.gz tor-07e4b09b5f27326a1aa58b5b2ed3c25ceb5a6db6.zip |
sendme: Add FlowCtrl protover value
See proposal 289 section 4.3 for more details.
It describes the flow control protocol at the circuit and stream level. If
there is no FlowCtrl protocol version, tor supports the unauthenticated flow
control features from its supported Relay protocols.
At this commit, relay will start advertising FlowCtrl=1 meaning they support
authenticated SENDMEs v1.
Closes #30363
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/rust')
-rw-r--r-- | src/rust/protover/ffi.rs | 1 | ||||
-rw-r--r-- | src/rust/protover/protover.rs | 8 |
2 files changed, 7 insertions, 2 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 74158d9f6d..f7d9d6d15f 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=1 \ + 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=1 \ + FlowCtrl=1" ) } } |