Safe Haskell | None |
---|---|
Language | Haskell2010 |
Routines for parsing a consensus document.
- data Consensus = Consensus {
- conMethods :: Maybe [Int]
- conMethod :: Int
- conValidAfter :: DateTime
- conFreshUntil :: DateTime
- conValidUntil :: DateTime
- conVotingDelay :: (Integer, Integer)
- conSuggestedClientVers :: Maybe [Version]
- conSuggestedServerVers :: Maybe [Version]
- conKnownFlags :: [String]
- conParameters :: [(String, Int32)]
- conAuthorities :: [Authority]
- conRouters :: [Router]
- conBandwidthWeights :: Map String Int32
- conSignatures :: [(Bool, ByteString, ByteString, ByteString)]
- data Authority = Authority {}
- data Router = Router {
- rtrNickName :: String
- rtrIdentity :: ByteString
- rtrDigest :: ByteString
- rtrPubTime :: DateTime
- rtrIP :: String
- rtrOnionPort :: Word16
- rtrDirPort :: Maybe Word16
- rtrIP6Addrs :: [(String, Word16)]
- rtrStatus :: [String]
- rtrVersion :: Maybe Version
- rtrBandwidth :: Maybe (Integer, [(String, String)])
- rtrPortList :: Maybe (Bool, [PortSpec])
- parseConsensusDocument :: ByteString -> Either String (Consensus, ByteString, ByteString)
Documentation
A current consensus from a directory server.
Consensus | |
|
An authority that might sign a consensus document.
Authority | |
|
A router within the consensus document.
Router | |
|
parseConsensusDocument :: ByteString -> Either String (Consensus, ByteString, ByteString) Source
Parse a consensus document, returning either an error or the parsed consensus and the SHA1 and SHA256 hashes of that consensus, for later validation.