aboutsummaryrefslogtreecommitdiff
path: root/libssh/client.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-11-16 22:36:31 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2009-11-16 22:36:31 +0100
commit02aecc1278d52fa1c2266e0a16fd3551e922f560 (patch)
treeb1629eb06f9c90593b8facfe99fc8e8c7362b1bb /libssh/client.c
parent3e90a11599d3427662ed6edb6d20b7660aba4ad8 (diff)
downloadlibssh-02aecc1278d52fa1c2266e0a16fd3551e922f560.tar.gz
libssh-02aecc1278d52fa1c2266e0a16fd3551e922f560.tar.xz
libssh-02aecc1278d52fa1c2266e0a16fd3551e922f560.zip
Improved pcap dumping support
Diffstat (limited to 'libssh/client.c')
-rw-r--r--libssh/client.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libssh/client.c b/libssh/client.c
index 5ca79be..80816b2 100644
--- a/libssh/client.c
+++ b/libssh/client.c
@@ -66,7 +66,11 @@ char *ssh_get_banner(ssh_session session) {
leave_function();
return NULL;
}
-
+#ifdef WITH_PCAP
+ if(session->pcap_ctx && buffer[i] == '\n'){
+ ssh_pcap_context_write(session->pcap_ctx,SSH_PCAP_DIR_IN,buffer,i+1,i+1);
+ }
+#endif
if (buffer[i] == '\r') {
buffer[i] = '\0';
}
@@ -197,7 +201,10 @@ int ssh_send_banner(ssh_session session, int server) {
leave_function();
return -1;
}
-
+#ifdef WITH_PCAP
+ if(session->pcap_ctx)
+ ssh_pcap_context_write(session->pcap_ctx,SSH_PCAP_DIR_OUT,buffer,strlen(buffer),strlen(buffer));
+#endif
leave_function();
return 0;
}