aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_utils.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2019-10-20 23:06:05 +0200
committerLuca Deri <deri@ntop.org>2019-10-20 23:06:05 +0200
commit58daa5ed7d2c4fe26a5b4bdc77f117ad3b027a71 (patch)
tree293a96e7cb9dcbb9ba1a53c67a8652b9710bdd6c /src/lib/ndpi_utils.c
parent437e8bd7068c26d4a291fff66910ec8428080eae (diff)
Added POP3 metadata extraction
Diffstat (limited to 'src/lib/ndpi_utils.c')
-rw-r--r--src/lib/ndpi_utils.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c
index 20d231db8..58da998d0 100644
--- a/src/lib/ndpi_utils.c
+++ b/src/lib/ndpi_utils.c
@@ -755,6 +755,25 @@ void ndpi_patchIPv6Address(char *str) {
/* ********************************** */
+void ndpi_user_pwd_payload_copy(u_int8_t *dest, u_int dest_len,
+ const u_int8_t *src, u_int src_len) {
+ u_int i, j, k = dest_len-1;
+
+ for(i=5, j=0; i<src_len; i++) {
+ if((j == k) || ((src[i] == '\r')
+ || (src[i] == '\n')
+ || (src[i] == ' ')
+ ))
+ break;
+
+ dest[j++] = src[i];
+ }
+
+ dest[k] = '\0';
+}
+
+/* ********************************** */
+
int ndpi_flow2json(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int8_t ip_version,