Safe Haskell | None |
---|---|
Language | Haskell2010 |
- readKnownHosts :: IO [SSHRemote]
- readKnownHostsFile :: String -> IO [SSHRemote]
- parseRemotes :: Text -> [SSHRemote]
- data SSHRemoteAddr
- data SSHRemoteAddrs
- type KeyAlgorithm = String
- type SSHKey = String
- type DNSName = [Text]
- data SSHRemote = SSHRemote SSHRemoteAddrs KeyAlgorithm SSHKey
- data IPv4 :: *
- data IPv6 :: *
- onAddrPart :: (SSHRemoteAddr -> t) -> SSHRemote -> [t]
- isIPv4Remote :: SSHRemote -> Bool
- isIPv6Remote :: SSHRemote -> Bool
- isDNSRemote :: SSHRemote -> Bool
- isIPv4Addr :: SSHRemoteAddr -> Bool
- isIPv6Addr :: SSHRemoteAddr -> Bool
- isDNSAddr :: SSHRemoteAddr -> Bool
- targetAddr :: SSHRemote -> (Text, Int)
Documentation
readKnownHosts :: IO [SSHRemote] Source #
Reads the current user's known_hosts file and returns the
SSHRemote structures representing the contents of that file (by
calling parseRemotes
).
readKnownHostsFile :: String -> IO [SSHRemote] Source #
Reads the specified file and returns the SSHRemote structures
representing the contents of that file (by calling parseRemotes
).
parseRemotes :: Text -> [SSHRemote] Source #
Passed the specification of remote ssh known hosts and returns
the parsed SSHRemote structures representing those hosts. The
input text block is expected to be the raw contents of a
known_hosts file (e.g. comparable to a Data.Text.IO.readFile
"$HOME.sshknown_hosts
) and the output is the parsed data
structures.
data SSHRemoteAddr Source #
data SSHRemoteAddrs Source #
type KeyAlgorithm = String Source #
The abstract data type to express an IPv6 address.
To create this, use toIPv6
. Or use read
"2001:DB8::1"
:: IPv6
, for example. Also, "2001:DB8::1"
can be used as literal with OverloadedStrings.
>>>
read "2001:db8:00:00:00:00:00:01" :: IPv6
2001:db8::1>>>
read "2001:db8:11e:c00::101" :: IPv6
2001:db8:11e:c00::101>>>
read "2001:db8:11e:c00:aa:bb:192.0.2.1" :: IPv6
2001:db8:11e:c00:aa:bb:c000:201>>>
read "2001:db8::192.0.2.1" :: IPv6
2001:db8::c000:201>>>
read "0::ffff:192.0.2.1" :: IPv6
::ffff:192.0.2.1>>>
read "0::0:c000:201" :: IPv6
::192.0.2.1>>>
read "::0.0.0.1" :: IPv6
::1
onAddrPart :: (SSHRemoteAddr -> t) -> SSHRemote -> [t] Source #
The onAddrPart can be used to apply the specified function to the SSHRemoteAddr portion of an SSHRemote specification.
isIPv4Remote :: SSHRemote -> Bool Source #
The isIPv4Remote, isIPv6Remote, and isDNSRemote predicate tests indicate if the specified SSHRemote is of the indicated type.
isIPv6Remote :: SSHRemote -> Bool Source #
The isIPv4Remote, isIPv6Remote, and isDNSRemote predicate tests indicate if the specified SSHRemote is of the indicated type.
isDNSRemote :: SSHRemote -> Bool Source #
The isIPv4Remote, isIPv6Remote, and isDNSRemote predicate tests indicate if the specified SSHRemote is of the indicated type.
isIPv4Addr :: SSHRemoteAddr -> Bool Source #
The isIPv4Addr, isIPv6Addr, and isDNSAddr predicate tests indicate if the specified SSHRemoteAddr is of the indicated type.
isIPv6Addr :: SSHRemoteAddr -> Bool Source #
The isIPv4Addr, isIPv6Addr, and isDNSAddr predicate tests indicate if the specified SSHRemoteAddr is of the indicated type.
isDNSAddr :: SSHRemoteAddr -> Bool Source #
The isIPv4Addr, isIPv6Addr, and isDNSAddr predicate tests indicate if the specified SSHRemoteAddr is of the indicated type.