module Network.Anonymous.Tor.Protocol.Types where
data AuthMethod =
Cookie | SafeCookie | HashedPassword
deriving (Eq)
instance Read AuthMethod where
readsPrec _ "COOKIE" = [(Cookie, "")]
readsPrec _ "SAFECOOKIE" = [(SafeCookie, "")]
readsPrec _ "HASHEDPASSWORD" = [(HashedPassword, "")]
readsPrec _ s = error ("Not a valid AuthMethod: " ++ s)
instance Show AuthMethod where
show Cookie = "COOKIE"
show SafeCookie = "SAFECOOKIE"
show HashedPassword = "HASHEDPASSWORD"
data ProtocolInfo = ProtocolInfo {
protocolVersion :: Integer,
torVersion :: [Integer],
authMethods :: [AuthMethod],
cookieFile :: Maybe FilePath
} deriving (Show, Eq)