summaryrefslogtreecommitdiff
path: root/src/rust/protover/protover.rs
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-01-14 14:48:00 -0500
committerNick Mathewson <nickm@torproject.org>2019-01-14 14:48:00 -0500
commitb169c8c14f23394b40305f38ee4ce08add278e27 (patch)
tree0649da16a97792103773f9d5cedbfd75deac49bd /src/rust/protover/protover.rs
parent691dec5d4615dec9a845d0f7dea7ef55cc66fe62 (diff)
parentb269ab5aaeee65a3a0b1e5e0923d9dc7898c232e (diff)
downloadtor-b169c8c14f23394b40305f38ee4ce08add278e27.tar.gz
tor-b169c8c14f23394b40305f38ee4ce08add278e27.zip
Merge remote-tracking branch 'asn-github/adaptive_padding-final'
Diffstat (limited to 'src/rust/protover/protover.rs')
-rw-r--r--src/rust/protover/protover.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rust/protover/protover.rs b/src/rust/protover/protover.rs
index 8624afeafa..0b2a78c210 100644
--- a/src/rust/protover/protover.rs
+++ b/src/rust/protover/protover.rs
@@ -46,6 +46,7 @@ pub enum Protocol {
LinkAuth,
Microdesc,
Relay,
+ Padding,
}
impl fmt::Display for Protocol {
@@ -73,6 +74,7 @@ impl FromStr for Protocol {
"LinkAuth" => Ok(Protocol::LinkAuth),
"Microdesc" => Ok(Protocol::Microdesc),
"Relay" => Ok(Protocol::Relay),
+ "Padding" => Ok(Protocol::Padding),
_ => Err(ProtoverError::UnknownProtocol),
}
}
@@ -163,7 +165,8 @@ pub(crate) fn get_supported_protocols_cstr() -> &'static CStr {
Link=1-5 \
LinkAuth=3 \
Microdesc=1-2 \
- Relay=1-2"
+ Relay=1-2 \
+ Padding=1"
)
} else {
cstr!(
@@ -176,7 +179,8 @@ pub(crate) fn get_supported_protocols_cstr() -> &'static CStr {
Link=1-5 \
LinkAuth=1,3 \
Microdesc=1-2 \
- Relay=1-2"
+ Relay=1-2 \
+ Padding=1"
)
}
}