summaryrefslogtreecommitdiffstats
path: root/include/libssh/libssh.h
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2008-06-12 20:14:17 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2008-06-12 20:14:17 +0000
commitfe51f9c7662b7391f80953bedc4fe61b89013913 (patch)
tree66e1390ec6f593ba32b7a881040a303fd2669653 /include/libssh/libssh.h
parentb94422ef10bb083dde58e8c8349cc3e004888f9f (diff)
downloadlibssh-fe51f9c7662b7391f80953bedc4fe61b89013913.tar.gz
libssh-fe51f9c7662b7391f80953bedc4fe61b89013913.tar.xz
libssh-fe51f9c7662b7391f80953bedc4fe61b89013913.zip
big changes :
Some documentation, and a new logging system. some work must be done to get rid of the infamous ssh_say() git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@166 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'include/libssh/libssh.h')
-rw-r--r--include/libssh/libssh.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index f0114f8..c7f0d5c 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -33,6 +33,7 @@ typedef unsigned long long uint64_t;
#endif
#ifndef _WIN32
#include <sys/select.h> /* for fd_set * */
+#include <netdb.h>
#endif
#ifdef _WIN32
#include <winsock2.h>
@@ -123,11 +124,15 @@ void ssh_say(int priority,char *format,...);
void ssh_set_verbosity(int num);
/* There is a verbosity level */
- /* 3 : packet level */
- /* 2 : protocol level */
- /* 1 : functions level */
- /* 0 : important messages only */
- /* -1 : no messages */
+
+#define SSH_LOG_NOLOG 0 // no log
+#define SSH_LOG_RARE 1 // rare conditions
+#define SSH_LOG_ENTRY 2 // user-accessible entrypoints
+#define SSH_LOG_PACKET 3 // packet id and size
+#define SSH_LOG_FUNCTIONS 4 // every function in and return
+
+/* log.c */
+void ssh_log(SSH_SESSION *session, int prioriry, char *format, ...);
/* session.c */
SSH_SESSION *ssh_new();
@@ -240,6 +245,9 @@ void ssh_options_allow_ssh1(SSH_OPTIONS *opt, int allow);
void ssh_options_allow_ssh2(SSH_OPTIONS *opt, int allow);
void ssh_options_set_dsa_server_key(SSH_OPTIONS *opt, char *dsakey);
void ssh_options_set_rsa_server_key(SSH_OPTIONS *opt, char *rsakey);
+void ssh_options_set_log_function(SSH_OPTIONS *opt,
+ void (*callback)(const char *message, SSH_SESSION *session, int verbosity ));
+void ssh_options_set_log_verbosity(SSH_OPTIONS *opt, int verbosity);
/* buffer.c */