Add TiVoConnect dissector. Fixes #1697. (#1699)

* added static assert if supported, to complain if the flow struct changes

Signed-off-by: lns <matzeton@googlemail.com>
This commit is contained in:
Toni
2022-08-08 19:04:20 +02:00
committed by GitHub
parent 523360001e
commit 2e25c36396
118 changed files with 1945 additions and 1699 deletions
+24
View File
@@ -523,6 +523,11 @@ static void help(u_int long_help) {
#endif
if(long_help) {
printf("\n\nSize of nDPI Flow structure: %u\n"
"Sizeof of nDPI Flow protocol union: %zu\n",
ndpi_detection_get_sizeof_ndpi_flow_struct(),
sizeof(((struct ndpi_flow_struct *)0)->protos));
NDPI_PROTOCOL_BITMASK all;
ndpi_info_mod = ndpi_init_detection_module(ndpi_no_prefs);
@@ -1484,6 +1489,25 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa
}
break;
case INFO_TIVOCONNECT:
if (flow->tivoconnect.identity_uuid[0] != '\0')
{
fprintf(out, "[UUID: %s]", flow->tivoconnect.identity_uuid);
}
if (flow->tivoconnect.machine[0] != '\0')
{
fprintf(out, "[Machine: %s]", flow->tivoconnect.machine);
}
if (flow->tivoconnect.platform[0] != '\0')
{
fprintf(out, "[Platform: %s]", flow->tivoconnect.platform);
}
if (flow->tivoconnect.services[0] != '\0')
{
fprintf(out, "[Services: %s]", flow->tivoconnect.services);
}
break;
case INFO_FTP_IMAP_POP_SMTP:
if (flow->ftp_imap_pop_smtp.username[0] != '\0')
{
+12
View File
@@ -1073,6 +1073,18 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
flow->bittorent_hash[j] = '\0';
}
}
/* TIVOCONNECT */
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_TIVOCONNECT)) {
flow->info_type = INFO_TIVOCONNECT;
ndpi_snprintf(flow->tivoconnect.identity_uuid, sizeof(flow->tivoconnect.identity_uuid),
"%s", flow->ndpi_flow->protos.tivoconnect.identity_uuid);
ndpi_snprintf(flow->tivoconnect.machine, sizeof(flow->tivoconnect.machine),
"%s", flow->ndpi_flow->protos.tivoconnect.machine);
ndpi_snprintf(flow->tivoconnect.platform, sizeof(flow->tivoconnect.platform),
"%s", flow->ndpi_flow->protos.tivoconnect.platform);
ndpi_snprintf(flow->tivoconnect.services, sizeof(flow->tivoconnect.services),
"%s", flow->ndpi_flow->protos.tivoconnect.services);
}
/* SOFTETHER */
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_SOFTETHER) && !is_ndpi_proto(flow, NDPI_PROTOCOL_HTTP)) {
flow->info_type = INFO_SOFTETHER;
+7
View File
@@ -163,6 +163,7 @@ enum info_type {
INFO_GENERIC,
INFO_KERBEROS,
INFO_SOFTETHER,
INFO_TIVOCONNECT,
INFO_FTP_IMAP_POP_SMTP,
INFO_TLS_QUIC_ALPN_VERSION,
INFO_TLS_QUIC_ALPN_ONLY,
@@ -234,6 +235,12 @@ typedef struct ndpi_flow_info {
char hostname[48];
char fqdn[48];
} softether;
struct {
char identity_uuid[36];
char machine[48];
char platform[32];
char services[48];
} tivoconnect;
};
ndpi_serializer ndpi_flow_serializer;