Safe Haskell | None |
---|---|
Language | Haskell98 |
- data KnownHosts
- data KnownHostResult
- data KnownHostType
- data KnownHost = KnownHost {
- khMagic :: CUInt
- khNode :: Ptr ()
- khName :: String
- khKey :: String
- khTypeMask :: [KnownHostType]
- initialize :: Bool -> IO ()
- exit :: IO ()
- initSession :: IO Session
- freeSession :: Session -> IO ()
- disconnectSession :: Session -> String -> IO ()
- handshake :: Session -> Socket -> IO ()
- setBlocking :: Session -> Bool -> IO ()
- initKnownHosts :: Session -> IO KnownHosts
- freeKnownHosts :: KnownHosts -> IO ()
- knownHostsReadFile :: KnownHosts -> FilePath -> IO Int
- getHostKey :: Session -> IO (String, Size, CInt)
- checkKnownHost :: KnownHosts -> String -> Int -> String -> [KnownHostType] -> IO KnownHostResult
- publicKeyAuthFile :: Session -> String -> String -> String -> String -> IO ()
- usernamePasswordAuth :: Session -> String -> String -> IO ()
- openChannelSession :: Session -> IO Channel
- closeChannel :: Channel -> IO ()
- freeChannel :: Channel -> IO ()
- channelSendEOF :: Channel -> IO ()
- channelWaitEOF :: Channel -> IO ()
- channelIsEOF :: Channel -> IO Bool
- readChannel :: Channel -> Size -> IO ByteString
- writeChannel :: Channel -> ByteString -> IO ()
- writeChannelFromHandle :: Channel -> Handle -> IO Integer
- readChannelToHandle :: Channel -> Handle -> Offset -> IO Integer
- channelProcess :: Channel -> String -> String -> IO ()
- channelExecute :: Channel -> String -> IO ()
- channelShell :: Channel -> IO ()
- requestPTY :: Channel -> String -> IO ()
- requestPTYEx :: Channel -> String -> String -> Int -> Int -> Int -> Int -> IO Int
- channelExitStatus :: Channel -> IO Int
- channelExitSignal :: Channel -> IO (Int, String, Maybe String, Maybe String)
- scpSendChannel :: Session -> String -> Int -> Int64 -> POSIXTime -> POSIXTime -> IO Channel
- scpReceiveChannel :: Session -> FilePath -> IO (Channel, Offset)
- pollChannelRead :: Channel -> IO Bool
- sftpInit :: Session -> IO Sftp
- sftpShutdown :: Sftp -> IO ()
- sftpOpenDir :: Sftp -> String -> IO SftpHandle
- sftpReadDir :: SftpHandle -> IO (Maybe (ByteString, SftpAttributes))
- sftpCloseHandle :: SftpHandle -> IO ()
- sftpOpenFile :: Sftp -> String -> Int -> [SftpFileTransferFlags] -> IO SftpHandle
- sftpRenameFile :: Sftp -> FilePath -> FilePath -> IO ()
- sftpRenameFileEx :: Sftp -> FilePath -> FilePath -> [RenameFlag] -> IO ()
- sftpWriteFileFromHandler :: SftpHandle -> Handle -> IO Integer
- sftpReadFileToHandler :: SftpHandle -> Handle -> Int -> IO Int
- sftpFstat :: SftpHandle -> IO SftpAttributes
- sftpDeleteFile :: Sftp -> FilePath -> IO ()
- data RenameFlag
- data SftpFileTransferFlags
- data SftpAttributes = SftpAttributes {}
- data TraceFlag
- setTraceMode :: Session -> [TraceFlag] -> IO ()
Types
data KnownHosts Source #
data KnownHostResult Source #
data KnownHostType Source #
Session functions
initialize :: Bool -> IO () Source #
Initialize libssh2. Pass True to enable encryption or False to disable it.
initSession :: IO Session Source #
Create Session object
freeSession :: Session -> IO () Source #
Free Session object's memory
Disconnect session (but do not free memory)
Known hosts functions
initKnownHosts :: Session -> IO KnownHosts Source #
Create KnownHosts object for given session.
freeKnownHosts :: KnownHosts -> IO () Source #
Free KnownHosts object's memory
:: KnownHosts | |
-> FilePath | Path to known_hosts file |
-> IO Int |
Read known hosts from file
:: KnownHosts | |
-> String | Host name |
-> Int | Port number (usually 22) |
-> String | Host public key |
-> [KnownHostType] | Host flags (see libssh2 documentation) |
-> IO KnownHostResult |
Check host data against known hosts.
Authentication
:: Session | Session |
-> String | Username |
-> String | Path to public key |
-> String | Path to private key |
-> String | Passphrase |
-> IO () |
Perform public key authentication.
Perform username/password authentication.
Channel functions
closeChannel :: Channel -> IO () Source #
Close channel (but do not free memory)
freeChannel :: Channel -> IO () Source #
Free channel object's memory
channelSendEOF :: Channel -> IO () Source #
channelWaitEOF :: Channel -> IO () Source #
:: Channel | |
-> Size | Amount of data to read |
-> IO ByteString |
Read data from channel.
writeChannel :: Channel -> ByteString -> IO () Source #
Write data to channel.
writeChannelFromHandle :: Channel -> Handle -> IO Integer Source #
Write all data to channel from handle. Returns amount of transferred data.
readChannelToHandle :: Channel -> Handle -> Offset -> IO Integer Source #
Read all data from channel to handle. Returns amount of transferred data.
channelShell :: Channel -> IO () Source #
Execute shell command
channelExitSignal :: Channel -> IO (Int, String, Maybe String, Maybe String) Source #
Get channel exit signal. Returns: (possibly error code, exit signal name, possibly error message, possibly language code).
scpSendChannel :: Session -> String -> Int -> Int64 -> POSIXTime -> POSIXTime -> IO Channel Source #
Create SCP file send channel.
scpReceiveChannel :: Session -> FilePath -> IO (Channel, Offset) Source #
Create SCP file receive channel. TODO: receive struct stat also.
SFTP functions
sftpShutdown :: Sftp -> IO () Source #
sftpOpenDir :: Sftp -> String -> IO SftpHandle Source #
Open directory file handler
sftpReadDir :: SftpHandle -> IO (Maybe (ByteString, SftpAttributes)) Source #
Read directory from file handler
sftpCloseHandle :: SftpHandle -> IO () Source #
Close file handle
sftpOpenFile :: Sftp -> String -> Int -> [SftpFileTransferFlags] -> IO SftpHandle Source #
Open regular file handler
Rename a file on the sftp server
:: Sftp | Opened sftp session |
-> FilePath | Old file name |
-> FilePath | New file name |
-> [RenameFlag] | Rename flags |
-> IO () |
Rename a file on the sftp server
sftpWriteFileFromHandler :: SftpHandle -> Handle -> IO Integer Source #
Upload file to the sftp server
sftpReadFileToHandler :: SftpHandle -> Handle -> Int -> IO Int Source #
Download file from the sftp server
sftpFstat :: SftpHandle -> IO SftpAttributes Source #
Get sftp attributes from the sftp handler
Delete file from SFTP server
data RenameFlag Source #
data SftpFileTransferFlags Source #
Sftp support