Safe Haskell | None |
---|---|
Language | Haskell2010 |
Tor.DataFormat.RelayCell
Description
Parsing and rendering routines for relay cells.
- data RelayCell
- = RelayBegin { }
- | RelayData { }
- | RelayEnd { }
- | RelayConnected { }
- | RelaySendMe { }
- | RelayExtend { }
- | RelayExtended { }
- | RelayTruncate { }
- | RelayTruncated { }
- | RelayDrop { }
- | RelayResolve { }
- | RelayResolved {
- relayStreamId :: Word16
- relayResolvedAddrs :: [(TorAddress, Word32)]
- | RelayBeginDir { }
- | RelayExtend2 { }
- | RelayExtended2 { }
- | RelayEstablishIntro { }
- | RelayEstablishRendezvous { }
- | RelayIntroduce1 { }
- | RelayIntroduce2 { }
- | RelayRendezvous1 { }
- | RelayRendezvous2 { }
- | RelayIntroEstablished { }
- | RelayRendezvousEstablished { }
- | RelayIntroduceAck { }
- putRelayCell :: ByteString -> RelayCell -> Put
- getRelayCell :: Get (ByteString, RelayCell)
- parseRelayCell :: Context SHA1 -> Get (RelayCell, Context SHA1)
- renderRelayCell :: Context SHA1 -> RelayCell -> (ByteString, Context SHA1)
- data ExtendSpec
- putExtendSpec :: ExtendSpec -> Put
- getExtendSpec :: Get ExtendSpec
- data RelayEndReason
- putRelayEndReason :: RelayEndReason -> Put
- getRelayEndReason :: Word16 -> Get RelayEndReason
- putRelayCellGuts :: RelayCell -> PutM Word8
- data RelayIntro1Data
- = RelayIntro1v0 { }
- | RelayIntro1v1 { }
- | RelayIntro1v2 { }
- | RelayIntro1v3 { }
Documentation
The format of a Relay cell in a Tor stream.
Constructors
RelayBegin | |
Fields | |
RelayData | |
Fields | |
RelayEnd | |
Fields | |
RelayConnected | |
Fields | |
RelaySendMe | |
Fields | |
RelayExtend | |
Fields | |
RelayExtended | |
Fields | |
RelayTruncate | |
Fields | |
RelayTruncated | |
Fields | |
RelayDrop | |
Fields | |
RelayResolve | |
Fields | |
RelayResolved | |
Fields
| |
RelayBeginDir | |
Fields | |
RelayExtend2 | |
Fields | |
RelayExtended2 | |
Fields | |
RelayEstablishIntro | |
Fields | |
RelayEstablishRendezvous | |
Fields | |
RelayIntroduce1 | |
Fields | |
RelayIntroduce2 | |
Fields | |
RelayRendezvous1 | |
Fields | |
RelayRendezvous2 | |
Fields | |
RelayIntroEstablished | |
Fields | |
RelayRendezvousEstablished | |
Fields | |
RelayIntroduceAck | |
Fields |
putRelayCell :: ByteString -> RelayCell -> Put Source
Perform a raw relay cell render, with 0 for the hash mark.
getRelayCell :: Get (ByteString, RelayCell) Source
Parse a relay cell off the wire, returning the shortened digest and the parsed relay cell.
parseRelayCell :: Context SHA1 -> Get (RelayCell, Context SHA1) Source
Parse a relay cell, verifying that the digest matches appropriately, returning the parsed cell and new hash context.
renderRelayCell :: Context SHA1 -> RelayCell -> (ByteString, Context SHA1) Source
Render a relay cell using the given hash context, returning the rendered cell and the new hash context.
data ExtendSpec Source
The format for extension request.
Constructors
ExtendIP4 String Word16 | |
ExtendIP6 String Word16 | |
ExtendDigest ByteString |
Instances
putExtendSpec :: ExtendSpec -> Put Source
Render an ExtendSpec.
getExtendSpec :: Get ExtendSpec Source
Parse an ExtendSpec
data RelayEndReason Source
A reason that someone might want to end a relay.
putRelayEndReason :: RelayEndReason -> Put Source
Render a RelayEndReason.
getRelayEndReason :: Word16 -> Get RelayEndReason Source
Parse a RelayEndReason.
putRelayCellGuts :: RelayCell -> PutM Word8 Source
Render the internals of a relay cell (basically everything but the header).
data RelayIntro1Data Source
Various bits of information for dealing with hidden services. Currently not implemented.
Constructors
RelayIntro1v0 | |
Fields | |
RelayIntro1v1 | |
Fields | |
RelayIntro1v2 | |
Fields | |
RelayIntro1v3 | |
Fields |