mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-10 06:23:01 +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:
committed by
Andreas Schneider
parent
fff2e85ab2
commit
81fdb574e7
10
src/packet.c
10
src/packet.c
@@ -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 */
|
/* skip the size field which has been processed before */
|
||||||
ssh_buffer_pass_bytes(session->in_buffer, sizeof(uint32_t));
|
ssh_buffer_pass_bytes(session->in_buffer, sizeof(uint32_t));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user