archeus/include/arc/linux/ssh/ssh.h

59 lines
1.1 KiB
C
Raw Normal View History

#ifndef ARC_SSH_H_
#define ARC_SSH_H_
2024-07-28 03:03:19 -06:00
#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);
2024-07-28 03:03:19 -06:00
/**
* @brief
*/
ARC_String *ARC_Ssh_ExecStrInNewSessionAndGetResponse(ARC_Ssh *ssh, char *command);
#ifdef __cplusplus
}
#endif
#endif //!ARC_SSH_H_