diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-01-21 21:54:20 +0100 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-01-21 21:54:20 +0100 |
commit | 48ba9c9bc1b6845a2c65773e91fd95a82e2f71aa (patch) | |
tree | ede88298d8f6df0338617d819d30efd6e0f3b0ec /include/libssh | |
parent | 245deb2abe19d0e465271d54d9e404558d618ecd (diff) | |
download | libssh-48ba9c9bc1b6845a2c65773e91fd95a82e2f71aa.tar.gz libssh-48ba9c9bc1b6845a2c65773e91fd95a82e2f71aa.tar.xz libssh-48ba9c9bc1b6845a2c65773e91fd95a82e2f71aa.zip |
stub of C++ wrapper for libssh
Diffstat (limited to 'include/libssh')
-rw-r--r-- | include/libssh/libsshpp.hpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/include/libssh/libsshpp.hpp b/include/libssh/libsshpp.hpp new file mode 100644 index 0000000..9be035e --- /dev/null +++ b/include/libssh/libsshpp.hpp @@ -0,0 +1,65 @@ +/* + * This file is part of the SSH Library + * + * Copyright (c) 2010 by Aris Adamantiadis + * + * The SSH Library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at your + * option) any later version. + * + * The SSH Library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with the SSH Library; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +#ifndef LIBSSHPP_HPP_ +#define LIBSSHPP_HPP_ + +/** @defgroup ssh_cpp libssh C++ wrapper + * @addtogroup ssh_cpp + * @{ + */ + +#include <libssh/libssh.h> + +namespace ssh { +class Session { +public: + Session(){ + session=ssh_new(); + } + ~Session(){ + ssh_free(session); + session=NULL; + } + void setOption(enum ssh_options_e type, const char *option){ + ssh_options_set(session,type,option); + } + void setOption(enum ssh_options_e type, long int option){ + ssh_options_set(session,type,&option); + } + void setOption(enum ssh_options_e type, void *option){ + ssh_options_set(session,type,option); + } + int connect(){ + return ssh_connect(session); + } + int userauthAutopubkey(){ + return ssh_userauth_autopubkey(session,NULL); + } +private: + ssh_session session; +}; +} + + +/** @} + */ +#endif /* LIBSSHPP_HPP_ */ |