1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +03:00

packet: Write also incoming packets to .pcap files

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Daiki Ueno <dueno@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2018-11-27 13:17:28 +01:00
committed by Andreas Schneider
parent fff2e85ab2
commit 81fdb574e7

View File

@@ -1107,6 +1107,16 @@ int ssh_packet_socket_callback(const void *data, size_t receivedlen, void *user)
}
}
#ifdef WITH_PCAP
if (session->pcap_ctx != NULL) {
ssh_pcap_context_write(session->pcap_ctx,
SSH_PCAP_DIR_IN,
ssh_buffer_get(session->in_buffer),
ssh_buffer_get_len(session->in_buffer),
ssh_buffer_get_len(session->in_buffer));
}
#endif
/* skip the size field which has been processed before */
ssh_buffer_pass_bytes(session->in_buffer, sizeof(uint32_t));