Files
skevity/source/ssh_server_client.h

45 lines
934 B
C

#ifndef SSH_SERVER_CLIENT_H
#define SSH_SERVER_CLIENT_H
#include <pthread.h>
typedef struct {
int inputSize;
int* outputSize;
char* inputBuffer;
char* outputBuffer;
int width;
int height;
void* channel;
}ssh_terminal_data;
typedef int(*ssh_server_callback)(void* userdata);
typedef int(*ssh_server_resize_callback)(int,int,void* userdata);
typedef int(*ssh_server_run_callback)(ssh_terminal_data* ssh_terminal_data, void* userdata);
typedef struct {
void* init_var;
void* run_var;
void* stop_var;
void* resize_var;
ssh_server_callback ssh_init;
ssh_server_run_callback ssh_run;
ssh_server_callback ssh_stop;
ssh_server_resize_callback ssh_resize;
}ServerLoopCallbacks;
typedef struct {
int port;
int id;
ServerLoopCallbacks cbs;
pthread_t clients[12];
int threadCount;
int* stop;
}ServerConfig;
int ssh_start(ServerConfig* conf);
#endif