aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'example/reader_util.h')
-rw-r--r--example/reader_util.h42
1 files changed, 32 insertions, 10 deletions
diff --git a/example/reader_util.h b/example/reader_util.h
index 5ade8250e..c49237b9f 100644
--- a/example/reader_util.h
+++ b/example/reader_util.h
@@ -1,7 +1,7 @@
/*
* ndpi_util.h
*
- * Copyright (C) 2011-22 - ntop.org
+ * Copyright (C) 2011-25 - ntop.org
*
* nDPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -171,6 +171,8 @@ enum info_type {
INFO_FTP_IMAP_POP_SMTP,
INFO_NATPMP,
INFO_SIP,
+ INFO_FASTCGI,
+ INFO_BFCP,
};
typedef struct {
@@ -193,7 +195,7 @@ typedef struct ndpi_flow_info {
u_int16_t vlan_id;
ndpi_packet_tunnel tunnel_type;
struct ndpi_flow_struct *ndpi_flow;
- char src_name[INET6_ADDRSTRLEN], dst_name[INET6_ADDRSTRLEN];
+ char *src_name, *dst_name;
u_int8_t ip_version;
u_int32_t cwr_count, src2dst_cwr_count, dst2src_cwr_count;
u_int32_t ece_count, src2dst_ece_count, dst2src_ece_count;
@@ -270,6 +272,17 @@ typedef struct ndpi_flow_info {
char to[256];
char to_imsi[16];
} sip;
+
+ struct {
+ ndpi_http_method method;
+ char user_agent[32];
+ char url[64];
+ } fast_cgi;
+
+ struct {
+ u_int32_t conference_id;
+ u_int16_t user_id;
+ } bfcp;
};
ndpi_serializer ndpi_flow_serializer;
@@ -307,7 +320,6 @@ typedef struct ndpi_flow_info {
u_int32_t quic_version;
- struct ndpi_tls_obfuscated_heuristic_matching_set obfuscated_heur_matching_set;
} ssh_tls;
struct {
@@ -316,6 +328,8 @@ typedef struct ndpi_flow_info {
u_int response_status_code;
} http;
+ struct rtp_info rtp[2 /* directions */];
+
struct {
ndpi_address_port_list mapped_address, peer_address,
relayed_address, response_origin, other_address;
@@ -328,6 +342,8 @@ typedef struct ndpi_flow_info {
struct {
char geolocation_iata_code[4];
+ char ptr_domain_name[64];
+ u_int16_t transaction_id;
} dns;
u_int8_t multimedia_flow_types;
@@ -356,12 +372,16 @@ typedef struct ndpi_stats {
u_int64_t raw_packet_count;
u_int64_t ip_packet_count;
u_int64_t total_wire_bytes, total_ip_bytes, total_discarded_bytes;
- u_int64_t protocol_counter[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
- u_int64_t protocol_counter_bytes[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
- u_int32_t protocol_flows[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
- u_int64_t fpc_protocol_counter[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
- u_int64_t fpc_protocol_counter_bytes[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
- u_int32_t fpc_protocol_flows[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
+ u_int32_t num_protocols;
+ u_int64_t *protocol_counter;
+ u_int64_t *protocol_counter_bytes;
+ u_int32_t *protocol_flows;
+ u_int64_t *fpc_protocol_counter;
+ u_int64_t *fpc_protocol_counter_bytes;
+ u_int32_t *fpc_protocol_flows;
+ u_int64_t category_counter[NDPI_PROTOCOL_NUM_CATEGORIES];
+ u_int64_t category_counter_bytes[NDPI_PROTOCOL_NUM_CATEGORIES];
+ u_int32_t category_flows[NDPI_PROTOCOL_NUM_CATEGORIES];
u_int32_t ndpi_flow_count;
u_int32_t flow_count[3];
u_int64_t tcp_count, udp_count;
@@ -417,6 +437,9 @@ typedef struct ndpi_workflow {
ndpi_serialization_format ndpi_serialization_format;
} ndpi_workflow_t;
+void ndpi_stats_free(ndpi_stats_t *s);
+int ndpi_stats_init(ndpi_stats_t *s, uint32_t num_protocols);
+void ndpi_stats_reset(ndpi_stats_t *s);
/* TODO: remove wrappers parameters and use ndpi global, when their initialization will be fixed... */
struct ndpi_workflow * ndpi_workflow_init(const struct ndpi_workflow_prefs * prefs, pcap_t * pcap_handle, int do_init_flows_root, ndpi_serialization_format serialization_format, struct ndpi_global_context *g_ctx);
@@ -455,7 +478,6 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
void ndpi_flow_info_free_data(struct ndpi_flow_info *flow);
void ndpi_flow_info_freer(void *node);
const char* print_cipher_id(u_int32_t cipher);
-int parse_proto_name_list(char *str, NDPI_PROTOCOL_BITMASK *bitmask, int inverted_logic);
extern int reader_log_level;