ssh-known-hosts-0.1.1.0: Read and interpret the SSH known-hosts file

Safe HaskellNone
LanguageHaskell2010

Network.SSH.KnownHosts

Synopsis

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.

type DNSName = [Text] Source #

data IPv4 :: * #

The abstract data type to express an IPv4 address. To create this, use toIPv4. Or use read "192.0.2.1" :: IPv4, for example. Also, "192.0.2.1" can be used as literal with OverloadedStrings.

>>> read "192.0.2.1" :: IPv4
192.0.2.1

Instances

Bounded IPv4 
Enum IPv4 

Methods

succ :: IPv4 -> IPv4 #

pred :: IPv4 -> IPv4 #

toEnum :: Int -> IPv4 #

fromEnum :: IPv4 -> Int #

enumFrom :: IPv4 -> [IPv4] #

enumFromThen :: IPv4 -> IPv4 -> [IPv4] #

enumFromTo :: IPv4 -> IPv4 -> [IPv4] #

enumFromThenTo :: IPv4 -> IPv4 -> IPv4 -> [IPv4] #

Eq IPv4 

Methods

(==) :: IPv4 -> IPv4 -> Bool #

(/=) :: IPv4 -> IPv4 -> Bool #

Data IPv4 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IPv4 -> c IPv4 #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IPv4 #

toConstr :: IPv4 -> Constr #

dataTypeOf :: IPv4 -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c IPv4) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IPv4) #

gmapT :: (forall b. Data b => b -> b) -> IPv4 -> IPv4 #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IPv4 -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IPv4 -> r #

gmapQ :: (forall d. Data d => d -> u) -> IPv4 -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> IPv4 -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> IPv4 -> m IPv4 #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IPv4 -> m IPv4 #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IPv4 -> m IPv4 #

Ord IPv4 

Methods

compare :: IPv4 -> IPv4 -> Ordering #

(<) :: IPv4 -> IPv4 -> Bool #

(<=) :: IPv4 -> IPv4 -> Bool #

(>) :: IPv4 -> IPv4 -> Bool #

(>=) :: IPv4 -> IPv4 -> Bool #

max :: IPv4 -> IPv4 -> IPv4 #

min :: IPv4 -> IPv4 -> IPv4 #

Read IPv4 
Show IPv4 

Methods

showsPrec :: Int -> IPv4 -> ShowS #

show :: IPv4 -> String #

showList :: [IPv4] -> ShowS #

IsString IPv4 

Methods

fromString :: String -> IPv4 #

Generic IPv4 

Associated Types

type Rep IPv4 :: * -> * #

Methods

from :: IPv4 -> Rep IPv4 x #

to :: Rep IPv4 x -> IPv4 #

Read (AddrRange IPv4) 
IsString (AddrRange IPv4) 
type Rep IPv4 
type Rep IPv4 = D1 (MetaData "IPv4" "Data.IP.Addr" "iproute-1.7.1-9hsGfRvggCmFA0ueZi5Sd9" True) (C1 (MetaCons "IP4" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IPv4Addr)))

data IPv6 :: * #

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

Instances

Bounded IPv6 
Enum IPv6 

Methods

succ :: IPv6 -> IPv6 #

pred :: IPv6 -> IPv6 #

toEnum :: Int -> IPv6 #

fromEnum :: IPv6 -> Int #

enumFrom :: IPv6 -> [IPv6] #

enumFromThen :: IPv6 -> IPv6 -> [IPv6] #

enumFromTo :: IPv6 -> IPv6 -> [IPv6] #

enumFromThenTo :: IPv6 -> IPv6 -> IPv6 -> [IPv6] #

Eq IPv6 

Methods

(==) :: IPv6 -> IPv6 -> Bool #

(/=) :: IPv6 -> IPv6 -> Bool #

Data IPv6 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IPv6 -> c IPv6 #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IPv6 #

toConstr :: IPv6 -> Constr #

dataTypeOf :: IPv6 -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c IPv6) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IPv6) #

gmapT :: (forall b. Data b => b -> b) -> IPv6 -> IPv6 #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IPv6 -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IPv6 -> r #

gmapQ :: (forall d. Data d => d -> u) -> IPv6 -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> IPv6 -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> IPv6 -> m IPv6 #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IPv6 -> m IPv6 #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IPv6 -> m IPv6 #

Ord IPv6 

Methods

compare :: IPv6 -> IPv6 -> Ordering #

(<) :: IPv6 -> IPv6 -> Bool #

(<=) :: IPv6 -> IPv6 -> Bool #

(>) :: IPv6 -> IPv6 -> Bool #

(>=) :: IPv6 -> IPv6 -> Bool #

max :: IPv6 -> IPv6 -> IPv6 #

min :: IPv6 -> IPv6 -> IPv6 #

Read IPv6 
Show IPv6 

Methods

showsPrec :: Int -> IPv6 -> ShowS #

show :: IPv6 -> String #

showList :: [IPv6] -> ShowS #

IsString IPv6 

Methods

fromString :: String -> IPv6 #

Generic IPv6 

Associated Types

type Rep IPv6 :: * -> * #

Methods

from :: IPv6 -> Rep IPv6 x #

to :: Rep IPv6 x -> IPv6 #

Read (AddrRange IPv6) 
IsString (AddrRange IPv6) 
type Rep IPv6 
type Rep IPv6 = D1 (MetaData "IPv6" "Data.IP.Addr" "iproute-1.7.1-9hsGfRvggCmFA0ueZi5Sd9" True) (C1 (MetaCons "IP6" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IPv6Addr)))

targetAddr :: SSHRemote -> (Text, Int) Source #

targetAddr returns the target address and port, using the best (most explicit) form of the address in the case where there are multiple addresses for the same remote system.