Expand description
Encoding and decoding for relay messages
Relay messages are sent along circuits, inside RELAY or RELAY_EARLY cells.
Re-exportsΒ§
use super::flow_ctrl::Xoff;πuse super::flow_ctrl::Xon;πuse super::RelayCellFormat;πuse super::RelayCmd;πuse crate::chancell::CELL_DATA_LEN;πuse crate::chancell::msg::DestroyReason;πuse crate::chancell::msg::HandshakeType;πuse crate::chancell::msg::TAP_C_HANDSHAKE_LEN;πuse crate::chancell::msg::TAP_S_HANDSHAKE_LEN;πuse caret::caret_int;πuse derive_deftly::Deftly;πuse std::fmt::Write;πuse std::net::IpAddr;πuse std::net::Ipv4Addr;πuse std::num::NonZeroU8;πuse tor_bytes::EncodeError;πuse tor_bytes::EncodeResult;πuse tor_bytes::Error;πuse tor_bytes::Result;πuse tor_bytes::Readable;πuse tor_bytes::Reader;πuse tor_bytes::Writeable;πuse tor_bytes::Writer;πuse tor_linkspec::EncodedLinkSpec;πuse tor_llcrypto::pk::rsa::RsaIdentity;πuse tor_llcrypto::util::ct::CtByteArray;πuse tor_memquota::derive_deftly_template_HasMemoryCost;πuse tor_memquota::memory_cost_structural_copy;πuse bitflags::bitflags;πpub use super::conflux::ConfluxLink;pub use super::conflux::ConfluxLinked;pub use super::conflux::ConfluxLinkedAck;pub use super::conflux::ConfluxSwitch;pub use super::hs::EstablishRendezvous;pub use super::hs::IntroEstablished;pub use super::hs::Introduce1;pub use super::hs::Introduce2;pub use super::hs::IntroduceAck;pub use super::hs::Rendezvous1;pub use super::hs::Rendezvous2;pub use super::hs::RendezvousEstablished;pub use super::hs::est_intro::EstablishIntro;pub use super::udp::ConnectUdp;pub use super::udp::ConnectedUdp;pub use super::udp::Datagram;pub(crate) use empty_body;π
MacrosΒ§
- empty_
body π - Declare a message type for a message with an empty body.
- msg_
impl_ πrelaymsg - Helper: declare a RelayMsg implementation for a message type that has a fixed command.
StructsΒ§
- Begin
- A Begin message creates a new data stream.
- Begin
Dir - Opens a new stream on a directory cache.
- Begin
Flags - A set of recognized flags that can be attached to a begin cell.
- Connected
- A Connected message is a successful response to a Begin message
- Data
- A Data message represents data sent along a stream.
- Drop
- A padding message, which is always ignored.
- End
- An End message tells the other end of the circuit to close a stream.
- EndReason
- A declared reason for closing a stream
- Extend
- Extend was an obsolete circuit extension message format.
- Extend2
- An Extend2 message tells the last relay in a circuit to extend to a new hop.
- Extended
- Extended was an obsolete circuit extension message, sent in reply to an Extend message.
- Extended2
- Extended2 is a successful reply to an Extend2 message.
- Invalid
Sendme Tag - An error from attempting to decode a SENDME tag.
- Resolve
- A Resolve message launches a DNS lookup stream.
- Resolved
- A Resolved message is a successful reply to a Resolve message.
- Sendme
- A Sendme message is used to increase flow-control windows.
- Sendme
Tag - An authentication tag to use for circuit-level SENDME messages.
- Truncate
- Tells a circuit to close all downstream hops on the circuit.
- Truncated
- A Truncated message is sent to the client when the remaining hops of a circuit have gone away.
- Unrecognized
- A relay message that we didnβt recognize
EnumsΒ§
- AnyRelay
Msg - A single parsed relay message, sent or received along a circuit
- IpVersion
Preference - A preference for IPv4 vs IPv6 addresses; usable as a nicer frontend for BeginFlags.
- Resolved
Val - Possible response to a DNS lookup
ConstantsΒ§
- RES_
ERR_ πNONTRANSIENT - Non-transient error (donβt try again)
- RES_
ERR_ πTRANSIENT - Transient error (okay to try again)
- RES_
HOSTNAME π - Indicates a hostname response
- RES_
IPV4 π - Indicates an IPv4 response
- RES_
IPV6 π - Indicates an IPv6 response
TraitsΒ§
- Body
- Internal: traits in common different cell bodies.