diff options
author | Julien Dessaux | 2018-05-22 17:31:56 +0200 |
---|---|---|
committer | Julien Dessaux | 2018-05-22 17:31:56 +0200 |
commit | e840c061817a797fae31a14796a790b0c979e43f (patch) | |
tree | a64752420ae1b7a91e43e4d4314b5df9f8609313 /src/util.h | |
download | bastion-e840c061817a797fae31a14796a790b0c979e43f.tar.gz bastion-e840c061817a797fae31a14796a790b0c979e43f.tar.bz2 bastion-e840c061817a797fae31a14796a790b0c979e43f.zip |
Initial import with working simple server based on libssh examples
Diffstat (limited to '')
-rw-r--r-- | src/util.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h new file mode 100644 index 0000000..48a83ff --- /dev/null +++ b/src/util.h @@ -0,0 +1,32 @@ +#ifndef _UTIL_H_ +#define _UTIL_H_ + +#include <libssh/libssh.h> + +/* A userdata struct for channel. */ +struct channel_data_struct { + /* pid of the child process the channel will spawn. */ + pid_t pid; + /* For PTY allocation */ + socket_t pty_master; + socket_t pty_slave; + /* For communication with the child process. */ + socket_t child_stdin; + socket_t child_stdout; + /* Only used for subsystem and exec requests. */ + socket_t child_stderr; + /* Event which is used to poll the above descriptors. */ + ssh_event event; + /* Terminal size struct. */ + struct winsize *winsize; +}; + +/* A userdata struct for session. */ +struct session_data_struct { + /* Pointer to the channel the session will allocate. */ + ssh_channel channel; + int auth_attempts; + int authenticated; +}; + +#endif |