aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2019-10-21 01:27:07 +0200
committerLuca Deri <deri@ntop.org>2019-10-21 01:27:07 +0200
commit960aa77b6da9bd70081621ae8e975e548ce7cc13 (patch)
tree88479d5b26613387aeedb5b6977ec28e4b980e25 /example/reader_util.c
parent58daa5ed7d2c4fe26a5b4bdc77f117ad3b027a71 (diff)
Reworked email metaata extraction
Diffstat (limited to 'example/reader_util.c')
-rw-r--r--example/reader_util.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/example/reader_util.c b/example/reader_util.c
index dffd0128c..a8b91cd8e 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -948,25 +948,14 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
snprintf(flow->info, sizeof(flow->info), "%s", flow->ndpi_flow->protos.ubntac2.version);
}
/* FTP */
- else if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_FTP_CONTROL) {
- if(flow->ndpi_flow->protos.ftp.username[0] != '\0')
+ else if((flow->detected_protocol.app_protocol == NDPI_PROTOCOL_FTP_CONTROL)
+ || /* IMAP */ (flow->detected_protocol.app_protocol == NDPI_PROTOCOL_MAIL_IMAP)
+ || /* POP */ (flow->detected_protocol.app_protocol == NDPI_PROTOCOL_MAIL_POP)
+ || /* SMTP */ (flow->detected_protocol.app_protocol == NDPI_PROTOCOL_MAIL_SMTP)) {
+ if(flow->ndpi_flow->protos.ftp_imap_pop_smtp.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);
- }
- /* POP */
- else if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_MAIL_POP) {
- if(flow->ndpi_flow->protos.pop.username[0] != '\0')
- snprintf(flow->info, sizeof(flow->info), "User: %s][Pwd: %s",
- flow->ndpi_flow->protos.pop.username,
- flow->ndpi_flow->protos.pop.password);
+ flow->ndpi_flow->protos.ftp_imap_pop_smtp.username,
+ flow->ndpi_flow->protos.ftp_imap_pop_smtp.password);
}
/* KERBEROS */
else if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_KERBEROS) {