Loading...
Searching...
No Matches
ssh.h
Go to the documentation of this file.
#ifndef ARC_SSH_H_
#define ARC_SSH_H_
#include "arc/std/string.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief ssh type that holds ssh connection along with credentials
*/
typedef struct ARC_Ssh ARC_Ssh;
/**
* @brief a ssh session function
*
* @param data user data that can be used within the callback
*/
typedef void (* ARC_Ssh_SessionFn)(void *data);
/**
* @brief creates ARC_Ssh type
*
* @param ssh ARC_Ssh to create
*/
void ARC_Ssh_Create(ARC_Ssh **ssh, char *host, char *user, char *password);
/**
* @brief destroyes ARC_Ssh type
*
* @param ssh ARC_Ssh to destroy
*/
void ARC_Ssh_Destroy(ARC_Ssh *ssh);
/**
* @brief runs a callback function within a ssh session
*
* @param ssh ARC_Ssh to create and run function in ssh session
* @param sessionFN callback to run in a ssh session
*/
void ARC_Ssh_RunInSession(ARC_Ssh *ssh, ARC_Ssh_SessionFn sessionFn);
/**
* @brief
*/
void ARC_Ssh_ExecStrInNewSession(ARC_Ssh *ssh, char *command);
/**
* @brief
*/
ARC_String *ARC_Ssh_ExecStrInNewSessionAndGetResponse(ARC_Ssh *ssh, char *command);
#ifdef __cplusplus
}
#endif
#endif //!ARC_SSH_H_
ARC_Ssh_Destroy
void ARC_Ssh_Destroy(ARC_Ssh *ssh)
destroyes ARC_Ssh type
ARC_Ssh_ExecStrInNewSessionAndGetResponse
ARC_String * ARC_Ssh_ExecStrInNewSessionAndGetResponse(ARC_Ssh *ssh, char *command)
ARC_Ssh_ExecStrInNewSession
void ARC_Ssh_ExecStrInNewSession(ARC_Ssh *ssh, char *command)
ARC_Ssh_RunInSession
void ARC_Ssh_RunInSession(ARC_Ssh *ssh, ARC_Ssh_SessionFn sessionFn)
runs a callback function within a ssh session
ARC_Ssh_SessionFn
void(* ARC_Ssh_SessionFn)(void *data)
a ssh session function
Definition ssh.h:20
ARC_Ssh_Create
void ARC_Ssh_Create(ARC_Ssh **ssh, char *host, char *user, char *password)
creates ARC_Ssh type
ARC_Ssh
struct ARC_Ssh ARC_Ssh
ssh type that holds ssh connection along with credentials
Definition ssh.h:13
string.h
ARC_String
substring position within a string
Definition string.h:14