aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2019-10-20 22:46:08 +0200
committerLuca Deri <deri@ntop.org>2019-10-20 22:46:08 +0200
commit437e8bd7068c26d4a291fff66910ec8428080eae (patch)
treedac119e4670b8856bb4c9143e3cf19984f5d8e3c /example/reader_util.c
parent1a5c7daaf67b316ad9cdcf5bba911db1a7e58f12 (diff)
Implemented IMAP data extraction
Diffstat (limited to 'example/reader_util.c')
-rw-r--r--example/reader_util.c14
1 files changed, 11 insertions, 3 deletions
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) {