From 437e8bd7068c26d4a291fff66910ec8428080eae Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Sun, 20 Oct 2019 22:46:08 +0200 Subject: Implemented IMAP data extraction --- example/reader_util.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'example') diff --git a/example/reader_util.c b/example/reader_util.c index 903c8f762..1ad3e85c2 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -949,9 +949,17 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl } /* FTP */ else if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_FTP_CONTROL) { - snprintf(flow->info, sizeof(flow->info), "User: %s][Pwd: %s", - flow->ndpi_flow->protos.ftp.username, - flow->ndpi_flow->protos.ftp.password); + if(flow->ndpi_flow->protos.ftp.username[0] != '\0') + snprintf(flow->info, sizeof(flow->info), "User: %s][Pwd: %s", + flow->ndpi_flow->protos.ftp.username, + flow->ndpi_flow->protos.ftp.password); + } + /* IMAP */ + else if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_MAIL_IMAP) { + if(flow->ndpi_flow->protos.imap.username[0] != '\0') + snprintf(flow->info, sizeof(flow->info), "User: %s][Pwd: %s", + flow->ndpi_flow->protos.imap.username, + flow->ndpi_flow->protos.imap.password); } /* KERBEROS */ else if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_KERBEROS) { -- cgit v1.2.3